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 3ECCA46A35 for ; Mon, 23 Jun 2025 11:33:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3224340041; Mon, 23 Jun 2025 11:33:03 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id AE9FF40041 for ; Mon, 23 Jun 2025 11:33:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1750671181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K5mC2lWadMcO+NFWfeWZLS91i2dZ/ao9sOXJqAfT7IA=; b=HPqYx4L0euH7HJmmROp26OuAFh5/LEFPmN9MlEXGJsqtDbwSTekOY2SneOM4fFIe5rQBaC X7OXpcDydeLFoQaLzRVM0aAzINWUD5zTg/8PDWqfiwYLiuc+du6K0gaBWH/qmY8hJCaGtP z57Otl9UkYjrLqg5qX5jXI3Coqx4tD8= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-Ve2qOyGBMEmcTm2GCe5alw-1; Mon, 23 Jun 2025 05:32:59 -0400 X-MC-Unique: Ve2qOyGBMEmcTm2GCe5alw-1 X-Mimecast-MFC-AGG-ID: Ve2qOyGBMEmcTm2GCe5alw_1750671178 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-553b331c94bso1653825e87.3 for ; Mon, 23 Jun 2025 02:32:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750671177; x=1751275977; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K5mC2lWadMcO+NFWfeWZLS91i2dZ/ao9sOXJqAfT7IA=; b=dM0Gsnxayt02yE8AUmjwGGt5TuwmIv8JSZKaC73FZGoxyCQbfjylsC9w4CmLhNFymV h1k6QbsQnL9J3b+cDxgQmLl5QLff+y8rCoOV8Jz4HcLzLAKib/OKHQaPQ8Riq3vGpzDE Vw496UuOYqWRHmTGGgQN2UPMjgLG2brzFQkweUXg/zVohSLKVmeDYmHTQiryuZVLt+Bc F55PbIUfbsJi/WBvwB77o4lq4zQR0uGE54mjfD7lw1wwEy2QR3Qk/EtPG01TV6oHlj0o EJ17BIQA47OKXZyD+d/fN4xCQNTyXhf2/NZ/3JGlzAVEvcU9rrAsDnZO1U6TnNsrMTWl gXmw== X-Forwarded-Encrypted: i=1; AJvYcCWSQqxdVPohlwzTw9TFS71EOJfCoKJDZJBDvRJ4Zn2Pzyj9+/xtrLUjtut4ZRJp0MCI8+9XIH0=@dpdk.org X-Gm-Message-State: AOJu0YxSWZ3zK4i+uyC5fGpFIGOxOYUivGnN0Wyx9OLVy1IRTw58sKOO 2mz1WBWZfVv59A78wpVq9FgQhYHtmlyQCb1fIk8/0KsVWdspylp3+zyFTyltDcunn9fIazjDVMn DiJNA8UQzgiC1VctXhZWKfTz8dmHAC1l/UBdnlUDwQLfyh9r8xuyF/y2TeSZz842cAMsYJSGfmg mRviuJmJ0uYzUAaUkbrsQajKo= X-Gm-Gg: ASbGnctUFQIYXD6rTSgXkA4ohi1HJwzZy0sXiVMZd05RCc3+zOljQVL4AfOIM/0D4Rj SDd3bMr27eti/c08sHHzMTkO2+959bmnE+eEPiwuKaJaQq0e1LfMFVC/UbE/upgXFxCV6D+Pzxv aV84Wb9Q== X-Received: by 2002:a05:6512:110f:b0:553:2eff:8d74 with SMTP id 2adb3069b0e04-553e3c076f6mr3716186e87.42.1750671177567; Mon, 23 Jun 2025 02:32:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6eNVLu3obko6CgPut+CaEDnilL28SejfoGuhv8Bh3URnwoFS4cWRJ04Zp2n0ASllqzF1aoSBH/5oVirL5JIw= X-Received: by 2002:a05:6512:110f:b0:553:2eff:8d74 with SMTP id 2adb3069b0e04-553e3c076f6mr3716172e87.42.1750671177130; Mon, 23 Jun 2025 02:32:57 -0700 (PDT) MIME-Version: 1.0 References: <20250619071037.37325-1-david.marchand@redhat.com> <20250619071037.37325-7-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Mon, 23 Jun 2025 11:32:43 +0200 X-Gm-Features: AX0GCFsnxmf7c9ldCPi2hW6123nXdHuik9YwATakJCdPtlY61cw8AF_HvjiW7As Message-ID: Subject: Re: [PATCH 06/10] cmdline: fix highest bit port list parsing To: Bruce Richardson Cc: dev@dpdk.org, stable@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: kHq_VxVvnopvvV3BUvgatJFwawHEAR87DRphzgdFcko_1750671178 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Fri, Jun 20, 2025 at 11:22=E2=80=AFAM Bruce Richardson wrote: > > On Thu, Jun 19, 2025 at 09:10:32AM +0200, David Marchand wrote: > > pl->map is a uint32_t. > > > > Caught by UBSan: > > > > ../lib/cmdline/cmdline_parse_portlist.c:27:17: runtime error: > > left shift of 1 by 31 places cannot be represented in type 'int' > > SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior > > ../lib/cmdline/cmdline_parse_portlist.c:27:17 in > > > > Fixes: af75078fece3 ("first public release") > > Cc: stable@dpdk.org > > > > Signed-off-by: David Marchand > > --- > > lib/cmdline/cmdline_parse_portlist.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/lib/cmdline/cmdline_parse_portlist.c b/lib/cmdline/cmdline= _parse_portlist.c > > index 0c07cc02b5..3ef427d32a 100644 > > --- a/lib/cmdline/cmdline_parse_portlist.c > > +++ b/lib/cmdline/cmdline_parse_portlist.c > > @@ -11,7 +11,9 @@ > > #include > > > > #include > > +#include > > #include > > + > > #include "cmdline_parse.h" > > #include "cmdline_parse_portlist.h" > > > > @@ -27,7 +29,7 @@ static void > > parse_set_list(cmdline_portlist_t *pl, size_t low, size_t high) > > { > > do { > > - pl->map |=3D (1 << low++); > > + pl->map |=3D RTE_BIT32(low++); > > } while (low <=3D high); > > } > > > While this is correct, the use of "++" in a call to a macro sets off some > alarm bells for me! > Can we put the "++" in the while instead, as "++low"? It would be safer yes. --=20 David Marchand