lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260113192432.25a799f4@pumpkin>
Date: Tue, 13 Jan 2026 19:24:32 +0000
From: David Laight <david.laight.linux@...il.com>
To: Mark Brown <broonie@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-ext4@...r.kernel.org,
 linux-fsdevel@...r.kernel.org, linux-mm@...ck.org, Alexander Viro
 <viro@...iv.linux.org.uk>, Andreas Dilger <adilger.kernel@...ger.ca>,
 Christian Brauner <brauner@...nel.org>, Kees Cook <kees@...nel.org>, Miklos
 Szeredi <miklos@...redi.hu>, OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
 Theodore Ts'o <tytso@....edu>
Subject: Re: [PATCH 30/44] fs: use min() or umin() instead of min_t()

On Tue, 13 Jan 2026 18:33:46 +0000
David Laight <david.laight.linux@...il.com> wrote:

> On Tue, 13 Jan 2026 16:56:56 +0000
> Mark Brown <broonie@...nel.org> wrote:
> 
> > On Wed, Nov 19, 2025 at 10:41:26PM +0000, david.laight.linux@...il.com wrote:  
> > > From: David Laight <david.laight.linux@...il.com>
> > > 
> > > min_t(unsigned int, a, b) casts an 'unsigned long' to 'unsigned int'.
> > > Use min(a, b) instead as it promotes any 'unsigned int' to 'unsigned long'
> > > and so cannot discard significant bits.    
> > 
> > This breaks an arm imx_v6_v7_defconfig build:  
> 
> I hadn't tested 32bit when I sent the patch.
> It was noticed ages ago and I thought there was a patch (to fuse/file.c) that
> changed the code to avoid the 64bit signed maths on 32bit.

I've just sent in a patch to fix it, compile tested for 32bit x86.

	David

> > 
> > In file included from <command-line>:
> > In function 'fuse_wr_pages',
> >     inlined from 'fuse_perform_write' at /home/broonie/git/bisect/fs/fuse/file.c:1347:27:
> > /home/broonie/git/bisect/include/linux/compiler_types.h:630:45: error: call to '__compiletime_assert_434' declared with attribute error: min(((pos + len - 1) >> 12) - (pos >> 12) + 1, max_pages) signedness error
...                       ^~~~~~~~~~~~~
> > /home/broonie/git/bisect/fs/fuse/file.c:1326:16: note: in expansion of macro 'min'
> >  1326 |         return min(((pos + len - 1) >> PAGE_SHIFT) - (pos >> PAGE_SHIFT) + 1,
> >       |                ^~~  
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ