patch 'net/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:17 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/78652483f22d64633c26e130fc0bf3b80f93afe1

Thanks.

Luca Boccassi

---
>From 78652483f22d64633c26e130fc0bf3b80f93afe1 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Wed, 24 Jun 2026 11:36:47 +0100
Subject: [PATCH] net/cnxk: replace strncpy with strlcpy

[ upstream commit 735b94ff541a48db86a66e3c8fb7c0813c830f81 ]

Replace strncpy() with safer strlcpy() which always null-terminates.

Fixes: 804c585658ea ("net/cnxk: add representor control plane")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/cnxk/cnxk_eswitch.c | 4 ++--
 drivers/net/cnxk/cnxk_rep_msg.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/cnxk/cnxk_eswitch.c b/drivers/net/cnxk/cnxk_eswitch.c
index 6b1bfdd4763..9c4c8db2b69 100644
--- a/drivers/net/cnxk/cnxk_eswitch.c
+++ b/drivers/net/cnxk/cnxk_eswitch.c
@@ -124,8 +124,8 @@ cnxk_eswitch_dev_remove(struct rte_pci_device *pci_dev)
 				}
 				sun.sun_family = AF_UNIX;
 				sunlen = sizeof(struct sockaddr_un);
-				strncpy(sun.sun_path, CNXK_ESWITCH_CTRL_MSG_SOCK_PATH,
-					sizeof(sun.sun_path) - 1);
+				strlcpy(sun.sun_path, CNXK_ESWITCH_CTRL_MSG_SOCK_PATH,
+					sizeof(sun.sun_path));
 
 				if (connect(sock_fd, (struct sockaddr *)&sun, sunlen) < 0) {
 					plt_err("Failed to connect socket: %s, err %d",
diff --git a/drivers/net/cnxk/cnxk_rep_msg.c b/drivers/net/cnxk/cnxk_rep_msg.c
index a222e2b5cde..7b92e7a5f71 100644
--- a/drivers/net/cnxk/cnxk_rep_msg.c
+++ b/drivers/net/cnxk/cnxk_rep_msg.c
@@ -138,7 +138,7 @@ open_socket_ctrl_channel(void)
 
 	memset(&un, 0, sizeof(struct sockaddr_un));
 	un.sun_family = AF_UNIX;
-	strncpy(un.sun_path, CNXK_ESWITCH_CTRL_MSG_SOCK_PATH, sizeof(un.sun_path) - 1);
+	strlcpy(un.sun_path, CNXK_ESWITCH_CTRL_MSG_SOCK_PATH, sizeof(un.sun_path));
 
 	if (bind(sock_fd, (struct sockaddr *)&un, sizeof(un)) < 0) {
 		plt_err("Failed to bind %s: %s", un.sun_path, strerror(errno));
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-10-27 11:43:56.142562608 +0000
+++ 0063-net-cnxk-replace-strncpy-with-strlcpy.patch	2026-10-27 11:43:53.574061306 +0000
@@ -1 +1 @@
-From 735b94ff541a48db86a66e3c8fb7c0813c830f81 Mon Sep 17 00:00:00 2001
+From 78652483f22d64633c26e130fc0bf3b80f93afe1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 735b94ff541a48db86a66e3c8fb7c0813c830f81 ]
+
@@ -9 +10,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
-index 7e717a2fbf..57e2c490df 100644
+index 6b1bfdd4763..9c4c8db2b69 100644
@@ -33 +34 @@
-index a222e2b5cd..7b92e7a5f7 100644
+index a222e2b5cde..7b92e7a5f71 100644


More information about the stable mailing list