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:	Sun, 22 Oct 2006 17:16:05 -0400
From:	Josef Sipek <jsipek@....cs.sunysb.edu>
To:	Amit Choudhary <amit2030@...il.com>
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2.6.19-rc2] mm/slab.c: check kmalloc() return value.

On Sun, Oct 22, 2006 at 01:37:51PM -0700, Amit Choudhary wrote:
> Description: Check the return value of kmalloc() in function setup_cpu_cache(), in file mm/slab.c.
> 
> Signed-off-by: Amit Choudhary <amit2030@...il.com>
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 84c631f..613ae61 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -2021,6 +2021,7 @@ static int setup_cpu_cache(struct kmem_c
>  	} else {
>  		cachep->array[smp_processor_id()] =
>  			kmalloc(sizeof(struct arraycache_init), GFP_KERNEL);
> +		BUG_ON(!cachep->array[smp_processor_id()]);
>  
>  		if (g_cpucache_up == PARTIAL_AC) {
>  			set_up_list3s(cachep, SIZE_L3);

Any reason to BUG instead of trying to return as gracefully as possible?

Josef "Jeff" Sipek.

-- 
My public GPG key can be found at
http://www.josefsipek.net/gpg/public-0xC7958FFE.txt
-
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