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]
Date:	Tue, 05 Jan 2010 23:08:08 -0800
From:	Roland Dreier <rdreier@...co.com>
To:	Wu Fengguang <fengguang.wu@...el.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	David Miller <davem@...emloft.net>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	Al Viro <viro@...iv.linux.org.uk>,
	Christoph Hellwig <hch@...radead.org>,
	Eric Paris <eparis@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] fs: O_* bit numbers uniqueness check


 > +	/* please add new bits here to ensure allocation uniqueness */
 > +	BUG_ON(20 != hweight32(
 > +		O_RDONLY	| O_WRONLY	| O_RDWR	|

I wonder if there's a way to make this BUILD_BUG_ON(), so the problem is
caught at compile time (a change like adding an O_ flag is often compile
tested only for obscure archs).  One could create a compile-time
macro-ized version of hweight32() and use that, I guess, although I'm
not sure it's worth the ugliness.

Failing that maybe this should be WARN_ON()?  I'd be annoyed if my arch
wouldn't boot because some strange new O_ flag happened to collide.

 - R.
--
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