summaryrefslogtreecommitdiff
path: root/arch/sh/kernel/traps.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-16 11:23:36 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-16 11:23:36 +0200
commit766d02786ecd22932beeb9ca8bad6d8c5a552ef9 (patch)
treef6f2df0e35bbea914d1f4d12be6d02f128c73575 /arch/sh/kernel/traps.c
parent906d882cacecd37ad2fdd03ed2a9b232bcb9507e (diff)
parent066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff)
Merge branch 'linus' into core/rcutip-core-rcu-2008-06-16_09.23_Mon
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 @@
#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