Skip to content
Commit 42dfc43e authored by Siddhesh Poyarekar's avatar Siddhesh Poyarekar Committed by H. Peter Anvin
Browse files

x86_64: Record stack pointer before task execution begins



task->thread.usersp is unusable immediately after a binary is exec()'d
until it undergoes a context switch cycle. The start_thread() function
called during execve() saves the stack pointer into pt_regs and into
old_rsp, but fails to record it into task->thread.usersp.

Because of this, KSTK_ESP(task) returns an incorrect value for a
64-bit program until the task is switched out and back in since
switch_to swaps %rsp values in and out into task->thread.usersp.

Signed-off-by: default avatarSiddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Link: http://lkml.kernel.org/r/1330273075-2949-1-git-send-email-siddhesh.poyarekar@gmail.com


Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent b01543df
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