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

Kevin Traynor ktraynor at redhat.com
Tue Jul 28 17:55:38 CEST 2026


Hi,

FYI, your patch has been queued to stable release 25.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/01/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/45a498e9e28219c1a93caae05df525c8b137ef77

Thanks.

Kevin

---
>From 45a498e9e28219c1a93caae05df525c8b137ef77 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 3b8d435e98..593ce597a5 100644
--- a/lib/cmdline/cmdline_rdline.c
+++ b/lib/cmdline/cmdline_rdline.c
@@ -431,6 +431,7 @@ rdline_char_in(struct rdline *rdl, char c)
 				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");
-- 
2.55.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-07-28 16:54:51.079586184 +0100
+++ 0008-cmdline-prevent-out-of-bounds-read.patch	2026-07-28 16:54:50.755112378 +0100
@@ -1 +1 @@
-From d3b9f6a4fc75198e8903f2add378e3332400e619 Mon Sep 17 00:00:00 2001
+From 45a498e9e28219c1a93caae05df525c8b137ef77 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 3b8d435e98..593ce597a5 100644
@@ -34 +35 @@
-@@ -445,6 +445,7 @@ rdline_char_in(struct rdline *rdl, char c)
+@@ -431,6 +431,7 @@ rdline_char_in(struct rdline *rdl, char c)



More information about the stable mailing list