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] [thread-next>] [day] [month] [year] [list]
Message-ID: <52e0c3d1-239b-475e-8ddd-932a460c6da1@ghiti.fr>
Date: Tue, 18 Feb 2025 15:46:23 +0100
From: Alexandre Ghiti <alex@...ti.fr>
To: Dan Carpenter <dan.carpenter@...aro.org>, Philip Li <philip.li@...el.com>
Cc: David Laight <david.laight.linux@...il.com>,
 Christoph Hellwig <hch@....de>, kernel test robot <lkp@...el.com>,
 oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
 Carlos Maiolino <cem@...nel.org>, "Darrick J. Wong" <djwong@...nel.org>,
 linux-riscv@...ts.infradead.org
Subject: Re: fs/xfs/xfs_buf.c:1534 xfs_buf_submit_bio() warn: unsigned '_x' is
 never less than zero.

Hi Dan,

On 18/02/2025 15:21, Dan Carpenter wrote:
> On Tue, Feb 18, 2025 at 08:39:21AM +0800, Philip Li wrote:
>> + Dan
>>
>> Hi Dan,
>>
>> On Mon, Feb 17, 2025 at 01:12:03PM +0000, David Laight wrote:
>>> On Mon, 17 Feb 2025 13:06:49 +0100
>>> Alexandre Ghiti <alex@...ti.fr> wrote:
>>>
>>>> Hi Christoph,
>>>>
>>>> On 17/02/2025 10:24, Christoph Hellwig wrote:
>>>>> On Mon, Feb 17, 2025 at 01:53:08PM +0800, kernel test robot wrote:
>>>>>> New smatch warnings:
>>>>>> fs/xfs/xfs_buf.c:1534 xfs_buf_submit_bio() warn: unsigned '_x' is never less than zero.
>>>>> Looks like this is an issue in the riscv virt_to_page implementation
>>>>> which also shows up in various other places.  Any chance this could get
>>>>> fixed in the riscv code?
>>>>
>>>> To me, the only test that could give rise to this warning is the last
>>>> part of:
>>>>
>>>> #define is_linear_mapping(x) \
>>>>           ((x) >= PAGE_OFFSET && (!IS_ENABLED(CONFIG_64BIT) || (x) <
>>>> PAGE_OFFSET + KERN_VIRT_SIZE))
>>>>
>>>> But given that the config is a 32-bit config, it should not be evaluated
>>>> at all.
>>>>
>>>> Could that be a false-positive and then an issue in smatch?
>>> Why is smatch even looking.
>>> The equivalent check in gcc has been moved to -W2 because of all false positives.
> The Smatch check is a bit more sophisticated than the GCC check...
> I think if you removed the (!IS_ENABLED(CONFIG_64BIT) condition then
> Smatch wouldn't trigger a warning here.  How would I duplicate this
> warning?  The "ARCH=riscv make.cross" command does a 64bit build.


riscv uses the same toolchain for both 32 and 64-bit, if you look at the 
faulty config, you can see that CONFIG_32BIT is enabled so it actually 
is a 32-bit build.

Thanks for jumping in,

Alex


>
> Screw it, I can just silence this warning based on that it's a kernel
> build and the variable is called "_x".
>
> regards,
> dan carpenter
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ