diff options
author | David Howells <dhowells@redhat.com> | 2011-06-06 10:47:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-07 22:03:52 -0400 |
commit | db1c9dfa649f9bd8dc11415fbfe5cfe1e24c5b33 (patch) | |
tree | e032d804997b7494ff994b496aa5b3575e3a7495 /arch/mn10300/kernel | |
parent | 2e65d1f6eecc176ba1341541b5f41edd7eb4346a (diff) |
MN10300: die_if_no_fixup() shouldn't use get_user() as it doesn't call set_fs()
die_if_no_fixup() shouldn't use get_user() as it doesn't call set_fs() to
indicate that it wants to probe a kernel address. Instead it should use
probe_kernel_read().
This fixes the problem of gdb seeing SIGILL rather than SIGTRAP when hitting
the KGDB special breakpoint upon SysRq+g being seen. The problem was that
die_if_no_fixup() was failing to read the opcode of the instruction that caused
the exception, and thus not fixing up the exception.
This caused gdb to get a S04 response to the $? request in its remote protocol
rather than S05 - which would then cause it to continue with $C04 rather than
$c in an attempt to pass the signal onto the inferior process. The kernel,
however, does not support $Cnn, and so objects by returning an E22 response,
indicating an error. gdb does not expect this and prints:
warning: Remote failure reply: E22
and then returns to the gdb command prompt unable to continue.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mn10300/kernel')
-rw-r--r-- | arch/mn10300/kernel/traps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c index f03cb278828f..bd3e5e73826e 100644 --- a/arch/mn10300/kernel/traps.c +++ b/arch/mn10300/kernel/traps.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/irq.h> | 28 | #include <linux/irq.h> |
29 | #include <asm/processor.h> | 29 | #include <asm/processor.h> |
30 | #include <asm/system.h> | 30 | #include <asm/system.h> |
31 | #include <asm/uaccess.h> | 31 | #include <linux/uaccess.h> |
32 | #include <asm/io.h> | 32 | #include <asm/io.h> |
33 | #include <asm/atomic.h> | 33 | #include <asm/atomic.h> |
34 | #include <asm/smp.h> | 34 | #include <asm/smp.h> |
@@ -156,7 +156,7 @@ int die_if_no_fixup(const char *str, struct pt_regs *regs, | |||
156 | 156 | ||
157 | case EXCEP_TRAP: | 157 | case EXCEP_TRAP: |
158 | case EXCEP_UNIMPINS: | 158 | case EXCEP_UNIMPINS: |
159 | if (get_user(opcode, (uint8_t __user *)regs->pc) != 0) | 159 | if (probe_kernel_read(&opcode, (u8 *)regs->pc, 1) < 0) |
160 | break; | 160 | break; |
161 | if (opcode == 0xff) { | 161 | if (opcode == 0xff) { |
162 | if (notify_die(DIE_BREAKPOINT, str, regs, code, 0, 0)) | 162 | if (notify_die(DIE_BREAKPOINT, str, regs, code, 0, 0)) |