patch 'net/af_xdp: fix use after free in zero-copy Tx' has been queued to stable release 22.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Jun 12 23:06:43 CEST 2025
Hi,
FYI, your patch has been queued to stable release 22.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/14/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/081c838388a346c2145e3c2ad71d375a587d178c
Thanks.
Luca Boccassi
---
>From 081c838388a346c2145e3c2ad71d375a587d178c 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 | 1 +
drivers/net/af_xdp/rte_eth_af_xdp.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/.mailmap b/.mailmap
index b4cce78ea6..7bbd4bb02e 100644
--- a/.mailmap
+++ b/.mailmap
@@ -121,6 +121,7 @@ Anupam Kapoor <anupam.kapoor at gmail.com>
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 <ariel.otilibili at 6wind.com> <otilibil at eurecom.fr>
Arkadiusz Kubalewski <arkadiusz.kubalewski at intel.com>
Arkadiusz Kusztal <arkadiuszx.kusztal at intel.com>
Arnon Warshavsky <arnon at qwilt.com>
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 343b4c40c9..5b50fd3b6b 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -544,6 +544,7 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
umem->mb_pool->header_size;
offset = offset << XSK_UNALIGNED_BUF_OFFSET_SHIFT;
desc->addr = addr | offset;
+ tx_bytes += desc->len;
count++;
} else {
struct rte_mbuf *local_mbuf =
@@ -571,11 +572,10 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
desc->addr = addr | offset;
rte_memcpy(pkt, rte_pktmbuf_mtod(mbuf, void *),
desc->len);
+ tx_bytes += desc->len;
rte_pktmbuf_free(mbuf);
count++;
}
-
- tx_bytes += mbuf->pkt_len;
}
out:
--
2.47.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-06-12 22:06:24.866146174 +0100
+++ 0026-net-af_xdp-fix-use-after-free-in-zero-copy-Tx.patch 2025-06-12 22:06:23.842044047 +0100
@@ -1 +1 @@
-From a23bf7fde78b10afbbafda252f15495b26e010a9 Mon Sep 17 00:00:00 2001
+From 081c838388a346c2145e3c2ad71d375a587d178c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a23bf7fde78b10afbbafda252f15495b26e010a9 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
- .mailmap | 2 +-
+ .mailmap | 1 +
@@ -20 +21 @@
- 2 files changed, 3 insertions(+), 3 deletions(-)
+ 2 files changed, 3 insertions(+), 2 deletions(-)
@@ -23 +24 @@
-index 4b781bd3fb..822936f615 100644
+index b4cce78ea6..7bbd4bb02e 100644
@@ -26 +27 @@
-@@ -135,7 +135,7 @@ Anupam Kapoor <anupam.kapoor at gmail.com>
+@@ -121,6 +121,7 @@ Anupam Kapoor <anupam.kapoor at gmail.com>
@@ -30 +30,0 @@
--Ariel Otilibili <otilibil at eurecom.fr> <ariel.otilibili at 6wind.com>
@@ -34 +34 @@
- Arnaud Fiorini <arnaud.fiorini at polymtl.ca>
+ Arnon Warshavsky <arnon at qwilt.com>
@@ -36 +36 @@
-index 814398ba4b..092bcb73aa 100644
+index 343b4c40c9..5b50fd3b6b 100644
@@ -39 +39 @@
-@@ -574,6 +574,7 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -544,6 +544,7 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -47 +47 @@
-@@ -601,11 +602,10 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -571,11 +572,10 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
More information about the stable
mailing list