patch 'net/af_xdp: fix use after free in zero-copy Tx' has been queued to stable release 24.11.3

Kevin Traynor ktraynor at redhat.com
Fri Jul 18 21:29:34 CEST 2025


Hi,

FYI, your patch has been queued to stable release 24.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/23/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/f7b74c765d4fcace202c74ae2f26671f138145f9

Thanks.

Kevin

---
>From f7b74c765d4fcace202c74ae2f26671f138145f9 Mon Sep 17 00:00:00 2001
From: Ariel Otilibili <ariel.otilibili at 6wind.com>
Date: Wed, 26 Feb 2025 21:08:40 +0100
Subject: [PATCH] net/af_xdp: fix use after free in zero-copy Tx

[ upstream commit a23bf7fde78b10afbbafda252f15495b26e010a9 ]

tx_bytes is computed after both legs are tested. This might
produce a use after memory free.

The computation is now moved into each leg.

Bugzilla ID: 1440
Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")

Signed-off-by: Ariel Otilibili <ariel.otilibili at 6wind.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
 .mailmap                            | 2 +-
 drivers/net/af_xdp/rte_eth_af_xdp.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.mailmap b/.mailmap
index a4bacad9a4..257dd551a6 100644
--- a/.mailmap
+++ b/.mailmap
@@ -136,5 +136,5 @@ Apeksha Gupta <apeksha.gupta at nxp.com>
 Archana Muniganti <marchana at marvell.com> <muniganti.archana at caviumnetworks.com>
 Archit Pandey <architpandeynitk at gmail.com>
-Ariel Otilibili <otilibil at eurecom.fr> <ariel.otilibili at 6wind.com>
+Ariel Otilibili <ariel.otilibili at 6wind.com> <otilibil at eurecom.fr>
 Arkadiusz Kubalewski <arkadiusz.kubalewski at intel.com>
 Arkadiusz Kusztal <arkadiuszx.kusztal at intel.com>
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 814398ba4b..092bcb73aa 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -575,4 +575,5 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			offset = offset << XSK_UNALIGNED_BUF_OFFSET_SHIFT;
 			desc->addr = addr | offset;
+			tx_bytes += desc->len;
 			count++;
 		} else {
@@ -602,9 +603,8 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			rte_memcpy(pkt, rte_pktmbuf_mtod(mbuf, void *),
 					desc->len);
+			tx_bytes += desc->len;
 			rte_pktmbuf_free(mbuf);
 			count++;
 		}
-
-		tx_bytes += mbuf->pkt_len;
 	}
 
-- 
2.50.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-07-18 20:29:12.517329434 +0100
+++ 0040-net-af_xdp-fix-use-after-free-in-zero-copy-Tx.patch	2025-07-18 20:29:10.917907291 +0100
@@ -1 +1 @@
-From a23bf7fde78b10afbbafda252f15495b26e010a9 Mon Sep 17 00:00:00 2001
+From f7b74c765d4fcace202c74ae2f26671f138145f9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a23bf7fde78b10afbbafda252f15495b26e010a9 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 4b781bd3fb..822936f615 100644
+index a4bacad9a4..257dd551a6 100644



More information about the stable mailing list