From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 322A0489EF for ; Mon, 27 Oct 2025 17:20:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D4D34028B; Mon, 27 Oct 2025 17:20:14 +0100 (CET) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 3039140647 for ; Mon, 27 Oct 2025 17:20:13 +0100 (CET) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-475dc0ed8aeso22403585e9.2 for ; Mon, 27 Oct 2025 09:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761582013; x=1762186813; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tWEcCnzYSTO/+Y8eFVg9p1QeDWYXmoPi60XQ8KwVsNs=; b=Sq+TdECgNGC5dSEj1ydW7Qh9miD5/vH2DSJeNQQ5kBLkoUaiF09uYf/zhdiRMECSps 1E0cn7Y2tWLzKE5Ot2vyjP5/Ta8P/HZm/7IQ4U9T0GKHVDuOn3snpiJKlGFcaf6T1H7E otxEEydL4pVTh4q5RsfUlm2LWU3Zudh1obKlUiCGdt3EtYcu5aV+bSJ7OeWYNIPH9ApR +Uov1ntfV4gIWyNpZceYp8Oqoq8/bqqyjHMCWHcZss6HiAKIOa3VH2L6bJhYvCISQK4I gPzswI5Fq3QtPiooV5qMrEYebQCBSqUezGYHSbeGHi1U1Iole2A9jH2X1/SRNOvCtK4S 8IJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761582013; x=1762186813; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tWEcCnzYSTO/+Y8eFVg9p1QeDWYXmoPi60XQ8KwVsNs=; b=e+nzKf+xFtiXlMHwduReWBrygJY45KfxqDjnZvMWaAB5t+MftlYdk/T7Ly4358r/16 UlcEGe9dhsbLQilyOA3PM9F1Yc0i/dJLIXDdYeC/F1JmO8lUjWNN/NpkVE0QH2G1g6Rc +y/o0yoN1OX7tNGFIr1+Fkjo56nR6qqCrQ9fvd6/AOSXEhJD0X2GyEDoMwV7p98Woixu Mf1gr8NpBgnsT0zdfh91d0lGP9vZuW6dy30XVEK1ZRgKHWFjOoTZMNZu9ZeEGfKIZ8e/ r7EHbbtvpTFFswxWr1WbuuEVW+e+M5khgOMu25O5bCOhv59R5yUzOjTwYVw1RIDOf5nS ojCg== X-Forwarded-Encrypted: i=1; AJvYcCXblV3S0E9kd1v53v2xx5Y72UoKO1tJcakn7nivN4Tc4sgaOpcnA+9Q9MDWC3Fwi8CC6s+ae9Y=@dpdk.org X-Gm-Message-State: AOJu0YwpLY3KJbxri7eg6EF2xH7vgb6BTEMWryyvuWiJ6rGq6LaAR4dP C7s7fs4ELths1Mt1nZ1vK0jF29zpu81UIFokUrR3rzHc3kfrPZh9pb4f X-Gm-Gg: ASbGncvFdsGITuKdqnD/gpXKr78KpLODMYnnAProibdIjPU5BrsHUgonthzIPk7r/Gz xHKcqNwTpXFjgP377C/WthGVdWfVxHnTConfnp9gpXFzDFGPuGMcz4YTN0feJ4cxAlH9ZiC40ZK l9XaCPNLF8keoxDtY50mz2zG/16H99wQAomihOBtz7iEl2dVBi/fPW5v0bRdZ4EKJEcVAqut8aE +NAuZVDRn+THtRlNbf22Jq561B+If1hBn1cegWqrPbdCHrbAtZU6x62Kgln7IjicpCFgbO3/i0f NyCQCsxUOEpLuR+dH1MyS/rsHaOZLA5o2UeA5b678CSICXXHjYujvoNyByJPrcVMf/gQZXzzetR D+6DIzV0HQVaqOcHSgi5EALnGugOsB32ZjoCo+3T6rpnEdpa6ezReGVMZBtJoWq91I7I/AzC84u BhVnfMNwyrP9eKQHIg X-Google-Smtp-Source: AGHT+IGeeGGVqshhMxslEhA86ajQtesFy7QJPNoCRY72sQRuP2Hnk6hZ34J9k8YngmOkqR7dg0wDEQ== X-Received: by 2002:a05:600c:871b:b0:46d:cfc9:1d0f with SMTP id 5b1f17b1804b1-47717e3093cmr2372365e9.19.1761582012407; Mon, 27 Oct 2025 09:20:12 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:6fc5:c3bc:147e:832c]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-429952b79cbsm14835416f8f.4.2025.10.27.09.20.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 09:20:11 -0700 (PDT) From: luca.boccassi@gmail.com To: David Marchand Cc: Bruce Richardson , Marat Khalili , dpdk stable Subject: patch 'cmdline: fix port list parsing' has been queued to stable release 22.11.11 Date: Mon, 27 Oct 2025 16:18:41 +0000 Message-ID: <20251027162001.3710450-3-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251027162001.3710450-1-luca.boccassi@gmail.com> References: <20251027162001.3710450-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 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 Acked-by: Bruce Richardson Acked-by: Marat Khalili --- 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@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)