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
| ||
|
Date: Mon, 31 Jul 2006 21:14:33 -0700 From: Paul Jackson <pj@....com> To: Andrew Morton <akpm@...l.org> Cc: Tony Luck <tony.luck@...el.com>, Jack Steiner <steiner@....com>, Paul Jackson <pj@....com>, linux-kernel@...r.kernel.org, Dan Higgins <djh@....com> Subject: [PATCH] ia64: panic if topology_init kzalloc fails From: Paul Jackson <pj@....com> There really is no sense trying to continue if the kzalloc of sysfs_cpus[] fails in ia64 topology_init. The code calling into here doesn't check errors very well, and one ends up with a nonobvious boot failure that wastes peoples time debugging. See for example the lkml thread at: http://lkml.org/lkml/2006/3/2/215 Since the system is totally dead when this kzalloc fails, not having yet even booted, might as well announce one's death boldly and plainly. Signed-off-by: Paul Jackson <pj@....com> --- arch/ia64/kernel/topology.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- 2.6.18-rc2-mm1.orig/arch/ia64/kernel/topology.c 2006-07-31 17:18:04.921717318 -0700 +++ 2.6.18-rc2-mm1/arch/ia64/kernel/topology.c 2006-07-31 21:12:08.950508732 -0700 @@ -67,10 +67,8 @@ static int __init topology_init(void) #endif sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL); - if (!sysfs_cpus) { - err = -ENOMEM; - goto out; - } + if (!sysfs_cpus) + panic("kzalloc in topology_init failed - NR_CPUS too big?"); for_each_present_cpu(i) { if((err = arch_register_cpu(i))) -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@....com> 1.650.933.1373 - 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