patch 'common/cnxk: replace strncpy with strlcpy' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:00:00 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/40ffb9e2d0845286111c29b0539f02c783a3c0eb

Thanks.

Kevin

---
>From 40ffb9e2d0845286111c29b0539f02c783a3c0eb 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 f0312a5400..ddd7ee8634 100644
--- a/drivers/common/cnxk/roc_model.c
+++ b/drivers/common/cnxk/roc_model.c
@@ -212,6 +212,6 @@ populate_model(struct roc_model *model, uint32_t midr)
 		    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;
@@ -220,5 +220,5 @@ 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);
@@ -298,5 +298,5 @@ of_env_get(struct roc_model *model)
 
 	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.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:41.401145810 +0000
+++ 0074-common-cnxk-replace-strncpy-with-strlcpy.patch	2026-12-03 12:52:39.069986252 +0000
@@ -1 +1 @@
-From 95e9d9bc258dffdd5920002b9b7590868c7bda7d Mon Sep 17 00:00:00 2001
+From 40ffb9e2d0845286111c29b0539f02c783a3c0eb Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 95e9d9bc258dffdd5920002b9b7590868c7bda7d ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list