From: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk>
To: Sunil Kumar Kori <skori@marvell.com>,
Rakesh Kudurumalla <rkudurumalla@marvell.com>,
Jerin Jacob <jerinj@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>
Cc: dev@dpdk.org, stable@dpdk.org,
Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk>
Subject: [PATCH] app/graph: fix overrun error (destination buffer too small)
Date: Thu, 7 Aug 2025 07:06:40 -0400 [thread overview]
Message-ID: <20250807110640.1094029-1-14pwcse1224@uetpeshawar.edu.pk> (raw)
Some memory locations will be written with incorrect values,
possibly corrupting data structures or data integrity.
Size of destination buffer is smaller than the size
argument specified.
Coverity issue: 415430
Fixes: 3850cb06ab9c ('app/graph: add ethdev commands')
Cc: stable@dpdk.org
Signed-off-by: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk>
---
app/graph/ethdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/graph/ethdev.c b/app/graph/ethdev.c
index 2f4cf65c96..f6d4bce9ab 100644
--- a/app/graph/ethdev.c
+++ b/app/graph/ethdev.c
@@ -663,11 +663,12 @@ cmd_ethdev_parsed(void *parsed_result, __rte_unused struct cmdline *cl, void *da
struct cmd_ethdev_result *res = parsed_result;
struct ethdev_config config;
int rc;
-
+ size_t len;
memset(&config, 0, sizeof(struct ethdev_config));
config.rx.n_queues = res->nb_rxq;
config.rx.queue_size = ETHDEV_RX_DESC_DEFAULT;
- memcpy(config.rx.mempool_name, res->mempool, strlen(res->mempool));
+ len = strnlen(res->mempool, sizeof(config.rx.mempool_name));
+ memcpy(config.rx.mempool_name, res->mempool, len);
config.tx.n_queues = res->nb_txq;
config.tx.queue_size = ETHDEV_TX_DESC_DEFAULT;
--
2.43.0
next reply other threads:[~2025-08-07 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-07 11:06 Khadem Ullah [this message]
2025-08-08 3:32 ` Varghese, Vipin
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=20250807110640.1094029-1-14pwcse1224@uetpeshawar.edu.pk \
--to=14pwcse1224@uetpeshawar.edu.pk \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=rkudurumalla@marvell.com \
--cc=skori@marvell.com \
--cc=stable@dpdk.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).