From: Vivek Goyal <vgoyal@redhat.com>
To: Huang Ying <ying.huang@intel.com>
Cc: nigel@nigel.suspend2.net,
Kexec Mailing List <kexec@lists.infradead.org>,
linux-kernel@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Machek <pavel@ucw.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
mingo@elte.hu
Subject: Re: [PATCH 2/6] kexec jump: check code size in control page
Date: Thu, 7 Aug 2008 09:15:57 -0400 [thread overview]
Message-ID: <20080807131557.GB27783@redhat.com> (raw)
In-Reply-To: <1218099926.5164.33.camel@caritas-dev.intel.com>
On Thu, Aug 07, 2008 at 05:05:26PM +0800, Huang Ying wrote:
> Kexec/Kexec-jump requires code size in control page is less than
> PAGE_SIZE/2. This patch adds runtime checking for this.
>
> Signed-off-by: Huang Ying <ying.huang@intel.com>
>
> ---
> arch/x86/kernel/machine_kexec_32.c | 4 ++++
> arch/x86/kernel/relocate_kernel_32.S | 3 +++
> include/asm-x86/kexec.h | 1 +
> 3 files changed, 8 insertions(+)
>
> --- a/arch/x86/kernel/machine_kexec_32.c
> +++ b/arch/x86/kernel/machine_kexec_32.c
> @@ -92,6 +92,10 @@ int machine_kexec_prepare(struct kimage
> {
> if (nx_enabled)
> set_pages_x(image->control_code_page, 1);
> +
> + BUG_ON((unsigned long)kexec_control_page_code_end - \
> + (unsigned long)relocate_kernel >= PAGE_SIZE/2);
> +
Hi Huang,
Run time check is better than nothing but I think in this case it would
be better if we can catch it at compile time.
One of the methods will be to write a small program of your own and
put in script/ and at build time check for the size and flag error. May
be there are other better ways to do this.
Thanks
Vivek
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Vivek Goyal <vgoyal@redhat.com>
To: Huang Ying <ying.huang@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Machek <pavel@ucw.cz>,
nigel@nigel.suspend2.net, "Rafael J. Wysocki" <rjw@sisk.pl>,
Andrew Morton <akpm@linux-foundation.org>,
mingo@elte.hu, Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Kexec Mailing List <kexec@lists.infradead.org>
Subject: Re: [PATCH 2/6] kexec jump: check code size in control page
Date: Thu, 7 Aug 2008 09:15:57 -0400 [thread overview]
Message-ID: <20080807131557.GB27783@redhat.com> (raw)
In-Reply-To: <1218099926.5164.33.camel@caritas-dev.intel.com>
On Thu, Aug 07, 2008 at 05:05:26PM +0800, Huang Ying wrote:
> Kexec/Kexec-jump requires code size in control page is less than
> PAGE_SIZE/2. This patch adds runtime checking for this.
>
> Signed-off-by: Huang Ying <ying.huang@intel.com>
>
> ---
> arch/x86/kernel/machine_kexec_32.c | 4 ++++
> arch/x86/kernel/relocate_kernel_32.S | 3 +++
> include/asm-x86/kexec.h | 1 +
> 3 files changed, 8 insertions(+)
>
> --- a/arch/x86/kernel/machine_kexec_32.c
> +++ b/arch/x86/kernel/machine_kexec_32.c
> @@ -92,6 +92,10 @@ int machine_kexec_prepare(struct kimage
> {
> if (nx_enabled)
> set_pages_x(image->control_code_page, 1);
> +
> + BUG_ON((unsigned long)kexec_control_page_code_end - \
> + (unsigned long)relocate_kernel >= PAGE_SIZE/2);
> +
Hi Huang,
Run time check is better than nothing but I think in this case it would
be better if we can catch it at compile time.
One of the methods will be to write a small program of your own and
put in script/ and at build time check for the size and flag error. May
be there are other better ways to do this.
Thanks
Vivek
next prev parent reply other threads:[~2008-08-07 13:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-07 9:05 [PATCH 2/6] kexec jump: check code size in control page Huang Ying
2008-08-07 9:05 ` Huang Ying
2008-08-07 9:21 ` Pavel Machek
2008-08-07 9:21 ` Pavel Machek
2008-08-07 13:15 ` Vivek Goyal [this message]
2008-08-07 13:15 ` Vivek Goyal
2008-08-07 20:31 ` Pavel Machek
2008-08-07 20:31 ` Pavel Machek
2008-08-08 2:44 ` Huang Ying
2008-08-08 2:44 ` Huang Ying
2008-08-08 13:52 ` Vivek Goyal
2008-08-08 13:52 ` Vivek Goyal
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=20080807131557.GB27783@redhat.com \
--to=vgoyal@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nigel@nigel.suspend2.net \
--cc=pavel@ucw.cz \
--cc=rjw@sisk.pl \
--cc=torvalds@linux-foundation.org \
--cc=ying.huang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.