patch 'net/mlx5: replace strncpy with strlcpy' has been queued to stable release 25.11.5
Kevin Traynor
ktraynor at redhat.com
Thu Dec 3 14:00:11 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/d63bf461fbd63868ac1ea77aef2f0c369d3558aa
Thanks.
Kevin
---
>From d63bf461fbd63868ac1ea77aef2f0c369d3558aa Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Wed, 24 Jun 2026 11:36:51 +0100
Subject: [PATCH] net/mlx5: replace strncpy with strlcpy
[ upstream commit a261ce3b26b76bd27d720d455ee2d5270be9feaa ]
Replace strncpy() with safer strlcpy() which always null-terminates.
Fixes: ca1418ce3910 ("common/mlx5: share device context object")
Fixes: 9e58a50c059f ("net/mlx5: fix interface name parameter definition")
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/mlx5.c | 8 ++++----
drivers/net/mlx5/windows/mlx5_ethdev_os.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index bc3edae7fc..3cb19ac6bb 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1887,8 +1887,8 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn,
sh->refcnt = 1;
sh->max_port = spawn->max_port;
- strncpy(sh->ibdev_name, mlx5_os_get_ctx_device_name(sh->cdev->ctx),
- sizeof(sh->ibdev_name) - 1);
- strncpy(sh->ibdev_path, mlx5_os_get_ctx_device_path(sh->cdev->ctx),
- sizeof(sh->ibdev_path) - 1);
+ strlcpy(sh->ibdev_name, mlx5_os_get_ctx_device_name(sh->cdev->ctx),
+ sizeof(sh->ibdev_name));
+ strlcpy(sh->ibdev_path, mlx5_os_get_ctx_device_path(sh->cdev->ctx),
+ sizeof(sh->ibdev_path));
sh->phdev = mlx5_get_physical_device(sh->cdev);
if (!sh->phdev)
diff --git a/drivers/net/mlx5/windows/mlx5_ethdev_os.c b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
index e24ff367af..ecb8914a65 100644
--- a/drivers/net/mlx5/windows/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
@@ -68,5 +68,5 @@ mlx5_get_ifname(const struct rte_eth_dev *dev, char ifname[MLX5_NAMESIZE])
priv = dev->data->dev_private;
context_obj = (mlx5_context_st *)priv->sh->cdev->ctx;
- strncpy(ifname, context_obj->mlx5_dev.name, MLX5_NAMESIZE);
+ strlcpy(ifname, context_obj->mlx5_dev.name, MLX5_NAMESIZE);
return 0;
}
--
2.56.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-12-03 12:52:41.695794678 +0000
+++ 0085-net-mlx5-replace-strncpy-with-strlcpy.patch 2026-12-03 12:52:39.076938611 +0000
@@ -1 +1 @@
-From a261ce3b26b76bd27d720d455ee2d5270be9feaa Mon Sep 17 00:00:00 2001
+From d63bf461fbd63868ac1ea77aef2f0c369d3558aa Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a261ce3b26b76bd27d720d455ee2d5270be9feaa ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 3fa38694e5..fd01f188ff 100644
+index bc3edae7fc..3cb19ac6bb 100644
@@ -23 +24 @@
-@@ -1917,8 +1917,8 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn,
+@@ -1887,8 +1887,8 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn,
More information about the stable
mailing list