From: Huang Ying <ying.huang@intel.com>
To: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Vivek Goyal <vgoyal@redhat.com>
Cc: linux-kernel@vger.kernel.org, Huang Ying <ying.huang@intel.com>
Subject: [BUGFIX] kexec, x86, Fix incorrect jump back address if not preserve context
Date: Thu, 14 Jul 2011 09:34:37 +0800 [thread overview]
Message-ID: <1310607277-25029-1-git-send-email-ying.huang@intel.com> (raw)
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. And jump back entry == 0 should be used to
signal that jump back or preserve context is not enabled in original
kernel. But in original implementation, the stack position used for
function call return address is not cleared if preserve context is
disabled. The patch fixes this issue.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Reported-and-tested-by: Yin Kangkai <kangkai.yin@intel.com>
---
arch/x86/kernel/relocate_kernel_32.S | 2 ++
arch/x86/kernel/relocate_kernel_64.S | 2 ++
2 files changed, 4 insertions(+)
--- a/arch/x86/kernel/relocate_kernel_32.S
+++ b/arch/x86/kernel/relocate_kernel_32.S
@@ -97,6 +97,8 @@ relocate_kernel:
ret
identity_mapped:
+ /* set return address as 0 if not preserve context */
+ pushl $0
/* store the start address on the stack */
pushl %edx
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -100,6 +100,8 @@ relocate_kernel:
ret
identity_mapped:
+ /* set return address as 0 if not preserve context */
+ pushq $0
/* store the start address on the stack */
pushq %rdx
reply other threads:[~2011-07-14 1:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310607277-25029-1-git-send-email-ying.huang@intel.com \
--to=ying.huang@intel.com \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®