diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-19 16:33:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-19 16:33:08 -0700 |
commit | db07b02304d0d70bf8273abc93d94e4c8d2f9cec (patch) | |
tree | 02ff2652fdbf288021bcbcf9af37b79d9aa76254 /arch/sh/kernel/traps.c | |
parent | 88e6c9499f959cdac9ef120a1a1e857da5944052 (diff) | |
parent | 336f1d326831873ffab6de5fcec4b3be05103ae0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: Fix up restorer in debug_trap exception return path.
sh: Make is_valid_bugaddr() more intelligent on nommu.
sh: use the common ascii hex helpers
sh: fix sh7785 master clock value
sh: Fix up thread info pointer in syscall_badsys resume path.
sh: Fix up optimized SH-4 memcpy on big endian.
sh: disable initrd defaults in .empty_zero_page.
sh: display boot params by default on entry.
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 a3bdc68ef02c..438f1ebcc453 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 |