aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/traps.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-19 19:33:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-19 19:33:08 -0400
commitdb07b02304d0d70bf8273abc93d94e4c8d2f9cec (patch)
tree02ff2652fdbf288021bcbcf9af37b79d9aa76254 /arch/sh/kernel/traps.c
parent88e6c9499f959cdac9ef120a1a1e857da5944052 (diff)
parent336f1d326831873ffab6de5fcec4b3be05103ae0 (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.c10
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 @@
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
22int is_valid_bugaddr(unsigned long addr) 23int 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