patch 'cmdline: fix port list parsing' has been queued to stable release 22.11.11
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Oct 27 17:18:41 CET 2025
Hi,
FYI, your patch has been queued to stable release 22.11.11
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/29/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/712571041c9a7b6cc7fde5eeb504855d2c05d36a
Thanks.
Luca Boccassi
---
>From 712571041c9a7b6cc7fde5eeb504855d2c05d36a 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
@@ -31,15 +31,12 @@ parse_set_list(cmdline_portlist_t *pl, size_t low, size_t high)
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;
ps = strtoul(first, &end, 10);
@@ -63,6 +60,7 @@ parse_ports(cmdline_portlist_t *pl, const char *str)
return -1;
parse_set_list(pl, ps, pe);
+ first = (last == NULL ? NULL : last + 1);
}
return 0;
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-10-27 15:54:34.977880376 +0000
+++ 0003-cmdline-fix-port-list-parsing.patch 2025-10-27 15:54:34.719947643 +0000
@@ -1 +1 @@
-From 48e03475262798e6758b9c767e87e2f88375072c Mon Sep 17 00:00:00 2001
+From 712571041c9a7b6cc7fde5eeb504855d2c05d36a 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 @@
-@@ -33,15 +33,12 @@ parse_set_list(cmdline_portlist_t *pl, size_t low, size_t high)
+@@ -31,15 +31,12 @@ parse_set_list(cmdline_portlist_t *pl, size_t low, size_t high)
@@ -48 +49 @@
-@@ -65,6 +62,7 @@ parse_ports(cmdline_portlist_t *pl, const char *str)
+@@ -63,6 +60,7 @@ parse_ports(cmdline_portlist_t *pl, const char *str)
More information about the stable
mailing list