]>
Commit | Line | Data |
---|---|---|
7cb15094 GKH |
1 | From 050438ed5a05b25cdf287f5691e56a58c2606997 Mon Sep 17 00:00:00 2001 |
2 | From: Huang Ying <ying.huang@intel.com> | |
3 | Date: Thu, 14 Jul 2011 09:34:37 +0800 | |
4 | Subject: kexec, x86: Fix incorrect jump back address if not | |
5 | preserving context | |
6 | ||
7 | From: Huang Ying <ying.huang@intel.com> | |
8 | ||
9 | commit 050438ed5a05b25cdf287f5691e56a58c2606997 upstream. | |
10 | ||
11 | In kexec jump support, jump back address passed to the kexeced | |
12 | kernel via function calling ABI, that is, the function call | |
13 | return address is the jump back entry. | |
14 | ||
15 | Furthermore, jump back entry == 0 should be used to signal that | |
16 | the jump back or preserve context is not enabled in the original | |
17 | kernel. | |
18 | ||
19 | But in the current implementation the stack position used for | |
20 | function call return address is not cleared context | |
21 | preservation is disabled. The patch fixes this bug. | |
22 | ||
23 | Reported-and-tested-by: Yin Kangkai <kangkai.yin@intel.com> | |
24 | Signed-off-by: Huang Ying <ying.huang@intel.com> | |
25 | Cc: Eric W. Biederman <ebiederm@xmission.com> | |
26 | Cc: Vivek Goyal <vgoyal@redhat.com> | |
27 | Link: http://lkml.kernel.org/r/1310607277-25029-1-git-send-email-ying.huang@intel.com | |
28 | Signed-off-by: Ingo Molnar <mingo@elte.hu> | |
29 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
30 | ||
31 | --- | |
32 | arch/x86/kernel/relocate_kernel_32.S | 2 ++ | |
33 | arch/x86/kernel/relocate_kernel_64.S | 2 ++ | |
34 | 2 files changed, 4 insertions(+) | |
35 | ||
36 | --- a/arch/x86/kernel/relocate_kernel_32.S | |
37 | +++ b/arch/x86/kernel/relocate_kernel_32.S | |
38 | @@ -97,6 +97,8 @@ relocate_kernel: | |
39 | ret | |
40 | ||
41 | identity_mapped: | |
42 | + /* set return address to 0 if not preserving context */ | |
43 | + pushl $0 | |
44 | /* store the start address on the stack */ | |
45 | pushl %edx | |
46 | ||
47 | --- a/arch/x86/kernel/relocate_kernel_64.S | |
48 | +++ b/arch/x86/kernel/relocate_kernel_64.S | |
49 | @@ -100,6 +100,8 @@ relocate_kernel: | |
50 | ret | |
51 | ||
52 | identity_mapped: | |
53 | + /* set return address to 0 if not preserving context */ | |
54 | + pushq $0 | |
55 | /* store the start address on the stack */ | |
56 | pushq %rdx | |
57 |