patch 'net/ice: fix memory leak in FDIR flow parsing' has been queued to stable release 25.11.1
Kevin Traynor
ktraynor at redhat.com
Thu Feb 26 14:10:16 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/02/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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/f3c6354979f8704abccfba82b11c6b338eb515d1
Thanks.
Kevin
---
>From f3c6354979f8704abccfba82b11c6b338eb515d1 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/intel/ice/ice_fdir_filter.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/intel/ice/ice_fdir_filter.c b/drivers/net/intel/ice/ice_fdir_filter.c
index 9dfe5c02cb..341f4cb210 100644
--- a/drivers/net/intel/ice/ice_fdir_filter.c
+++ b/drivers/net/intel/ice/ice_fdir_filter.c
@@ -1932,5 +1932,5 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
}
- 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;
@@ -2491,6 +2491,10 @@ ice_fdir_parse(struct ice_adapter *ad,
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);
--
2.53.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-02-26 10:16:52.271839930 +0000
+++ 0134-net-ice-fix-memory-leak-in-FDIR-flow-parsing.patch 2026-02-26 10:16:47.192460291 +0000
@@ -1 +1 @@
-From 3a3a249bc595627a81dd1e9cc0a93993736a6871 Mon Sep 17 00:00:00 2001
+From f3c6354979f8704abccfba82b11c6b338eb515d1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3a3a249bc595627a81dd1e9cc0a93993736a6871 ]
+
@@ -26 +27,0 @@
-Cc: stable at dpdk.org
@@ -35 +36 @@
-index f7730ec6ab..da22b65a77 100644
+index 9dfe5c02cb..341f4cb210 100644
@@ -38 +39 @@
-@@ -1939,5 +1939,5 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
+@@ -1932,5 +1932,5 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
@@ -45 +46 @@
-@@ -2498,6 +2498,10 @@ ice_fdir_parse(struct ice_adapter *ad,
+@@ -2491,6 +2491,10 @@ ice_fdir_parse(struct ice_adapter *ad,
More information about the stable
mailing list