x86/dumpstack: When OOPSing, rewind the stack before do_exit()
[deliverable/linux.git] / arch / x86 / entry / entry_64.S
index 9ee0da1807edff462536e3628e1db217bb835cd8..b846875aeea6792ce4a0c359f7635112f27e84d5 100644 (file)
@@ -1423,3 +1423,14 @@ ENTRY(ignore_sysret)
        mov     $-ENOSYS, %eax
        sysret
 END(ignore_sysret)
+
+ENTRY(rewind_stack_do_exit)
+       /* Prevent any naive code from trying to unwind to our caller. */
+       xorl    %ebp, %ebp
+
+       movq    PER_CPU_VAR(cpu_current_top_of_stack), %rax
+       leaq    -TOP_OF_KERNEL_STACK_PADDING-PTREGS_SIZE(%rax), %rsp
+
+       call    do_exit
+1:     jmp 1b
+END(rewind_stack_do_exit)
This page took 0.025934 seconds and 5 git commands to generate.