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:	Fri, 28 Dec 2012 00:38:40 +0200
From:	Pekka Enberg <penberg@...nel.org>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Sasha Levin <sasha.levin@...cle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Johannes Weiner <hannes@...xchg.org>,
	"David S. Miller" <davem@...emloft.net>, Tejun Heo <tj@...nel.org>,
	Joonsoo Kim <js1304@...il.com>,
	Yinghai Lu <yinghai@...nel.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if
 slab is available

On Fri, Dec 28, 2012 at 12:31 AM, David Rientjes <rientjes@...gle.com> wrote:
> On Fri, 28 Dec 2012, Pekka Enberg wrote:
>
>> On Sun, 23 Dec 2012, Sasha Levin wrote:
>> >> diff --git a/mm/bootmem.c b/mm/bootmem.c
>> >> index 1324cd7..198a92f 100644
>> >> --- a/mm/bootmem.c
>> >> +++ b/mm/bootmem.c
>> >> @@ -763,9 +763,6 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
>> >>  void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
>> >>                                  unsigned long align, unsigned long goal)
>> >>  {
>> >> -     if (WARN_ON_ONCE(slab_is_available()))
>> >> -             return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id);
>> >> -
>> >>       return  ___alloc_bootmem_node(pgdat, size, align, goal, 0);
>> >>  }
>>
>> I'm not sure what Sasha's patch is trying to do here but the fall-back
>> is there simply to let the caller know it's calling the bootmem
>> allocator *too late*. That is, the slab allocator is already up and
>> running so you're expected to use that.
>>
>
> The __alloc_bootmem_node() variant is intended to panic rather than return
> NULL so there are callers that do not check the return value.  I'm
> suggesting rather than removing the fallback to the slab allocator to
> check the return value and panic() here if kzalloc_node() returns NULL.
> The __alloc_bootmem_node_nopanic() variant needs not be changed.

Makes sense. Dropping the fallback completely just makes it more
difficult to find early boot bugs where the bootmem allocator is
called too late.
--
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