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]
Message-ID: <20070402095049.GA5831@saeurebad.de>
Date:	Mon, 2 Apr 2007 11:50:49 +0200
From:	Johannes Weiner <hannes-kernel@...urebad.de>
To:	Pekka Enberg <penberg@...helsinki.fi>
Cc:	linux-kernel@...r.kernel.org, heiko.carstens@...ibm.com,
	gorcunov@...il.com
Subject: [PATCH] Catch kmalloc failure in kmem_cache_init() (was: [QUESTION] check for mem in slab)

Hi,

> On 3/30/07, Heiko Carstens <heiko.carstens@...ibm.com> wrote:
> >> in file mm/slab.c and routine kmem_cache_init() I found there
> >> is no checking for allocated memory on line:
> >>
> >>       /* 4) Replace the bootstrap head arrays */
> >>       {
> >>               struct array_cache *ptr;
> >>
> >>               ptr = kmalloc(sizeof(struct arraycache_init), GFP_KERNEL);
> >>
> >> --> no check for ptr == NULL <--
> >[...]
> >> is that OK? or it's a bug?
> >
> >It's ok. If that allocation fails your machine won't come up anyway.
> 
> We ought to add a BUG_ON or comment at least there as this keeps
> popping up again and again.

Done. Patch attached.

Signed-off-by: Johannes Weiner <hannes-kernel@...urebad.de>


View attachment "slab-cache-init-kmalloc-failure-catch.patch" of type "text/plain" (599 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ