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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47FC5B7C.3020504@sgi.com>
Date:	Tue, 08 Apr 2008 23:00:28 -0700
From:	Mike Travis <travis@....com>
To:	Ingo Molnar <mingo@...e.hu>
CC:	Andi Kleen <andi@...stfloor.org>,
	Cyrill Gorcunov <gorcunov@...il.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Yinghai Lu <yhlu.kernel@...il.com>,
	Eric Dumazet <dada1@...mosbay.com>
Subject: Re: bootmem allocator

Ingo Molnar wrote:
> * Andi Kleen <andi@...stfloor.org> wrote:
> 
>>> hm, bootmem allocator is supposed to clear memory. We have a couple 
>>> of places that rely on that.
>> I was actually considering to change that for the GB pages hugetlbfs 
>> patchkit, because memset for 1G is a little slow and not needed (will 
>> be cleared later anyways) and it might be a problem for very large 
>> systems with a lot of such pages at boot.
> 
> changing the default behavior of bootmem alloc to be non-clearing is a 
> really bad idea that will only cause unrobustness. The proper approach 
> is to add an _opt-in_ API that does not clear memory 
> (bootmem_alloc_dontclear() or whatever), available to callers that know 
> it for sure that they dont need the clearing.

Yes, changing the default of bootmem_alloc is a bad idea.  I just changed
a bunch of static arrays to bootmem alloc's and it was pointed out early
that not only does bootmem_alloc clear memory, but also panics if it's not
available.

> Also take into account that alloc_bootmem_low() :
> - calls panic() if not enough memory
> - already clears allocated memory
> Signed-off-by: Eric Dumazet <dada1@...mosbay.com>

A specialized call to bootmem_alloc probably needs it's own API... ;-)

Thanks,
Mike
--
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