patch 'net/qede: fix use after free' has been queued to stable release 22.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 12 23:06:51 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/fb9df72195989e710bfea02de8e150bbaec22696

Thanks.

Luca Boccassi

---
>From fb9df72195989e710bfea02de8e150bbaec22696 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 | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c
index c5945451e8..de7ca28afd 100644
--- a/drivers/net/qede/qede_filter.c
+++ b/drivers/net/qede/qede_filter.c
@@ -12,6 +12,13 @@
 
 #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 {
 	uint16_t rte_filter_type;
@@ -154,16 +161,12 @@ int qede_check_fdir_support(struct rte_eth_dev *eth_dev)
 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) {
-			if (tmp->mz)
-				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.47.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-06-12 22:06:25.150359440 +0100
+++ 0034-net-qede-fix-use-after-free.patch	2025-06-12 22:06:23.858044384 +0100
@@ -1 +1 @@
-From ab8caba639ee6378055b2d8518e2a97b2212c737 Mon Sep 17 00:00:00 2001
+From fb9df72195989e710bfea02de8e150bbaec22696 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ab8caba639ee6378055b2d8518e2a97b2212c737 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -17,2 +18,2 @@
- drivers/net/qede/qede_filter.c | 20 ++++++++++++--------
- 1 file changed, 12 insertions(+), 8 deletions(-)
+ drivers/net/qede/qede_filter.c | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
@@ -21 +22 @@
-index 14fb4338e9..cecb58c997 100644
+index c5945451e8..de7ca28afd 100644
@@ -38 +39 @@
-@@ -154,15 +161,12 @@ int qede_check_fdir_support(struct rte_eth_dev *eth_dev)
+@@ -154,16 +161,12 @@ int qede_check_fdir_support(struct rte_eth_dev *eth_dev)
@@ -47 +48,2 @@
--			rte_memzone_free(tmp->mz);
+-			if (tmp->mz)
+-				rte_memzone_free(tmp->mz);


More information about the stable mailing list