diff options
author | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2008-05-12 11:58:48 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-06-05 13:13:14 -0400 |
commit | 10220c884444a1866bb070e207d84fc18188e2a7 (patch) | |
tree | d931cbfe5375a4e24ff05b3f6ae143b0b214416e /arch/mips/kernel | |
parent | 057229f9efc7ebebd3ce0496195ed46df631f383 (diff) |
[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: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/traps.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index cb8b0e2c7954..f9165d1a17bf 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -88,15 +88,17 @@ static void show_raw_backtrace(unsigned long reg29) | |||
88 | #ifdef CONFIG_KALLSYMS | 88 | #ifdef CONFIG_KALLSYMS |
89 | printk("\n"); | 89 | printk("\n"); |
90 | #endif | 90 | #endif |
91 | #define IS_KVA01(a) ((((unsigned int)a) & 0xc0000000) == 0x80000000) | 91 | while (!kstack_end(sp)) { |
92 | if (IS_KVA01(sp)) { | 92 | unsigned long __user *p = |
93 | while (!kstack_end(sp)) { | 93 | (unsigned long __user *)(unsigned long)sp++; |
94 | addr = *sp++; | 94 | if (__get_user(addr, p)) { |
95 | if (__kernel_text_address(addr)) | 95 | printk(" (Bad stack address)"); |
96 | print_ip_sym(addr); | 96 | break; |
97 | } | 97 | } |
98 | printk("\n"); | 98 | if (__kernel_text_address(addr)) |
99 | print_ip_sym(addr); | ||
99 | } | 100 | } |
101 | printk("\n"); | ||
100 | } | 102 | } |
101 | 103 | ||
102 | #ifdef CONFIG_KALLSYMS | 104 | #ifdef CONFIG_KALLSYMS |