patch 'cmdline: fix port list parsing' has been queued to stable release 24.11.4

Kevin Traynor ktraynor at redhat.com
Fri Oct 31 15:32:05 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/05/25. 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/2b2f79af59297ea13bccf2fce249d6960c3c607b

Thanks.

Kevin

---
>From 2b2f79af59297ea13bccf2fce249d6960c3c607b Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Mon, 3 Feb 2025 13:47:33 +0100
Subject: [PATCH] cmdline: fix port list parsing

[ upstream commit 48e03475262798e6758b9c767e87e2f88375072c ]

Doing arithmetic with the NULL pointer is undefined.

Caught by UBSan:

../lib/cmdline/cmdline_parse_portlist.c:40:19: runtime error:
	applying non-zero offset 1 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
	../lib/cmdline/cmdline_parse_portlist.c:40:19 in

Fixes: af75078fece3 ("first public release")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Marat Khalili <marat.khalili at huawei.com>
---
 lib/cmdline/cmdline_parse_portlist.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/cmdline/cmdline_parse_portlist.c b/lib/cmdline/cmdline_parse_portlist.c
index 2e2294553a..290e61f211 100644
--- a/lib/cmdline/cmdline_parse_portlist.c
+++ b/lib/cmdline/cmdline_parse_portlist.c
@@ -32,13 +32,10 @@ static int
 parse_ports(cmdline_portlist_t *pl, const char *str)
 {
+	const char *first = str;
 	size_t ps, pe;
-	const char *first, *last;
 	char *end;
 
-	for (first = str, last = first;
-	    first != NULL && last != NULL;
-	    first = last + 1) {
-
-		last = strchr(first, ',');
+	while (first != NULL) {
+		const char *last = strchr(first, ',');
 
 		errno = 0;
@@ -64,4 +61,5 @@ parse_ports(cmdline_portlist_t *pl, const char *str)
 
 		parse_set_list(pl, ps, pe);
+		first = (last == NULL ? NULL : last + 1);
 	}
 
-- 
2.51.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-31 13:53:52.411615984 +0000
+++ 0003-cmdline-fix-port-list-parsing.patch	2025-10-31 13:53:52.005623420 +0000
@@ -1 +1 @@
-From 48e03475262798e6758b9c767e87e2f88375072c Mon Sep 17 00:00:00 2001
+From 2b2f79af59297ea13bccf2fce249d6960c3c607b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 48e03475262798e6758b9c767e87e2f88375072c ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -26 +27 @@
-index ef6ce223b5..549f6d9671 100644
+index 2e2294553a..290e61f211 100644
@@ -29 +30 @@
-@@ -34,13 +34,10 @@ static int
+@@ -32,13 +32,10 @@ static int
@@ -46 +47 @@
-@@ -66,4 +63,5 @@ parse_ports(cmdline_portlist_t *pl, const char *str)
+@@ -64,4 +61,5 @@ parse_ports(cmdline_portlist_t *pl, const char *str)



More information about the stable mailing list