Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1968538lqo; Mon, 13 May 2024 04:17:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkkXJQyJlP8+lZWocJLx0UXOfCCUd31i/+LsBQH+ZIeIaf0wgORb+0gzhEWo/8XrQX5jm+Ej85hvdMuaBNEqJe8cPe8gxYBkPzHzI4sA== X-Google-Smtp-Source: AGHT+IFrbBfJk7+T8td8y8lFT7oZpjtHspaw7jgmQcfQle3h94UJffdMvIlOu9FAzzWTNdfsEL92 X-Received: by 2002:a05:6870:78a:b0:233:6e02:57ee with SMTP id 586e51a60fabf-24172e2ebc9mr10943325fac.42.1715599048321; Mon, 13 May 2024 04:17:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715599048; cv=pass; d=google.com; s=arc-20160816; b=BCOA5D5eQ3oKfSS2NcGnLEh8N/UlkttUgLEAw1EmqNYl0RIKtZIz9GnBrALSpED/KR MMDlDn78ijVczwvt20cC7YMvHtwm6WbPd/DecM57Yi/RPBERxQfzvAvIxg84CAFDCO77 E6jDuSr0ep8BbinodMAe7jMenlNFjgCZKbkj7w7lZYKpDZ39sUr9+OwZS7aGjs/xKDQ2 hTtUflJbWkrKWIkp2kt/SJ6tmiISd905Y27I63L4xy3Tms8bAoe3r04z5wJrUQGNVBFU JIScMbjvU1Rar6daF0JJ3/XfqIdCSJzp45TGOC6Pu+z1Zo11myVDT/d+HbVy3980nIb2 g3Lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oF9SqHADEhWmSUqmeK7h0Oy9WUi6drReUbeX3mTVZGk=; fh=hgsOreaYiViZLLXmvK9a/MjRUKKBDxbZ/NxTP+FJl/w=; b=dAmuYTNrKfpCn8TB1x/b8jGz+MAIByadZ+Rme/9GRhTFFKdhsIHH4al02TupGgpwIb 1Y5WCUE+xcmxeseWZcM+avf/uXYYzOzSVSp5aqDg8Z8MvlxEajWZclMkNfyYnQt/g2HP DCGD5b1gcRzK2k/V9A06+XD/yrJtjlZbrEFum9WGBSdv2LDxWDe7Q8MNy6GtvgV/Q0jj JFOjEWjFunmEptAOALozebUeL4+tcrKdpqM70j+hyi0heJUkCeVt0uHvx7TnqBXS/JCU AfpvKfxgz8JbJcsGSvmSKz6pHyNL4+rDxniDgUvUnwFk+f4A5bZfesVDHuOSn2I7m8Sz Qeaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="cO/FgcyA"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3248-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4f2d266ebsi4382808b3a.211.2024.05.13.04.17.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 04:17:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="cO/FgcyA"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3248-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2CBB2285B2E for ; Mon, 13 May 2024 11:17:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EE4714B95F; Mon, 13 May 2024 11:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cO/FgcyA" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 55F3A1487E1 for ; Mon, 13 May 2024 11:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715599024; cv=none; b=JZ+txdzJO/NIixbeoI5v+Tt7bBnraMLRUpF4m9iEtWiAInIk5Q6DHfGZH3YFqKNbyaoT8++Az6OxcmzeeLOlndE4bqRkunFQ53xm2wT+p0rK3nt07QDgD1AMnrAaDdG8AVNOz7bQ5hFS4/G3YRJqxLF2XCJAb0EyTCBFrYVsjok= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715599024; c=relaxed/simple; bh=oF9SqHADEhWmSUqmeK7h0Oy9WUi6drReUbeX3mTVZGk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=V0GX3TlsvGJi33FHTIp3RAQ0EiWuyOAHp3qz3Uco2BfzlAqYfVkmqBZghiNyiAh/KqlyEch8R77P3i8fmXR3FqJb5VEBV2BGmqQm9itGJ0TuuPjf1YZrHHbyYnhlZVGZOMeJ5dPuzuya+1X6tc1kjRHWLhoFLiubEka4yX75lDo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cO/FgcyA; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715599019; 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: in-reply-to:in-reply-to:references:references; bh=oF9SqHADEhWmSUqmeK7h0Oy9WUi6drReUbeX3mTVZGk=; b=cO/FgcyAxh/Zh0olRp5oN7IYUZmnaghZSqRYYjxJ34JMEbWCV++kz03DFL/axLZdMzyVHG qdcm+SQnYb+e+szlSXggsJT6ZJtBTc0WQNxMzXZ3MBPmJnILxmatWyfsFhJvASVI0FVBXi q8cBiB2qUuFVv+0ZhkI1V7nBsmZ7Nw8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-491-ev2pRz-hNBS3nxmHs2Kfaw-1; Mon, 13 May 2024 07:16:55 -0400 X-MC-Unique: ev2pRz-hNBS3nxmHs2Kfaw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 84E0B800CB0; Mon, 13 May 2024 11:16:55 +0000 (UTC) Received: from [192.168.37.1] (unknown [10.22.48.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7645491032; Mon, 13 May 2024 11:16:52 +0000 (UTC) From: Benjamin Coddington To: Sergey Shtylyov Cc: Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org Subject: Re: [PATCH] nfs: fix undefined behavior in nfs_block_bits() Date: Mon, 13 May 2024 07:16:51 -0400 Message-ID: In-Reply-To: <69333a8c-a5a7-5c76-bc39-8835f11b8dcf@omp.ru> References: <69333a8c-a5a7-5c76-bc39-8835f11b8dcf@omp.ru> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 On 10 May 2024, at 16:24, Sergey Shtylyov wrote: > Shifting *signed int* typed constant 1 left by 31 bits causes undefined > behavior. Specify the correct *unsigned long* type by using 1UL instead. > > Found by Linux Verification Center (linuxtesting.org) with the Svace static > analysis tool. > > Cc: stable@vger.kernel.org > Signed-off-by: Sergey Shtylyov Reviewed-by: Benjamin Coddington Ben