DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mvneta: fix possible out-of-bounds write
@ 2024-10-09  2:23 Chengwen Feng
  2024-10-09  3:48 ` Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Chengwen Feng @ 2024-10-09  2:23 UTC (permalink / raw)
  To: thomas, ferruh.yigit, stephen, Zyta Szpak, Liron Himi,
	Dmitri Epshtein, Natalie Samsonov, Andrzej Ostruszka,
	Ferruh Yigit
  Cc: dev

The mvneta_ifnames_get() function will save 'iface' value to ifnames,
it will out-of-bounds write if passed many iface pairs (e.g.
'iface=xxx,iface=xxx,...').

Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/mvneta/mvneta_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index 3841c1ebe9..c49f083efa 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -91,6 +91,9 @@ mvneta_ifnames_get(const char *key __rte_unused, const char *value,
 {
 	struct mvneta_ifnames *ifnames = extra_args;
 
+	if (ifnames->idx >= NETA_NUM_ETH_PPIO)
+		return -EINVAL;
+
 	ifnames->names[ifnames->idx++] = value;
 
 	return 0;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-10-24  6:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-09  2:23 [PATCH] net/mvneta: fix possible out-of-bounds write Chengwen Feng
2024-10-09  3:48 ` Stephen Hemminger
2024-10-09  3:48 ` zhoumin
2024-10-09  6:08 ` [PATCH v2] " Chengwen Feng
2024-10-09 15:09   ` Stephen Hemminger
2024-10-09 18:00   ` Stephen Hemminger
2024-10-10  1:01     ` fengchengwen
2024-10-10  0:53 ` [PATCH v3] " Chengwen Feng
2024-10-10  1:10   ` Stephen Hemminger
2024-10-24  6:27     ` Jerin Jacob

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).