Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp819284ybi; Fri, 21 Jun 2019 08:41:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGgtCNo+jqNhpuJcZDChBMuwJ2jl1g1wHKc2GdhjzxOoWSOgYnMVT6tiREpMCJ4a1sLxZO X-Received: by 2002:a63:d24f:: with SMTP id t15mr17128165pgi.301.1561131667856; Fri, 21 Jun 2019 08:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561131667; cv=none; d=google.com; s=arc-20160816; b=xQif15/6SsEP7+KPT5ocZ7NGOjjVgJdvLUWFebMFIMi0s5apLwWU38lDByI/U1bMAY 2XueS2NqIqdYKV5OOCI0fmDdwnz660GdsDrBGKXY4Hpm4yckZnxIp4L2tJ5PN8sHF8CZ 9CGUC9uHOzigRJV+O35VdluWtwJAzfElzYS7V30X+Y1/u32SrnmpB3dkI2UkGP8eqaLT +Mb0yA5pHo5hCrB9JFEQ7fd0zkuwcK4A+1lSoQIuEmnEWFyGTcrLS4TZOC1A2Y2vWQ1c HPVv27dwY6AoHTSu0KeWTv9Axa2B8mRsjZcceJ1RNs919xdjbG8CIVfqQzDvzBFOn9j5 LhaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=0DO2SpbbHfP8ecz/u+NXxyefLywlMF+g+VURyxOu10E=; b=u8zUYmhz30Hy2zrWFP6XI9i6514iycU7UCdazPIPofrRo7QeEC39ix4b1tF2zTI2bK oFAAuB83VFGIm0wg73AVei5f3q8EgRkrDpWQ52wAXcQgzu9cnMl1Wr5+hPUHxeZbDoDG FA2hjcJmvEsmOGlU5u0thuGGg1dSJ0mpL2Rnr6bFFe3T7Z8ugRsCZcjBV7LPFLH6XAOd /SItv8u5UnGudZBGjtPb5yDkDeG3LM9J6RrBkeL52Ae6zdc6pOk9qz37FA8A2qIt06/M AI/nEJKr3VGfftoEzJpnE9M0PqF3V+nacr6b1cOOBqOiAZ7SXmVYYJ959ShIIovfFesc uXzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=iSobbUTa; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=bBHZ95mC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si2774134pgv.520.2019.06.21.08.40.52; Fri, 21 Jun 2019 08:41:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=iSobbUTa; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=bBHZ95mC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbfFUPkl (ORCPT + 99 others); Fri, 21 Jun 2019 11:40:41 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:62277 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbfFUPkl (ORCPT ); Fri, 21 Jun 2019 11:40:41 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id BB8AA1519F0; Fri, 21 Jun 2019 11:40:39 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sasl; bh=eCa0cXPi9XBzBUPuF5chpLC+AgE=; b=iSobbU TaPTnL33ve//0JDpgGuPB/VlUfriSDvRfPb6IEQLX6zPGtnjxrqeZMaQVDnC8WLf jYwylsxFo4udYPeNEPJ2ZqDfHJkUqv+p6TKVmtft7jhofwhhdeayaJorc8ynz40R 2ylUq62Uw79cCBu4hnM8aHblv5O/0HmZX21pg= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id B189C1519ED; Fri, 21 Jun 2019 11:40:39 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=fluxnic.net; h=date:from:to:cc:subject:in-reply-to:message-id:references:mime-version:content-type; s=2016-12.pbsmtp; bh=ujoz+ORkKpXgxxOrhRvcnrsHog3Km5DX+cabVH6dv1E=; b=bBHZ95mC8tnpMvvlCHQ4nDFQMAFJtbL5X4Lo9cAu8SWAwx1mcI/5RR9tPG+qQ+zfgim4fq6bHegCcRhS3lFGwn0epu4yxNcHuRoMmB/bY1mK+z7uEwLUqGXFI9otS93wDASBWzb7AvS7MVOYcJ980GkETtu9lQZ95YBztlc5688= Received: from yoda.home (unknown [70.82.130.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 2D5FF1519EC; Fri, 21 Jun 2019 11:40:39 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTPSA id 464DC2DA01C8; Fri, 21 Jun 2019 11:40:38 -0400 (EDT) Date: Fri, 21 Jun 2019 11:40:38 -0400 (EDT) From: Nicolas Pitre To: Puranjay Mohan cc: Shuah Khan , linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, hch@infradead.org, Christoph Hellwig , Greg Kroah-Hartman Subject: Re: [PATCH v2 RESEND] fs: cramfs_fs.h: Fix shifting signed 32-bit value by 31 bits problem In-Reply-To: <20190618163352.4177-1-puranjay12@gmail.com> Message-ID: References: <20190618163352.4177-1-puranjay12@gmail.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Pobox-Relay-ID: EB870A3C-943A-11E9-AB0B-46F8B7964D18-78420484!pb-smtp1.pobox.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Jun 2019, Puranjay Mohan wrote: > Fix CRAMFS_BLK_FLAG_UNCOMPRESSED to use "U" cast to avoid shifting signed > 32-bit value by 31 bits problem. This isn't a problem for kernel builds > with gcc. > > This could be problem since this header is part of public API which > could be included for builds using compilers that don't handle this > condition safely resulting in undefined behavior. > > Signed-off-by: Puranjay Mohan > Reviewed-by: Christoph Hellwig > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Shuah Khan Acked-by: Nicolas Pitre > --- > V2 - use the unsigned constants for all flags, not just one > RESEND - Added Nicolas Pitre to CC list, added reviewed by tags. > > include/uapi/linux/cramfs_fs.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/linux/cramfs_fs.h b/include/uapi/linux/cramfs_fs.h > index 6713669aa2ed..71cb602d4198 100644 > --- a/include/uapi/linux/cramfs_fs.h > +++ b/include/uapi/linux/cramfs_fs.h > @@ -98,8 +98,8 @@ struct cramfs_super { > * > * That leaves room for 3 flag bits in the block pointer table. > */ > -#define CRAMFS_BLK_FLAG_UNCOMPRESSED (1 << 31) > -#define CRAMFS_BLK_FLAG_DIRECT_PTR (1 << 30) > +#define CRAMFS_BLK_FLAG_UNCOMPRESSED (1U << 31) > +#define CRAMFS_BLK_FLAG_DIRECT_PTR (1U << 30) > > #define CRAMFS_BLK_FLAGS ( CRAMFS_BLK_FLAG_UNCOMPRESSED \ > | CRAMFS_BLK_FLAG_DIRECT_PTR ) > -- > 2.21.0 > >