patch 'net/bnxt: fix stack exhaustion in flow stats' has been queued to stable release 25.11.5
Kevin Traynor
ktraynor at redhat.com
Thu Dec 3 14:01:55 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.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 12/08/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/2072e36d98b60bda53971e140de80176a056ba13
Thanks.
Kevin
---
>From 2072e36d98b60bda53971e140de80176a056ba13 Mon Sep 17 00:00:00 2001
From: Joseph Wong <joseph.wong at broadcom.com>
Date: Tue, 29 Sep 2026 12:03:25 -0600
Subject: [PATCH] net/bnxt: fix stack exhaustion in flow stats
[ upstream commit db221739e5ff6c6a08406ec457674ca088d2c820 ]
In bnxt_flow_stats_cnt(), two variable-length arrays are allocated
on the stack. These arrays are allocated merely to be used to
calculate the dimensions via RTE_DIM(). Replace with the
mathematical equivalent to avoid potential stack exhaustion.
Fixes: 1e2f8aca2cc1 ("net/bnxt: fix allocation of flow stat related structs")
Signed-off-by: Joseph Wong <joseph.wong at broadcom.com>
Signed-off-by: Mohammad Shuab Siddique <mohammad-shuab.siddique at broadcom.com>
---
drivers/net/bnxt/bnxt_stats.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 8132119734..c2022ea8ee 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -1091,10 +1091,6 @@ int bnxt_flow_stats_cnt(struct bnxt *bp)
if (bp->fw_cap & BNXT_FW_CAP_ADV_FLOW_COUNTERS &&
bp->fw_cap & BNXT_FW_CAP_ADV_FLOW_MGMT &&
- BNXT_FLOW_XSTATS_EN(bp)) {
- struct bnxt_xstats_name_off flow_bytes[bp->max_l2_ctx];
- struct bnxt_xstats_name_off flow_pkts[bp->max_l2_ctx];
-
- return RTE_DIM(flow_bytes) + RTE_DIM(flow_pkts);
- }
+ BNXT_FLOW_XSTATS_EN(bp))
+ return 2 * bp->max_l2_ctx;
return 0;
--
2.56.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-12-03 12:52:44.628120104 +0000
+++ 0189-net-bnxt-fix-stack-exhaustion-in-flow-stats.patch 2026-12-03 12:52:39.164157296 +0000
@@ -1 +1 @@
-From db221739e5ff6c6a08406ec457674ca088d2c820 Mon Sep 17 00:00:00 2001
+From 2072e36d98b60bda53971e140de80176a056ba13 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit db221739e5ff6c6a08406ec457674ca088d2c820 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 37b33f0505..4074613eb0 100644
+index 8132119734..c2022ea8ee 100644
@@ -24 +25 @@
-@@ -1080,10 +1080,6 @@ int bnxt_flow_stats_cnt(struct bnxt *bp)
+@@ -1091,10 +1091,6 @@ int bnxt_flow_stats_cnt(struct bnxt *bp)
More information about the stable
mailing list