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:	Thu, 21 Feb 2013 11:36:39 -0800
From:	Tejun Heo <tj@...nel.org>
To:	Vineet Gupta <Vineet.Gupta1@...opsys.com>
Cc:	Yinghai Lu <yinghai@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Chris Zankel <chris@...kel.net>,
	Max Filippov <jcmvbkbc@...il.com>,
	Marc Gauthier <marc@...silica.com>,
	Wanpeng Li <liwanp@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...nel.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] memblock: add assertion for zero allocation size

On Fri, Feb 22, 2013 at 01:03:41AM +0530, Vineet Gupta wrote:
> Where - you mean if user passes 0, just make it 1. Nah - it's better to complain
> and get the call site fixed !
> 
> > or BUG_ON(!align) instead?
> 
> That could be done too but you would also need BUG_ON(!size) - to catch another
> API abuse.
> BUG_ON(!size) however catches both the cases.

How about "if (WARN_ON(!align)) align = __alignof__(long long);"?
Early BUG_ON()s can be painful to debug depending on setup.

Thanks.

-- 
tejun
--
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