diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-10 21:35:42 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-12 13:35:22 -0400 |
commit | 22e2430d60dbdfcdd732a086e9ef2dbd74c266d1 (patch) | |
tree | 687067fcaf2761015639178033ee16c8511703b8 /arch/x86/kernel/entry_32.S | |
parent | a74fb73c12398b250fdc5e333a11e15a9e3a84fc (diff) |
x86, um: convert to saner kernel_execve() semantics
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/x86/kernel/entry_32.S')
-rw-r--r-- | arch/x86/kernel/entry_32.S | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index fe4cc305d8da..91d295908c30 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -298,12 +298,20 @@ ENTRY(ret_from_fork) | |||
298 | CFI_ENDPROC | 298 | CFI_ENDPROC |
299 | END(ret_from_fork) | 299 | END(ret_from_fork) |
300 | 300 | ||
301 | ENTRY(ret_from_kernel_execve) | 301 | ENTRY(ret_from_kernel_thread) |
302 | movl %eax, %esp | 302 | CFI_STARTPROC |
303 | movl $0,PT_EAX(%esp) | 303 | pushl_cfi %eax |
304 | call schedule_tail | ||
304 | GET_THREAD_INFO(%ebp) | 305 | GET_THREAD_INFO(%ebp) |
306 | popl_cfi %eax | ||
307 | pushl_cfi $0x0202 # Reset kernel eflags | ||
308 | popfl_cfi | ||
309 | movl PT_EBP(%esp),%eax | ||
310 | call *PT_EBX(%esp) | ||
311 | movl $0,PT_EAX(%esp) | ||
305 | jmp syscall_exit | 312 | jmp syscall_exit |
306 | END(ret_from_kernel_execve) | 313 | CFI_ENDPROC |
314 | ENDPROC(ret_from_kernel_thread) | ||
307 | 315 | ||
308 | /* | 316 | /* |
309 | * Interrupt exit functions should be protected against kprobes | 317 | * Interrupt exit functions should be protected against kprobes |
@@ -994,21 +1002,6 @@ END(spurious_interrupt_bug) | |||
994 | */ | 1002 | */ |
995 | .popsection | 1003 | .popsection |
996 | 1004 | ||
997 | ENTRY(ret_from_kernel_thread) | ||
998 | CFI_STARTPROC | ||
999 | pushl_cfi %eax | ||
1000 | call schedule_tail | ||
1001 | GET_THREAD_INFO(%ebp) | ||
1002 | popl_cfi %eax | ||
1003 | pushl_cfi $0x0202 # Reset kernel eflags | ||
1004 | popfl_cfi | ||
1005 | movl PT_EBP(%esp),%eax | ||
1006 | call *PT_EBX(%esp) | ||
1007 | call do_exit | ||
1008 | ud2 # padding for call trace | ||
1009 | CFI_ENDPROC | ||
1010 | ENDPROC(ret_from_kernel_thread) | ||
1011 | |||
1012 | #ifdef CONFIG_XEN | 1005 | #ifdef CONFIG_XEN |
1013 | /* Xen doesn't set %esp to be precisely what the normal sysenter | 1006 | /* Xen doesn't set %esp to be precisely what the normal sysenter |
1014 | entrypoint expects, so fix it up before using the normal path. */ | 1007 | entrypoint expects, so fix it up before using the normal path. */ |