From: fengchengwen <fengchengwen@huawei.com>
To: Stephen Hemminger <stephen@networkplumber.org>, <dev@dpdk.org>
Subject: Re: [PATCH] test/argparse: fix out of bound memcpy
Date: Mon, 7 Jul 2025 12:12:52 +0800 [thread overview]
Message-ID: <1c3c36e5-dbfa-4a6c-b5b1-b7bc0c944f97@huawei.com> (raw)
In-Reply-To: <20250627162305.340042-1-stephen@networkplumber.org>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
On 2025/6/28 0:22, Stephen Hemminger wrote:
> The rte_argparse API use variable length arrays for the args.
> But the test was only putting space on stack for the argparse
> part, not the args. This can lead to out of bounds writes.
>
> The bug only gets detected if DPDK is compiled with LTO.
> In function ‘test_argparse_copy’,
> inlined from ‘test_argparse_init_obj’ at ../app/test/test_argparse.c:108:2,
> inlined from ‘test_argparse_opt_callback_parse_int_of_no_val’ at ../app/test/test_argparse.c:490:8:
> ../app/test/test_argparse.c:96:17: warning: ‘memcpy’ writing 56 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
> 96 | memcpy(&dst->args[i], &src->args[i], sizeof(src->args[i]));
>
> Fixes: 6c5c6571601c ("argparse: verify argument config")
> Cc: fengchengwen@huawei.com
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
prev parent reply other threads:[~2025-07-07 4:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 16:22 Stephen Hemminger
2025-06-27 18:56 ` Bruce Richardson
2025-06-30 14:57 ` Stephen Hemminger
2025-06-30 14:58 ` [PATCH v2] test/argparse: change initialization to workaround LTO Stephen Hemminger
2025-06-30 15:20 ` Bruce Richardson
2025-06-30 15:23 ` Stephen Hemminger
2025-06-30 15:24 ` Stephen Hemminger
2025-07-01 15:41 ` [PATCH v3] " Stephen Hemminger
2025-07-01 15:48 ` Bruce Richardson
2025-07-07 6:42 ` fengchengwen
2025-07-07 4:12 ` fengchengwen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1c3c36e5-dbfa-4a6c-b5b1-b7bc0c944f97@huawei.com \
--to=fengchengwen@huawei.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).