patch 'cmdline: prevent out-of-bounds read' has been queued to stable release 24.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 11 15:20:40 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/8347d3dc1c8cdb0bb45057e27016db766ffedb73

Thanks.

Luca Boccassi

---
>From 8347d3dc1c8cdb0bb45057e27016db766ffedb73 Mon Sep 17 00:00:00 2001
From: Daniil Iskhakov <dish at amicon.ru>
Date: Thu, 30 Apr 2026 20:01:11 +0300
Subject: [PATCH] cmdline: prevent out-of-bounds read

[ upstream commit d3b9f6a4fc75198e8903f2add378e3332400e619 ]

tmp_buf is populated by the completion callback and is not guaranteed
to be NUL-terminated.

The code already accounts for this when computing tmp_size with
strnlen(tmp_buf, sizeof(tmp_buf)). However, another loop in the same
path still walks tmp_buf until a NUL byte is found, without checking
the buffer limit.

If the callback writes a full-sized non-NUL-terminated string, the loop
may read past the end of tmp_buf.

Fix this by computing a bounded length for each completion choice before
printing it.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Daniil Iskhakov <dish at amicon.ru>
---
 lib/cmdline/cmdline_rdline.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/cmdline/cmdline_rdline.c b/lib/cmdline/cmdline_rdline.c
index 5cf723a012..96c3e05000 100644
--- a/lib/cmdline/cmdline_rdline.c
+++ b/lib/cmdline/cmdline_rdline.c
@@ -418,8 +418,9 @@ rdline_char_in(struct rdline *rdl, char c)
 				/* choice */
 				rdline_puts(rdl, "\r\n");
 				while (ret) {
+					tmp_size = strnlen(tmp_buf, sizeof(tmp_buf));
 					rdl->write_char(rdl, ' ');
-					for (i=0 ; tmp_buf[i] ; i++)
+					for (i = 0; i < tmp_size; i++)
 						rdl->write_char(rdl, tmp_buf[i]);
 					rdline_puts(rdl, "\r\n");
 					ret = rdl->complete(rdl, rdl->left_buf,
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-06-11 14:20:04.915952864 +0100
+++ 0091-cmdline-prevent-out-of-bounds-read.patch	2026-06-11 14:20:01.334748898 +0100
@@ -1 +1 @@
-From d3b9f6a4fc75198e8903f2add378e3332400e619 Mon Sep 17 00:00:00 2001
+From 8347d3dc1c8cdb0bb45057e27016db766ffedb73 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d3b9f6a4fc75198e8903f2add378e3332400e619 ]
+
@@ -23 +24,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
-index 15da285c8d..ed72c9e573 100644
+index 5cf723a012..96c3e05000 100644
@@ -34 +35 @@
-@@ -444,8 +444,9 @@ rdline_char_in(struct rdline *rdl, char c)
+@@ -418,8 +418,9 @@ rdline_char_in(struct rdline *rdl, char c)


More information about the stable mailing list