From a879cbbb34cbecfa9707fbb6e5a00c503ac1ecb9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 29 Apr 2005 09:38:44 -0700 Subject: 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. --- arch/i386/kernel/entry.S | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'arch/i386/kernel/entry.S') diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index 3c73dc865ea..fe1918cc68d 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S @@ -260,11 +260,9 @@ restore_nocheck: .section .fixup,"ax" iret_exc: sti - movl $__USER_DS, %edx - movl %edx, %ds - movl %edx, %es - movl $11,%eax - call do_exit + pushl $0 # no error code + pushl $do_iret_error + jmp error_code .previous .section __ex_table,"a" .align 4 -- cgit v1.2.3