patch 'common/cnxk: replace strncpy with strlcpy' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue Oct 27 12:49:10 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/f47561c93d79ea0b7f6823c9782947c67e152720
Thanks.
Luca Boccassi
---
>From f47561c93d79ea0b7f6823c9782947c67e152720 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Wed, 24 Jun 2026 11:36:40 +0100
Subject: [PATCH] common/cnxk: replace strncpy with strlcpy
[ upstream commit 95e9d9bc258dffdd5920002b9b7590868c7bda7d ]
Replace strncpy() with safer strlcpy() which always null-terminates.
Fixes: 014a9e222bac ("common/cnxk: add model init and IO handling API")
Fixes: b315581c66dc ("common/cnxk: skip probing SoC environment for CN9K")
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/common/cnxk/roc_model.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/common/cnxk/roc_model.c b/drivers/common/cnxk/roc_model.c
index 6289461db4c..80c2fc0d448 100644
--- a/drivers/common/cnxk/roc_model.c
+++ b/drivers/common/cnxk/roc_model.c
@@ -209,15 +209,15 @@ populate_model(struct roc_model *model, uint32_t midr)
if (model_db[i].impl == impl && model_db[i].part == part &&
model_db[i].major == major && model_db[i].minor == minor) {
model->flag = model_db[i].flag;
- strncpy(model->name, model_db[i].name,
- ROC_MODEL_STR_LEN_MAX - 1);
+ strlcpy(model->name, model_db[i].name,
+ ROC_MODEL_STR_LEN_MAX);
found = true;
break;
}
not_found:
if (!found) {
model->flag = 0;
- strncpy(model->name, "unknown", ROC_MODEL_STR_LEN_MAX - 1);
+ strlcpy(model->name, "unknown", ROC_MODEL_STR_LEN_MAX);
plt_err("Invalid RoC model (impl=0x%x, part=0x%x, major=0x%x, minor=0x%x)",
impl, part, major, minor);
}
@@ -295,7 +295,7 @@ of_env_get(struct roc_model *model)
FILE *fp;
if (access(path, F_OK) != 0) {
- strncpy(model->env, "HW_PLATFORM", ROC_MODEL_STR_LEN_MAX - 1);
+ strlcpy(model->env, "HW_PLATFORM", ROC_MODEL_STR_LEN_MAX);
model->flag |= ROC_ENV_HW;
return;
}
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-10-27 11:43:55.890255169 +0000
+++ 0056-common-cnxk-replace-strncpy-with-strlcpy.patch 2026-10-27 11:43:53.562060934 +0000
@@ -1 +1 @@
-From 95e9d9bc258dffdd5920002b9b7590868c7bda7d Mon Sep 17 00:00:00 2001
+From f47561c93d79ea0b7f6823c9782947c67e152720 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 95e9d9bc258dffdd5920002b9b7590868c7bda7d ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
-index f0312a5400..ddd7ee8634 100644
+index 6289461db4c..80c2fc0d448 100644
@@ -21 +22 @@
-@@ -211,15 +211,15 @@ populate_model(struct roc_model *model, uint32_t midr)
+@@ -209,15 +209,15 @@ populate_model(struct roc_model *model, uint32_t midr)
@@ -40 +41 @@
-@@ -297,7 +297,7 @@ of_env_get(struct roc_model *model)
+@@ -295,7 +295,7 @@ of_env_get(struct roc_model *model)
More information about the stable
mailing list