patch 'net/bnxt/tf_core: fix message bounds and hot upgrade limit' has been queued to stable release 25.11.5
Kevin Traynor
ktraynor at redhat.com
Thu Dec 3 14:02:19 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/f9e4578c500f3cdd3a81f3c91f548a9bf6c14968
Thanks.
Kevin
---
>From f9e4578c500f3cdd3a81f3c91f548a9bf6c14968 Mon Sep 17 00:00:00 2001
From: Mohammad Shuab Siddique <mohammad-shuab.siddique at broadcom.com>
Date: Tue, 22 Sep 2026 17:40:16 -0500
Subject: [PATCH] net/bnxt/tf_core: fix message bounds and hot upgrade limit
[ upstream commit 916d32002fd06f6be9749acf3fd845992b74001a ]
Fix four medium/low severity issues in the message layer, found by
static analysis. Also fix the hot-upgrade app instance ID limit.
tfc_msg_idx_tbl_get() used the raw FW-reported resp.data_size in a
memcpy() without capping it to the caller's DMA buffer size, and
dereferenced the caller-supplied dev_data/data_size pointers without
a NULL check. Decode resp.data_size and reject the call if it
exceeds the caller-supplied *data_size, and add an early return with
-EINVAL if dev_data or data_size is NULL.
tfc_msg_if_tbl_get() set rc=-EINVAL on a size mismatch but fell
through to *data_size = resp.data_size and then memcpy()'d that many
bytes into the caller's buffer anyway. Return early on error, and
decode resp.data_size before assigning it to *data_size. Also reject
a FW-reported size larger than the response data array, which the
caller's buffer size alone does not bound, and add an early return
with -EINVAL if data or data_size is NULL.
tfc_msg_idx_tbl_alloc_set() and tfc_msg_idx_tbl_set() dereferenced
the caller-supplied dev_data pointer without a NULL check. Add an
early return with -EINVAL if dev_data is NULL.
Despite its name, CFA_HOT_UPGRADE_APP_INSTANCE_MAX (4) is used as the
highest valid app instance ID, and valid IDs are 1-8 (0 disables the
feature), matching the existing devargs validation.
tfc_hot_upgrade_validate() therefore rejected valid IDs 5-8 with an
"Invalid app instance" error. Raise the constant to 8.
Fixes: 80317ff6adfd ("net/bnxt/tf_core: support Thor2")
Fixes: eeefaecba000 ("net/bnxt/tf_ulp: support hot upgrade")
Signed-off-by: Mohammad Shuab Siddique <mohammad-shuab.siddique at broadcom.com>
Signed-off-by: Manish Kurup <manish.kurup at broadcom.com>
---
.../bnxt/hcapi/cfa_v3/include/cfa_resources.h | 2 +-
drivers/net/bnxt/tf_core/v3/tfc_msg.c | 48 ++++++++++++++++---
2 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/drivers/net/bnxt/hcapi/cfa_v3/include/cfa_resources.h b/drivers/net/bnxt/hcapi/cfa_v3/include/cfa_resources.h
index ada9741dfa..98b96e0a11 100644
--- a/drivers/net/bnxt/hcapi/cfa_v3/include/cfa_resources.h
+++ b/drivers/net/bnxt/hcapi/cfa_v3/include/cfa_resources.h
@@ -195,5 +195,5 @@ enum cfa_resource_subtype_gim {
CFA_RSUBTYPE_GIM_MAX)
-#define CFA_HOT_UPGRADE_APP_INSTANCE_MAX 4
+#define CFA_HOT_UPGRADE_APP_INSTANCE_MAX 8
enum cfa_hot_upgrade_cmd_op {
CFA_HOT_UPGRADE_CMD_ALLOC = 1,
diff --git a/drivers/net/bnxt/tf_core/v3/tfc_msg.c b/drivers/net/bnxt/tf_core/v3/tfc_msg.c
index df11910dc3..89c256b810 100644
--- a/drivers/net/bnxt/tf_core/v3/tfc_msg.c
+++ b/drivers/net/bnxt/tf_core/v3/tfc_msg.c
@@ -549,4 +549,9 @@ tfc_msg_idx_tbl_alloc_set(struct tfc *tfcp, uint16_t fid, uint16_t sid,
uint8_t *data = NULL;
+ if (!dev_data) {
+ PMD_DRV_LOG_LINE(ERR, "invalid input");
+ return -EINVAL;
+ }
+
if (dir == CFA_DIR_RX)
req.flags |= HWRM_TFC_IDX_TBL_ALLOC_SET_INPUT_FLAGS_DIR_RX &
@@ -614,4 +619,9 @@ tfc_msg_idx_tbl_set(struct tfc *tfcp, uint16_t fid,
uint8_t *data = NULL;
+ if (!dev_data) {
+ PMD_DRV_LOG_LINE(ERR, "invalid input");
+ return -EINVAL;
+ }
+
if (dir == CFA_DIR_RX)
req.flags |= HWRM_TFC_IDX_TBL_SET_INPUT_FLAGS_DIR_RX &
@@ -672,4 +682,9 @@ tfc_msg_idx_tbl_get(struct tfc *tfcp, uint16_t fid,
struct tfc_msg_dma_buf buf = { 0 };
+ if (!dev_data || !data_size) {
+ PMD_DRV_LOG_LINE(ERR, "invalid input");
+ return -EINVAL;
+ }
+
if (dir == CFA_DIR_RX)
req.flags |= HWRM_TFC_IDX_TBL_GET_INPUT_FLAGS_DIR_RX &
@@ -703,6 +718,15 @@ tfc_msg_idx_tbl_get(struct tfc *tfcp, uint16_t fid,
if (rc == 0) {
- memcpy(dev_data, buf.va_addr, resp.data_size);
- *data_size = rte_le_to_cpu_16(resp.data_size);
+ uint16_t resp_data_size = rte_le_to_cpu_16(resp.data_size);
+
+ if (resp_data_size > *data_size) {
+ PMD_DRV_LOG_LINE(ERR,
+ "FW resp data_size(%u) > caller buf(%u)",
+ resp_data_size, *data_size);
+ rc = -EINVAL;
+ goto cleanup;
+ }
+ memcpy(dev_data, buf.va_addr, resp_data_size);
+ *data_size = resp_data_size;
}
@@ -1275,8 +1299,14 @@ tfc_msg_if_tbl_get(struct tfc *tfcp, uint16_t fid, uint16_t sid,
{
int rc = 0;
+ uint8_t resp_size;
struct bnxt *bp = tfcp->bp;
struct hwrm_tfc_if_tbl_get_input req = { 0 };
struct hwrm_tfc_if_tbl_get_output resp = { 0 };
+ if (!data || !data_size) {
+ PMD_DRV_LOG_LINE(ERR, "invalid input");
+ return -EINVAL;
+ }
+
req.flags = (dir == CFA_DIR_TX ?
HWRM_TFC_IF_TBL_GET_INPUT_FLAGS_DIR_TX :
@@ -1297,12 +1327,18 @@ tfc_msg_if_tbl_get(struct tfc *tfcp, uint16_t fid, uint16_t sid,
return rc;
- if (*data_size < rte_le_to_cpu_16(resp.data_size)) {
+ resp_size = resp.data_size;
+ if (resp_size > sizeof(resp.data)) {
+ PMD_DRV_LOG_LINE(ERR, "Invalid table response size %u",
+ resp_size);
+ return -EINVAL;
+ }
+ if (*data_size < resp_size) {
PMD_DRV_LOG_LINE(ERR, "Table buffer is too small, rc:%s",
strerror(EINVAL));
- rc = -EINVAL;
+ return -EINVAL;
}
- *data_size = resp.data_size;
- memcpy(data, resp.data, *data_size);
+ *data_size = resp_size;
+ memcpy(data, resp.data, resp_size);
return rc;
--
2.56.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-12-03 12:52:45.318605826 +0000
+++ 0213-net-bnxt-tf_core-fix-message-bounds-and-hot-upgrade-.patch 2026-12-03 12:52:39.187998178 +0000
@@ -1 +1 @@
-From 916d32002fd06f6be9749acf3fd845992b74001a Mon Sep 17 00:00:00 2001
+From f9e4578c500f3cdd3a81f3c91f548a9bf6c14968 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 916d32002fd06f6be9749acf3fd845992b74001a ]
+
@@ -36 +37,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list