Commit 3aa4b37d authored by Roland McGrath's avatar Roland McGrath Committed by Ingo Molnar

x86: make traps on entry code be debuggable in user space, 64-bit

Unify the x86-64 behavior for 32-bit processes that set
bogus %cs/%ss values (the only ones that can fault in iret)
match what the native i386 behavior is. (do not kill the task
via do_exit but generate a SIGSEGV signal)

[ tglx@linutronix.de: build fix ]
Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 551e4fb2
...@@ -593,13 +593,22 @@ ENTRY(native_iret) ...@@ -593,13 +593,22 @@ ENTRY(native_iret)
.quad native_iret, bad_iret .quad native_iret, bad_iret
.previous .previous
.section .fixup,"ax" .section .fixup,"ax"
/* force a signal here? this matches i386 behaviour */
/* running with kernel gs */
bad_iret: bad_iret:
movq $11,%rdi /* SIGSEGV */ /*
TRACE_IRQS_ON * The iret traps when the %cs or %ss being restored is bogus.
ENABLE_INTERRUPTS(CLBR_ANY | ~(CLBR_RDI)) * We've lost the original trap vector and error code.
jmp do_exit * #GPF is the most likely one to get for an invalid selector.
* So pretend we completed the iret and took the #GPF in user mode.
*
* We are now running with the kernel GS after exception recovery.
* But error_entry expects us to have user GS to match the user %cs,
* so swap back.
*/
pushq $0
SWAPGS
jmp general_protection
.previous .previous
/* edi: workmask, edx: work */ /* edi: workmask, edx: work */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment