patch 'net/ice: fix memory leak in FDIR flow parsing' has been queued to stable release 24.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 20 15:56:48 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/22/26. 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/d470b438525f6a3beaa1d9b392a478c5ed8bc6e9

Thanks.

Luca Boccassi

---
>From d470b438525f6a3beaa1d9b392a478c5ed8bc6e9 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov at intel.com>
Date: Fri, 13 Feb 2026 09:10:14 +0000
Subject: [PATCH] net/ice: fix memory leak in FDIR flow parsing

[ upstream commit 3a3a249bc595627a81dd1e9cc0a93993736a6871 ]

Currently, RAW pattern parsing will cause a `pkt_buf` buffer to be
allocated to store parsed RAW pattern bytes. All error paths handle the
deallocation correctly, and the buffer will then be passed to FDIR
filter create function which also handles the presence of the buffer
correctly, and it is also freed correctly in destroy function.

However, rte_flow_validate will go through the same code path, but will
not call FDIR create/destroy nor even store the pointer, because `meta`
variable inside the flow parsing function will be set to NULL, which
will cause this memory to be leaked (and memset(0)-ed next time we try
to create/validate another flow).

Fix it by freeing the `pkt_buf` when `meta` is NULL.

Additionally, the initial allocation was done using `ice_malloc` macro.
It does not affect anything as `ice_malloc` translates to `rte_zmalloc`
anyway but for consistency, change the allocation to `rte_zmalloc` as
well.

Fixes: 25be39cc1760 ("net/ice: enable protocol agnostic flow offloading in FDIR")

Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
---
 drivers/net/ice/ice_fdir_filter.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 990b355203..6113e44f5f 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1929,7 +1929,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 				goto raw_error;
 			}
 
-			u8 *pkt_buf = (u8 *)ice_malloc(&ad->hw, pkt_len + 1);
+			u8 *pkt_buf = (u8 *)rte_zmalloc("raw pkt buf", pkt_len + 1, 0);
 			if (!pkt_buf) {
 				ret_val = -ENOMEM;
 				goto raw_error;
@@ -2483,8 +2483,12 @@ ice_fdir_parse(struct ice_adapter *ad,
 	if (ret)
 		goto error;
 
-	if (meta)
+	/* if meta is NULL we're validating so the flow won't be stored */
+	if (meta) {
 		*meta = filter;
+	} else if (filter->pkt_buf != NULL) {
+		rte_free(filter->pkt_buf);
+	}
 
 	rte_free(item);
 	return ret;
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-02-20 14:55:47.256777638 +0000
+++ 0106-net-ice-fix-memory-leak-in-FDIR-flow-parsing.patch	2026-02-20 14:55:43.356193651 +0000
@@ -1 +1 @@
-From 3a3a249bc595627a81dd1e9cc0a93993736a6871 Mon Sep 17 00:00:00 2001
+From d470b438525f6a3beaa1d9b392a478c5ed8bc6e9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3a3a249bc595627a81dd1e9cc0a93993736a6871 ]
+
@@ -26 +27,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
- drivers/net/intel/ice/ice_fdir_filter.c | 8 ++++++--
+ drivers/net/ice/ice_fdir_filter.c | 8 ++++++--
@@ -34,5 +35,5 @@
-diff --git a/drivers/net/intel/ice/ice_fdir_filter.c b/drivers/net/intel/ice/ice_fdir_filter.c
-index f7730ec6ab..da22b65a77 100644
---- a/drivers/net/intel/ice/ice_fdir_filter.c
-+++ b/drivers/net/intel/ice/ice_fdir_filter.c
-@@ -1938,7 +1938,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
+diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
+index 990b355203..6113e44f5f 100644
+--- a/drivers/net/ice/ice_fdir_filter.c
++++ b/drivers/net/ice/ice_fdir_filter.c
+@@ -1929,7 +1929,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
@@ -47 +48 @@
-@@ -2497,8 +2497,12 @@ ice_fdir_parse(struct ice_adapter *ad,
+@@ -2483,8 +2483,12 @@ ice_fdir_parse(struct ice_adapter *ad,


More information about the stable mailing list