diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-29 12:38:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-29 12:38:44 -0400 |
commit | a879cbbb34cbecfa9707fbb6e5a00c503ac1ecb9 (patch) | |
tree | fdf247f8dedea8f04d0989aeab6922ed073eee11 /arch/i386/kernel/entry.S | |
parent | c06fec5022ebe014af876da2df4a0eee836e97c8 (diff) |
x86: make traps on 'iret' be debuggable in user space
This makes a trap on the 'iret' that returns us to user space
cause a nice clean SIGSEGV, instead of just a hard (and silent)
exit.
That way a debugger can actually try to see what happened, and
we also properly notify everybody who might be interested about
us being gone.
This loses the error code, but tells the debugger what happened
with ILL_BADSTK in the siginfo.
Diffstat (limited to 'arch/i386/kernel/entry.S')
-rw-r--r-- | arch/i386/kernel/entry.S | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index 3c73dc865ead..fe1918cc68d1 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S | |||
@@ -260,11 +260,9 @@ restore_nocheck: | |||
260 | .section .fixup,"ax" | 260 | .section .fixup,"ax" |
261 | iret_exc: | 261 | iret_exc: |
262 | sti | 262 | sti |
263 | movl $__USER_DS, %edx | 263 | pushl $0 # no error code |
264 | movl %edx, %ds | 264 | pushl $do_iret_error |
265 | movl %edx, %es | 265 | jmp error_code |
266 | movl $11,%eax | ||
267 | call do_exit | ||
268 | .previous | 266 | .previous |
269 | .section __ex_table,"a" | 267 | .section __ex_table,"a" |
270 | .align 4 | 268 | .align 4 |