2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Huang Ying <ying.hu...@intel.com>

[ upstream commit 050438ed5a05b25cdf287f5691e56a58c2606997 ]
 preserving context

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....@intel.com>
Signed-off-by: Huang Ying <ying.hu...@intel.com>
Cc: Eric W. Biederman <ebied...@xmission.com>
Cc: Vivek Goyal <vgo...@redhat.com>
Cc: <sta...@kernel.org>
Signed-off-by: Andi Kleen <a...@linux.intel.com>
Link: 
http://lkml.kernel.org/r/1310607277-25029-1-git-send-email-ying.hu...@intel.com
Signed-off-by: Ingo Molnar <mi...@elte.hu>

Index: linux-2.6.35.y/arch/x86/kernel/relocate_kernel_32.S
===================================================================
--- linux-2.6.35.y.orig/arch/x86/kernel/relocate_kernel_32.S
+++ linux-2.6.35.y/arch/x86/kernel/relocate_kernel_32.S
@@ -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
 
Index: linux-2.6.35.y/arch/x86/kernel/relocate_kernel_64.S
===================================================================
--- linux-2.6.35.y.orig/arch/x86/kernel/relocate_kernel_64.S
+++ linux-2.6.35.y/arch/x86/kernel/relocate_kernel_64.S
@@ -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
 

_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to