Skip to content

Commit

Permalink
kexec, x86: Fix incorrect jump back address if not preserving context
Browse files Browse the repository at this point in the history
In kexec jump support, jump back address passed to the kexeced
kernel via function calling ABI, that is, the function call
return address is the jump back entry.

Furthermore, jump back entry == 0 should be used to signal that
the jump back or preserve context is not enabled in the original
kernel.

But in the current implementation the stack position used for
function call return address is not cleared context
preservation is disabled. The patch fixes this bug.

Reported-and-tested-by: Yin Kangkai <kangkai.yin@intel.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: <stable@kernel.org>
Link: http://lkml.kernel.org/r/1310607277-25029-1-git-send-email-ying.huang@intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Huang Ying authored and Ingo Molnar committed Jul 21, 2011
1 parent cf6ace1 commit 050438e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/kernel/relocate_kernel_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ relocate_kernel:
ret

identity_mapped:
/* set return address to 0 if not preserving context */
pushl $0
/* store the start address on the stack */
pushl %edx

Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/relocate_kernel_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ relocate_kernel:
ret

identity_mapped:
/* set return address to 0 if not preserving context */
pushq $0
/* store the start address on the stack */
pushq %rdx

Expand Down

0 comments on commit 050438e

Please sign in to comment.