All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OOPS in identify_cpu() on CPUs without CPUID
@ 2009-08-08 17:08 Ondrej Zary
  2009-08-08 17:53 ` Ingo Molnar
  0 siblings, 1 reply; 6+ messages in thread
From: Ondrej Zary @ 2009-08-08 17:08 UTC (permalink / raw)
  To: tglx; +Cc: mingo, hpa, x86, linux-kernel

Kernel is broken for x86 CPUs without CPUID since 2.6.28. It crashes with NULL
pointer dereference in identify_cpu():

766        generic_identify(c);
767
768-->     if (this_cpu->c_identify)
769                this_cpu->c_identify(c);

this_cpu is NULL. This is because it's only initialized in get_cpu_vendor()
function, which is not called if the CPU has no CPUID instruction.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>

--- linux-2.6.30.4-orig/arch/x86/kernel/cpu/common.c	2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30.4-router/arch/x86/kernel/cpu/common.c	2009-08-08 18:00:21.000000000 +0200
@@ -699,6 +699,7 @@
 
 static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 {
+	this_cpu = &default_cpu;
 	c->extended_cpuid_level = 0;
 
 	if (!have_cpuid_p())


-- 
Ondrej Zary

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-09 21:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-08 17:08 [PATCH] OOPS in identify_cpu() on CPUs without CPUID Ondrej Zary
2009-08-08 17:53 ` Ingo Molnar
2009-08-08 18:19   ` Ondrej Zary
2009-08-09  1:28   ` H. Peter Anvin
2009-08-09 21:12     ` Ondrej Zary
2009-08-09 17:45   ` [PATCH v2] " Ondrej Zary

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.