patch 'mem: check fbarray name truncation in secondary process' has been queued to stable release 24.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 20 15:56:51 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.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 02/22/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/ea1e463292365a60c93a0fafd444d23e5869ea3d

Thanks.

Luca Boccassi

---
>From ea1e463292365a60c93a0fafd444d23e5869ea3d Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Thu, 5 Feb 2026 17:16:01 +0100
Subject: [PATCH] mem: check fbarray name truncation in secondary process

[ upstream commit 9f3d51136011e1ed63180332730768efaa35c0a3 ]

When compiling in debug mode, the format-truncation check
raises a warning:

In function 'secondary_msl_create_walk':
     lib/eal/linux/eal_memalloc.c:1401:50:
     error: '%i' directive output may be truncated writing
     between 1 and 11 bytes into a region of size between 0 and 63
     [-Werror=format-truncation=]
     note: 'snprintf' output between 3 and 76 bytes
     into a destination of size 64
 1401 |         snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i",
 1402 |                 primary_msl->memseg_arr.name, getpid());

This is a new warning enabled in DPDK 26.03.
It is solved by checking the return of snprintf.

Bugzilla ID: 1878

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 lib/eal/linux/eal_memalloc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index e354efc95d..1c72b02b1b 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -1447,8 +1447,13 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,
 	local_msl = &local_memsegs[msl_idx];
 
 	/* create distinct fbarrays for each secondary */
-	snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i",
+	ret = snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i",
 		primary_msl->memseg_arr.name, getpid());
+	if (ret >= RTE_FBARRAY_NAME_LEN) {
+		EAL_LOG(ERR, "fbarray name %s_%i is too long",
+				primary_msl->memseg_arr.name, getpid());
+		return -1;
+	}
 
 	ret = rte_fbarray_init(&local_msl->memseg_arr, name,
 		primary_msl->memseg_arr.len,
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-02-20 14:55:47.371510456 +0000
+++ 0109-mem-check-fbarray-name-truncation-in-secondary-proce.patch	2026-02-20 14:55:43.372193922 +0000
@@ -1 +1 @@
-From 9f3d51136011e1ed63180332730768efaa35c0a3 Mon Sep 17 00:00:00 2001
+From ea1e463292365a60c93a0fafd444d23e5869ea3d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9f3d51136011e1ed63180332730768efaa35c0a3 ]
+
@@ -30 +32 @@
-index d9e8ea76b9..4dee224ac5 100644
+index e354efc95d..1c72b02b1b 100644
@@ -33 +35 @@
-@@ -1398,8 +1398,13 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,
+@@ -1447,8 +1447,13 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,


More information about the stable mailing list