diff options
Diffstat (limited to 'arch/sh/kernel/traps.c')
-rw-r--r-- | arch/sh/kernel/traps.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c index a3bdc68ef02..438f1ebcc45 100644 --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/kdebug.h> | 4 | #include <linux/kdebug.h> |
5 | #include <linux/signal.h> | 5 | #include <linux/signal.h> |
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/uaccess.h> | ||
7 | #include <asm/system.h> | 8 | #include <asm/system.h> |
8 | 9 | ||
9 | #ifdef CONFIG_BUG | 10 | #ifdef CONFIG_BUG |
@@ -21,7 +22,14 @@ static void handle_BUG(struct pt_regs *regs) | |||
21 | 22 | ||
22 | int is_valid_bugaddr(unsigned long addr) | 23 | int is_valid_bugaddr(unsigned long addr) |
23 | { | 24 | { |
24 | return addr >= PAGE_OFFSET; | 25 | unsigned short opcode; |
26 | |||
27 | if (addr < PAGE_OFFSET) | ||
28 | return 0; | ||
29 | if (probe_kernel_address((u16 *)addr, opcode)) | ||
30 | return 0; | ||
31 | |||
32 | return opcode == TRAPA_BUG_OPCODE; | ||
25 | } | 33 | } |
26 | #endif | 34 | #endif |
27 | 35 | ||