patch 'net/bnxt/tf_ulp: fix parent MAC lookup path handling' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue Oct 27 12:51:12 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/29/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/6ef2752d58edfb46217de24413d4befd11dbdaff
Thanks.
Luca Boccassi
---
>From 6ef2752d58edfb46217de24413d4befd11dbdaff Mon Sep 17 00:00:00 2001
From: Dakota Sicher <dakota.sicher at broadcom.com>
Date: Fri, 5 Jun 2026 13:54:34 -0600
Subject: [PATCH] net/bnxt/tf_ulp: fix parent MAC lookup path handling
[ upstream commit 35e3f3c1888fd2075a0f5bd7a783d783e5e36ecf ]
ulp_pmd_get_mac_by_pci() builds sysfs paths with sprintf() into a
256 byte buffer from a PCI name and an interface name taken from
glob(). Use snprintf() and fail if the path is truncated.
The glob() result was also never released. Call globfree() on every
exit path once glob() has succeeded.
Fixes: 1993b267dbcb ("net/bnxt: cleanup ULP parser and mapper")
Signed-off-by: Dakota Sicher <dakota.sicher at broadcom.com>
Signed-off-by: Manish Kurup <manish.kurup at broadcom.com>
Signed-off-by: Mohammad Shuab Siddique <mohammad-shuab.siddique at broadcom.com>
---
drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c b/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c
index 5854f134472..65af67d77fd 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c
@@ -143,30 +143,38 @@ static int32_t ulp_pmd_get_mac_by_pci(const char *pci_name, uint8_t *mac)
glob_t gres;
FILE *fp;
int32_t rc = -EINVAL;
+ int32_t pr;
memset(path, 0, sizeof(path));
- sprintf(path, PARENT_PHY_INTF_PATH, pci_name);
-
+ pr = snprintf(path, sizeof(path), PARENT_PHY_INTF_PATH, pci_name);
+ if (unlikely((size_t)pr >= sizeof(path) || pr < 0)) {
+ BNXT_DRV_DBG(ERR, "Error writing path: %s", path);
+ return rc;
+ }
/* There can be only one, no more, no less */
if (glob(path, 0, glob_error_fn, &gres) == 0) {
if (gres.gl_pathc != 1)
- return rc;
+ goto free_glob;
/* Replace the PCI address with interface name and get index */
intf_name = basename(gres.gl_pathv[0]);
- sprintf(path, ULP_PRT_MAC_PATH, pci_name, intf_name);
+ pr = snprintf(path, sizeof(path), ULP_PRT_MAC_PATH, pci_name, intf_name);
+ if (unlikely((size_t)pr >= sizeof(path) || pr < 0)) {
+ BNXT_DRV_DBG(ERR, "Error writing path: %s", path);
+ goto free_glob;
+ }
fp = fopen(path, "r");
if (!fp) {
BNXT_DRV_DBG(ERR, "Error in getting bond mac address\n");
- return rc;
+ goto free_glob;
}
memset(dev_str, 0, sizeof(dev_str));
if (fgets(dev_str, sizeof(dev_str), fp) == NULL) {
BNXT_DRV_DBG(ERR, "Error in reading %s\n", path);
fclose(fp);
- return rc;
+ goto free_glob;
}
if (sscanf(dev_str, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx\n",
@@ -174,6 +182,8 @@ static int32_t ulp_pmd_get_mac_by_pci(const char *pci_name, uint8_t *mac)
&mac[3], &mac[4], &mac[5]) == 6)
rc = 0;
fclose(fp);
+free_glob:
+ globfree(&gres);
}
return rc;
}
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-10-27 11:44:00.542982597 +0000
+++ 0178-net-bnxt-tf_ulp-fix-parent-MAC-lookup-path-handling.patch 2026-10-27 11:43:53.762067125 +0000
@@ -1 +1 @@
-From 35e3f3c1888fd2075a0f5bd7a783d783e5e36ecf Mon Sep 17 00:00:00 2001
+From 6ef2752d58edfb46217de24413d4befd11dbdaff Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 35e3f3c1888fd2075a0f5bd7a783d783e5e36ecf ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index bfd5f4b230..81e335da59 100644
+index 5854f134472..65af67d77fd 100644
@@ -27 +28 @@
-@@ -140,30 +140,38 @@ static int32_t ulp_pmd_get_mac_by_pci(const char *pci_name, uint8_t *mac)
+@@ -143,30 +143,38 @@ static int32_t ulp_pmd_get_mac_by_pci(const char *pci_name, uint8_t *mac)
@@ -72 +73 @@
-@@ -171,6 +179,8 @@ static int32_t ulp_pmd_get_mac_by_pci(const char *pci_name, uint8_t *mac)
+@@ -174,6 +182,8 @@ static int32_t ulp_pmd_get_mac_by_pci(const char *pci_name, uint8_t *mac)
More information about the stable
mailing list