patch 'net/bnxt/tf_core: check pool use allocation' has been queued to stable release 24.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Jul 20 19:04:01 CEST 2026
Hi,
FYI, your patch has been queued to stable release 24.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/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/c4dd73c6032213ebfc289be9d38f8da96d7c357f
Thanks.
Luca Boccassi
---
>From c4dd73c6032213ebfc289be9d38f8da96d7c357f 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 36a9189805..6af1368c7a 100644
--- a/drivers/net/bnxt/tf_core/v3/tfc_cpm.c
+++ b/drivers/net/bnxt/tf_core/v3/tfc_cpm.c
@@ -92,6 +92,10 @@ 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;
new_pool_use->next = NULL;
@@ -287,6 +291,7 @@ int tfc_cpm_get_pool_size(struct tfc_cpm *cpm, uint32_t *pool_sz_in_records)
int tfc_cpm_set_cmm_inst(struct tfc_cpm *cpm, uint16_t pool_id, struct tfc_cmm *cmm)
{
struct cpm_pool_entry *pool;
+ int rc;
if (cpm == NULL) {
PMD_DRV_LOG_LINE(ERR, "CPM is NULL");
@@ -309,7 +314,12 @@ int tfc_cpm_set_cmm_inst(struct tfc_cpm *cpm, uint16_t pool_id, struct tfc_cmm *
pool->valid = false;
} 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;
+ }
}
return 0;
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-20 18:03:26.148104217 +0100
+++ 0017-net-bnxt-tf_core-check-pool-use-allocation.patch 2026-07-20 18:03:25.512443363 +0100
@@ -1 +1 @@
-From 5f75cacafa136045a165620e85941ee054e619fe Mon Sep 17 00:00:00 2001
+From c4dd73c6032213ebfc289be9d38f8da96d7c357f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5f75cacafa136045a165620e85941ee054e619fe ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index f58ec48db7..8d95a0c205 100644
+index 36a9189805..6af1368c7a 100644
@@ -47 +48 @@
-@@ -313,7 +318,12 @@ int tfc_cpm_set_cmm_inst(struct tfc_cpm *cpm, uint16_t pool_id, struct tfc_cmm *
+@@ -309,7 +314,12 @@ int tfc_cpm_set_cmm_inst(struct tfc_cpm *cpm, uint16_t pool_id, struct tfc_cmm *
More information about the stable
mailing list