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: <f85ba2f8-d611-4d68-829d-b96c45201882@t-8ch.de>
Date: Sun, 9 Nov 2025 21:27:11 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Willy Tarreau <w@....eu>
Cc: linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] tools/nolibc: avoid using plain integer as NULL pointer

On 2025-11-09 20:57:54+0100, Willy Tarreau wrote:
> Hi Thomas,
> 
> On Sun, Nov 09, 2025 at 08:27:29PM +0100, Thomas Weißschuh wrote:
> > The integer zero should not be used as NULL pointer.
> > It is invalid and sparse will complain about it.
> > 
> > Use proper NULL pointers instead.
> 
> Huh ? I've been using that for decades and seeing it everywhere. That's
> quite bizarre, 0 is perfectly valid as a pointer. Ah, here it is, in
> C99:6.3.2.3:
> 
>   An integer constant expression with the value 0, or such an expression
>   cast to type void *, is called a null pointer constant.
> 
> The change is small, so if it hurts sparse, I'm fine with changing it,
> but at least the commit message should be adjusted to say that sparse
> doesn't like it and not that it's not valid.

Yeah, indeed '0' is special and valid, even in C23.
My recollection was wrong. Thanks for the hint!

> > Reported-by: kernel test robot <lkp@...el.com>
> > Closes: https://lore.kernel.org/r/202509261452.g5peaXCc-lkp@intel.com/
> > Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
> 
> For the patch: Acked-by: Willy Tarreau <w@....eu>

And thanks again.


Thomas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ