Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1012306lqo; Thu, 9 May 2024 02:00:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV2SuFq9IWVNwymW/ta5lJLzUM+QR0uCryzG5mHsdIBl8F5zllTBt17RRfs90tnuQbS+669IRmZVQqdHPqLjJ0iV/rGdy1slt4IYMIwzQ== X-Google-Smtp-Source: AGHT+IEvDmqyhJAeGA93GdfXdQVJjOGW69VQDaA+UrunXucqebQ7bSNcm+t7tzyFvcORT1UJwC9L X-Received: by 2002:a05:6512:b99:b0:522:211:7ba2 with SMTP id 2adb3069b0e04-52202117c03mr270282e87.68.1715245219676; Thu, 09 May 2024 02:00:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715245219; cv=pass; d=google.com; s=arc-20160816; b=GsJTKHtYw/jQhvDNfSnN5soq5ORtsP28ZO7i5vYeq5lvOxlK+047k6VZk2ZeNVN89T fdJgT4IfD6SNIaKLJsQJHMfO4NoyNlpZDX1xxZA2BsgrqrXsT9sC4b6TGyDwTOgKHoy8 UNlxYzwp3om0VW1az3VWW94y+Y4WBHlZrsu+2szzgrx3BwyC5UguhXS51TR+2AZ29TLc a4NmHA1PUdrLv6XU6lXQZaZXUNtVe9Fn51NOjQHVBCdWctV9ftz4PMxKYn9xABV6T8X8 gP2nUd85zr48Oe8jAFgpdjg0SjhQtHRWNVxhqfpSosTuIQk1UHF/y++kmTvCXRweCsHW cCOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:subject :references:in-reply-to:cc:to:from:dkim-signature; bh=dVgAF9GziDiKf3QzVZ3K1kynuZPLLiuc8qahvHNGk/s=; fh=k1tFiRkHtZCJcs6NVMeIwpcqSk8F7mtMfRsChPs4X1E=; b=JqvpmglfIejrrZLKyG8Lr664wbjCVGEjy05OqC39giX1OaC+ozP8vF0RscVOL1639J dM51nE+4fcFfvm1riwVax3vmKwd3h/Z/4EaDqEZgsQ7U5fucWexU8sXZwbHAloLw8NhV ucqU9K0k+piFly6KAhv94o0VzKN6U9VUOqM3KXhvwpwR2OTTH5l+ieYtZI5fLC4qT6Pe DxJ41W6U9KiZ+KoP7XRtoFyY2H1k/9O98L29/AhYcw7RgQy/x5pcF+YkP6+HzaAav1x5 LSC+w/s/ZeQZLnVuTY0kDKSZlndIYxoVsaxNcl3xHilXCncgW442skuyp0EW2WLRfwO4 RNKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nhDWojYD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-174319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17945d0bsi60988466b.138.2024.05.09.02.00.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 02:00:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nhDWojYD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-174319-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 63DA61F225A2 for ; Thu, 9 May 2024 09:00:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 576D914A4F5; Thu, 9 May 2024 08:59:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nhDWojYD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B2A114A4DB; Thu, 9 May 2024 08:59:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715245198; cv=none; b=Z8HhEvE+tsjWJg0GGxxth4dEgz+ve0/R5wvDGguUfGM2Th05McypEoWH+JdIx7GoGGSRkmYdTajFRyANe3G12R+sPaSvvTZvexRocerv7ybdjXUBJO3VA+LGAUyD/I0fLF+nYzLcnaUrphXOLk8WQYzQV3fEsNX9O5skRDfsUJ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715245198; c=relaxed/simple; bh=wId5LydJpHj2o6d7NLq6k8n7cZ+wGMXnhD2+b9FaBCw=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=N6Q+QwSbg655PWJFeltVTeX2MUMCqD6Qv6JvIvAQaW53M8vhi/2o3TpTpXv5Xm8lhFJKaIirVJIwpmjB56QJi9FRkFbZxnS9JZg34dIaZqybmbMfnHDSu326Vmi/84PWjCI897vPeLZkKwkvcgzP8/rqT/eLRsQWBGuRIIbjCYQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nhDWojYD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78ED4C2BBFC; Thu, 9 May 2024 08:59:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715245198; bh=wId5LydJpHj2o6d7NLq6k8n7cZ+wGMXnhD2+b9FaBCw=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=nhDWojYDHF54U5CgJ7GgTazjJEMiX5BEtL3ttbR0w+YpAaGcFLZpmlk3M/8L7hTJL c+4bYmIpdL6xQUicsykAL0aYbjGK0V/q0L3cxl3Du8q89kRTU3m+fQjyjceEDiWYUP nIST64C2d3aG3pQo1y/ch/VyfwEXNbgK6gMVEAP+o0SdW0/XmVPOr6IE6VBW2NKrXu Y42A3eoD/dNbz/Gr0nzGHE9YgPyEJebhBTYamPZGRI0UNZPTD0HyaPtfO9gfDtczxp h6j9Y95nGLXUjUhk6kZztWI0TNgO2MrHiv7IF0kl061sit00AIxK7ZHCmK8A3N+D0C Bw/0mjPuzNcjA== From: Leon Romanovsky To: Selvin Xavier , Jason Gunthorpe , Devesh Sharma , Naresh Kumar PBS , Michal Schmidt Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240507103929.30003-1-mschmidt@redhat.com> References: <20240507103929.30003-1-mschmidt@redhat.com> Subject: Re: [PATCH] bnxt_re: avoid shift undefined behavior in bnxt_qplib_alloc_init_hwq Message-Id: <171524519355.889134.12469325518934159365.b4-ty@kernel.org> Date: Thu, 09 May 2024 11:59:53 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.14-dev On Tue, 07 May 2024 12:39:28 +0200, Michal Schmidt wrote: > Undefined behavior is triggered when bnxt_qplib_alloc_init_hwq is called > with hwq_attr->aux_depth != 0 and hwq_attr->aux_stride == 0. > In that case, "roundup_pow_of_two(hwq_attr->aux_stride)" gets called. > roundup_pow_of_two is documented as undefined for 0. > > Fix it in the one caller that had this combination. > > [...] Applied, thanks! [1/1] bnxt_re: avoid shift undefined behavior in bnxt_qplib_alloc_init_hwq https://git.kernel.org/rdma/rdma/c/78cfd17142ef70 Best regards, -- Leon Romanovsky