patch 'net/qede: fix use after free' has been queued to stable release 24.11.3
Kevin Traynor
ktraynor at redhat.com
Fri Jul 18 21:29:45 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/562dab834f712c051aee23e8afb16ed64c3bd99e
Thanks.
Kevin
---
>From 562dab834f712c051aee23e8afb16ed64c3bd99e Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Thu, 13 Mar 2025 10:22:03 -0700
Subject: [PATCH] net/qede: fix use after free
[ upstream commit ab8caba639ee6378055b2d8518e2a97b2212c737 ]
The loop cleaning up flowdir resources was using SLIST_FOREACH
but the inner loop would call rte_free. Found by building with
address sanitizer undefined check.
Also remove needless initialization, and null check.
Fixes: f5765f66f9bb ("net/qede: refactor flow director into generic aRFS")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/qede/qede_filter.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c
index 14fb4338e9..cecb58c997 100644
--- a/drivers/net/qede/qede_filter.c
+++ b/drivers/net/qede/qede_filter.c
@@ -13,4 +13,11 @@
#include "qede_ethdev.h"
+#ifndef SLIST_FOREACH_SAFE
+#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = SLIST_FIRST((head)); \
+ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+#endif
+
/* VXLAN tunnel classification mapping */
const struct _qede_udp_tunn_types {
@@ -155,13 +162,10 @@ void qede_fdir_dealloc_resc(struct rte_eth_dev *eth_dev)
{
struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
- struct qede_arfs_entry *tmp = NULL;
+ struct qede_arfs_entry *tmp, *tmp2;
- SLIST_FOREACH(tmp, &qdev->arfs_info.arfs_list_head, list) {
- if (tmp) {
- rte_memzone_free(tmp->mz);
- SLIST_REMOVE(&qdev->arfs_info.arfs_list_head, tmp,
- qede_arfs_entry, list);
- rte_free(tmp);
- }
+ SLIST_FOREACH_SAFE(tmp, &qdev->arfs_info.arfs_list_head, list, tmp2) {
+ rte_memzone_free(tmp->mz);
+ SLIST_REMOVE(&qdev->arfs_info.arfs_list_head, tmp, qede_arfs_entry, list);
+ rte_free(tmp);
}
}
--
2.50.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-07-18 20:29:12.866837068 +0100
+++ 0051-net-qede-fix-use-after-free.patch 2025-07-18 20:29:10.932907337 +0100
@@ -1 +1 @@
-From ab8caba639ee6378055b2d8518e2a97b2212c737 Mon Sep 17 00:00:00 2001
+From 562dab834f712c051aee23e8afb16ed64c3bd99e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ab8caba639ee6378055b2d8518e2a97b2212c737 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list