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]
Date:	Mon, 26 Oct 2009 11:17:22 +0000
From:	Andy Whitcroft <apw@...onical.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Jan Ceuleers <jan.ceuleers@...puter.org>,
	David Miller <davem@...emloft.net>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scripts/checkpatch.pl: Add WARN on sizeof(&

On Sat, Oct 03, 2009 at 06:12:49PM -0700, Joe Perches wrote:
> On Sat, 2009-10-03 at 17:38 +0200, Jan Ceuleers wrote:
> > David Miller wrote:
> > > Any time you see "&" in a sizeof() expression, it's almost
> > > certainly a bug.  Something for the folks with automated
> > > tools to look for if they haven't already :-)
> > 
> > Your remark prompted me to find four more instances of such bugs
> > (none of which in the networking bits). I have submitted patches.
> 
> Perhaps a checkpatch test.
> 
> ---
> 
> sizeof(&foo) is frequently an error.  Warn on its use.
> 
> Signed-off-by: Joe Perches <joe@...ches.com>

Seems reasonable.  A slightly modified version of this is now in my
tree.  Thanks!

  http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-testing

-apw
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ