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-next>] [day] [month] [year] [list]
Date:	Sun, 11 Jan 2009 11:46:23 -0800
From:	Mike Travis <travis@....com>
To:	Ingo Molnar <mingo@...e.hu>
CC:	Christophe Saout <christophe@...ut.de>,
	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH]: xen: fix too early kmalloc call

Subject: xen: fix too early kmalloc call

From: Christophe Saout <christophe@...ut.de> 

Impact: fixes bootup of xen.

Christophe reported the following problem:

>  (basically it seems that SLAB is not yet up, with earlyprintk it is
>  giving me an Oops in __kmalloc before)

Replace call to kmalloc with alloc_bootmem.

Also from Christophe:
> (me)
> > Or I could copy the text and submit it as a new patch?
>
> Yes, I would prefer that.  Also, my commit message was not really
> following Kernel standards and it's only a very simple change.

Signed-off-by: Mike Travis <travis@....com>
---
 drivers/xen/events.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- linux-2.6-for-ingo.orig/drivers/xen/events.c
+++ linux-2.6-for-ingo/drivers/xen/events.c
@@ -26,6 +26,7 @@
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <linux/string.h>
+#include <linux/bootmem.h>
 
 #include <asm/ptrace.h>
 #include <asm/irq.h>
@@ -831,8 +832,8 @@ void __init xen_init_IRQ(void)
 	int i;
 	size_t size = nr_cpu_ids * sizeof(struct cpu_evtchn_s);
 
-	cpu_evtchn_mask_p = kmalloc(size, GFP_KERNEL);
-	BUG_ON(cpu_evtchn_mask == NULL);
+	cpu_evtchn_mask_p = alloc_bootmem(size);
+	BUG_ON(cpu_evtchn_mask_p == NULL);
 
 	init_evtchn_cpu_bindings();
 
--
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