patch 'net/bnxt/tf_core: check pool use allocation' has been queued to stable release 25.11.3

Kevin Traynor ktraynor at redhat.com
Thu Jul 30 11:17:08 CEST 2026


Hi,

FYI, your patch has been queued to stable release 25.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 08/04/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/066c53e591e8474a076af43ef215bcd3b26dde5d

Thanks.

Kevin

---
>From 066c53e591e8474a076af43ef215bcd3b26dde5d Mon Sep 17 00:00:00 2001
From: Denis Sergeev <denserg.edu at gmail.com>
Date: Wed, 3 Jun 2026 07:15:43 +0300
Subject: [PATCH] net/bnxt/tf_core: check pool use allocation

[ upstream commit 5f75cacafa136045a165620e85941ee054e619fe ]

rte_zmalloc() in cpm_insert_pool_id() can return NULL when memory is
exhausted. The return value was not checked before being dereferenced,
resulting in a crash.

Add a NULL check and return -ENOMEM on failure. Also propagate the
error in tfc_cpm_set_cmm_inst() which silently discarded the return
value of cpm_insert_pool_id(), and restore the pool state on failure.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 80317ff6adfd ("net/bnxt/tf_core: support Thor2")

Signed-off-by: Denis Sergeev <denserg.edu at gmail.com>
---
 drivers/net/bnxt/tf_core/v3/tfc_cpm.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/tf_core/v3/tfc_cpm.c b/drivers/net/bnxt/tf_core/v3/tfc_cpm.c
index f58ec48db7..8d95a0c205 100644
--- a/drivers/net/bnxt/tf_core/v3/tfc_cpm.c
+++ b/drivers/net/bnxt/tf_core/v3/tfc_cpm.c
@@ -93,4 +93,8 @@ static int cpm_insert_pool_id(struct tfc_cpm *cpm, uint16_t pool_id)
 	/* Alloc new entry */
 	new_pool_use = rte_zmalloc("tf", sizeof(struct cpm_pool_use), 0);
+	if (new_pool_use == NULL) {
+		PMD_DRV_LOG_LINE(ERR, "Failed to allocate pool_use entry");
+		return -ENOMEM;
+	}
 	new_pool_use->pool_id = pool_id;
 	new_pool_use->prev = NULL;
@@ -288,4 +292,5 @@ int tfc_cpm_set_cmm_inst(struct tfc_cpm *cpm, uint16_t pool_id, struct tfc_cmm *
 {
 	struct cpm_pool_entry *pool;
+	int rc;
 
 	if (cpm == NULL) {
@@ -314,5 +319,10 @@ int tfc_cpm_set_cmm_inst(struct tfc_cpm *cpm, uint16_t pool_id, struct tfc_cmm *
 	} else {
 		pool->valid = true;
-		cpm_insert_pool_id(cpm, pool_id);
+		rc = cpm_insert_pool_id(cpm, pool_id);
+		if (rc) {
+			pool->cmm = NULL;
+			pool->valid = false;
+			return rc;
+		}
 	}
 
-- 
2.55.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-07-30 10:16:03.990625063 +0100
+++ 0089-net-bnxt-tf_core-check-pool-use-allocation.patch	2026-07-30 10:16:01.510262696 +0100
@@ -1 +1 @@
-From 5f75cacafa136045a165620e85941ee054e619fe Mon Sep 17 00:00:00 2001
+From 066c53e591e8474a076af43ef215bcd3b26dde5d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5f75cacafa136045a165620e85941ee054e619fe ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list