diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2008-07-03 16:24:06 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-07-03 16:24:06 -0400 |
commit | e86322f611eef95aafaf726fd3965e5b211f1985 (patch) | |
tree | 28547e26df4fc6ae671dc8cc6912a53717e4db08 /arch/sh/kernel/traps.c | |
parent | b001a1b6aa960949a24c2cdc28257dfcc9428d74 (diff) | |
parent | 8948896c9e098c6fd31a6a698a598a7cbd7fa40e (diff) |
Merge branch 'for-bfields' of git://linux-nfs.org/~tomtucker/xprt-switch-2.6 into for-2.6.27
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 @@ #include <linux/kdebug.h> #include <linux/signal.h> #include <linux/sched.h> +#include <linux/uaccess.h> #include <asm/system.h> #ifdef CONFIG_BUG @@ -21,7 +22,14 @@ static void handle_BUG(struct pt_regs *regs) int is_valid_bugaddr(unsigned long addr) { - return addr >= PAGE_OFFSET; + unsigned short opcode; + + if (addr < PAGE_OFFSET) + return 0; + if (probe_kernel_address((u16 *)addr, opcode)) + return 0; + + return opcode == TRAPA_BUG_OPCODE; } #endif |