patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v1] net/memif: fix segfault with large burst size
@ 2023-09-04  7:10 Joyce Kong
  2023-09-27 16:37 ` Ferruh Yigit
  2023-09-29 14:41 ` Ferruh Yigit
  0 siblings, 2 replies; 3+ messages in thread
From: Joyce Kong @ 2023-09-04  7:10 UTC (permalink / raw)
  To: Jakub Grajciar, Morten Brørup, Ruifeng Wang, Joyce Kong
  Cc: dev, nd, stable, Feifei Wang

There will be a segfault when Rx burst size is greater than
MAX_PKT_BURST of memif. Fix the issue by correcting the
wrong mbuf index in eth_memif_rx, which results in accessing
invalid memory address.

Bugzilla ID: 1273
Fixes: aa17df860891 ("net/memif: add a Rx fast path")
Cc: stable@dpdk.org

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/memif/rte_eth_memif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 6a8ff5b4eb..f595656af5 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -356,7 +356,7 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		rx_pkts = 0;
 		pkts = nb_pkts < MAX_PKT_BURST ? nb_pkts : MAX_PKT_BURST;
 		while (n_slots && rx_pkts < pkts) {
-			mbuf_head = mbufs[n_rx_pkts];
+			mbuf_head = mbufs[rx_pkts];
 			mbuf = mbuf_head;
 
 next_slot1:
-- 
2.25.1


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

end of thread, other threads:[~2023-09-29 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04  7:10 [PATCH v1] net/memif: fix segfault with large burst size Joyce Kong
2023-09-27 16:37 ` Ferruh Yigit
2023-09-29 14:41 ` Ferruh Yigit

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