From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] fs: fix integer overflow in MS_NOUSER definition Date: Sat, 21 Apr 2012 07:28:38 +0100 Message-ID: <20120421062838.GS6871@ZenIV.linux.org.uk> References: <20120421054949.32549.2823.stgit@zurg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Konstantin Khlebnikov Return-path: Content-Disposition: inline In-Reply-To: <20120421054949.32549.2823.stgit@zurg> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sat, Apr 21, 2012 at 09:49:49AM +0400, Konstantin Khlebnikov wrote: > MS_NOUSER defined as signed int (1<<31), sb->s_flags declared as unsigned long. > So (sb->s_flags & MS_NOUSER) works as (sb->s_flags & 0xffffffff80000000). ... and it's not a problem since we can't use bits 32 and above anyway - unsigned long is 32bit on a lot of platforms. I have no objections to making that 1U<<31, but it's not a bug, let alone an integer overflow.