Commit 10220c88 authored by Thomas Bogendoerfer's avatar Thomas Bogendoerfer Committed by Ralf Baechle

[MIPS] Fix check for valid stack pointer during backtrace

The newly added check for valid stack pointer address breaks at least for
64bit kernels.  Use __get_user() for accessing stack content to avoid crashes,
when doing the backtrace.
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 057229f9
...@@ -88,15 +88,17 @@ static void show_raw_backtrace(unsigned long reg29) ...@@ -88,15 +88,17 @@ static void show_raw_backtrace(unsigned long reg29)
#ifdef CONFIG_KALLSYMS #ifdef CONFIG_KALLSYMS
printk("\n"); printk("\n");
#endif #endif
#define IS_KVA01(a) ((((unsigned int)a) & 0xc0000000) == 0x80000000) while (!kstack_end(sp)) {
if (IS_KVA01(sp)) { unsigned long __user *p =
while (!kstack_end(sp)) { (unsigned long __user *)(unsigned long)sp++;
addr = *sp++; if (__get_user(addr, p)) {
if (__kernel_text_address(addr)) printk(" (Bad stack address)");
print_ip_sym(addr); break;
} }
printk("\n"); if (__kernel_text_address(addr))
print_ip_sym(addr);
} }
printk("\n");
} }
#ifdef CONFIG_KALLSYMS #ifdef CONFIG_KALLSYMS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment