patch 'cmdline: guard zero-size destination buffers' has been queued to stable release 24.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Jun 11 15:19:15 CEST 2026
Hi,
FYI, your patch has been queued to stable release 24.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/13/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/4501976674c7db21562c45b9cc953c72a0dc84da
Thanks.
Luca Boccassi
---
>From 4501976674c7db21562c45b9cc953c72a0dc84da Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Thu, 7 May 2026 15:59:48 +0100
Subject: [PATCH] cmdline: guard zero-size destination buffers
[ upstream commit d503e984003ce151c79f083cb6c59483893c57b1 ]
Add missing zero-size destination checks in cmdline helper routines.
Always check for size == 0, before doing an assignment of '\0' to string
position of "size - 1".
Fixes: af75078fece3 ("first public release")
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
lib/cmdline/cmdline_parse_num.c | 2 +-
lib/cmdline/cmdline_parse_string.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/cmdline/cmdline_parse_num.c b/lib/cmdline/cmdline_parse_num.c
index e8498788fa..ca27d65b7a 100644
--- a/lib/cmdline/cmdline_parse_num.c
+++ b/lib/cmdline/cmdline_parse_num.c
@@ -319,7 +319,7 @@ cmdline_get_help_num(cmdline_parse_token_hdr_t *tk, char *dstbuf, unsigned int s
struct cmdline_token_num_data nd;
int ret;
- if (!tk)
+ if (!tk || !dstbuf || size == 0)
return -1;
memcpy(&nd, &((struct cmdline_token_num *)tk)->num_data, sizeof(nd));
diff --git a/lib/cmdline/cmdline_parse_string.c b/lib/cmdline/cmdline_parse_string.c
index d756638905..878700a10f 100644
--- a/lib/cmdline/cmdline_parse_string.c
+++ b/lib/cmdline/cmdline_parse_string.c
@@ -166,6 +166,9 @@ int cmdline_complete_get_elt_string(cmdline_parse_token_hdr_t *tk, int idx,
if (!tk || !dstbuf || idx < 0)
return -1;
+ if (size == 0)
+ return -1;
+
tk2 = (struct cmdline_token_string *)tk;
sd = &tk2->string_data;
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-06-11 14:20:01.630265586 +0100
+++ 0006-cmdline-guard-zero-size-destination-buffers.patch 2026-06-11 14:20:01.166744816 +0100
@@ -1 +1 @@
-From d503e984003ce151c79f083cb6c59483893c57b1 Mon Sep 17 00:00:00 2001
+From 4501976674c7db21562c45b9cc953c72a0dc84da Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d503e984003ce151c79f083cb6c59483893c57b1 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index f21796bedb..4cfc900391 100644
+index e8498788fa..ca27d65b7a 100644
@@ -23 +24 @@
-@@ -323,7 +323,7 @@ cmdline_get_help_num(cmdline_parse_token_hdr_t *tk, char *dstbuf, unsigned int s
+@@ -319,7 +319,7 @@ cmdline_get_help_num(cmdline_parse_token_hdr_t *tk, char *dstbuf, unsigned int s
@@ -33 +34 @@
-index 731947159f..33cf89f84f 100644
+index d756638905..878700a10f 100644
@@ -36 +37 @@
-@@ -171,6 +171,9 @@ int cmdline_complete_get_elt_string(cmdline_parse_token_hdr_t *tk, int idx,
+@@ -166,6 +166,9 @@ int cmdline_complete_get_elt_string(cmdline_parse_token_hdr_t *tk, int idx,
More information about the stable
mailing list