Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: kexec@lists.infradead.org, Dave Young <dyoung@redhat.com>,
	WANG Chao <chaowang@redhat.com>
Subject: Re: [kexec-tools PATCH v2] x86, kaslr: add alternative way to locate kernel text mapping area
Date: Fri, 28 Mar 2014 09:44:20 -0700	[thread overview]
Message-ID: <20140328164420.GC3745@verge.net.au> (raw)
In-Reply-To: <20140328140522.GF2089@redhat.com>

On Fri, Mar 28, 2014 at 10:05:22AM -0400, Vivek Goyal wrote:
> On Fri, Mar 28, 2014 at 03:05:00PM +0800, WANG Chao wrote:
> > When kASLR is enabled (CONFIG_RANDOMIZED_BASE=y), kernel text mapping
> > base is randomized. The max base offset of such randomization is
> > configured at compile time through CONFIG_RANDOMIZE_MAX_BASE_OFFSET (by
> > default 1G).
> > 
> > Currently kexec-tools is using hard code macro X86_64__START_KERNEL_map
> > (0xffffffff80000000) and X86_64_KERNEL_TEXT_SIZE (512M) to determine
> > kernel text mapping from kcore's PT_LOAD. With kASLR, the mapping is
> > changed as the following:
> > 
> > ffffffff80000000 - (ffffffff80000000+CONFIG_RANDOMIZE_BASE_MAX_OFFSET)
> > 
> > As Vivek suggested, we can get _stext kernel symbol address from
> > /proc/kallsyms, and search for kcore's PT_LOAD which contains _stext,
> > and we can say that this area represents the kernel mapping area.
> > 
> > Let's first use this way to find out kernel text mapping. If failed for
> > whatever reason, fall back to use the old way.
> > 
> > Suggested-by: Vivek Goyal <vgoyal@redhat.com>
> > Signed-off-by: WANG Chao <chaowang@redhat.com>
> 
> Looks good to me.
> 
> Acked-by: Vivek Goyal <vgoyal@redhat.com>

Thanks, applied.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2014-03-28 16:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28  7:05 [kexec-tools PATCH v2] x86, kaslr: add alternative way to locate kernel text mapping area WANG Chao
2014-03-28 14:05 ` Vivek Goyal
2014-03-28 16:44   ` Simon Horman [this message]

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=20140328164420.GC3745@verge.net.au \
    --to=horms@verge.net.au \
    --cc=chaowang@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=kexec@lists.infradead.org \
    --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