All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Kees Cook <keescook@chromium.org>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>,
	X86 ML <x86@kernel.org>, david <david@fromorbit.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	dyoung@redhat.com, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] x86: fix kaslr and memmap collision
Date: Tue, 3 Jan 2017 16:31:37 +0800	[thread overview]
Message-ID: <20170103083137.GA15788@x1> (raw)
In-Reply-To: <CAPcyv4i+2NxdTc1xzVL+KQs8hLfUhbpGX3zstO_b=RY3hCy64w@mail.gmail.com>

Hi Dan,

On 11/22/16 at 09:26am, Dan Williams wrote:
> [ replying for Dave since he's offline today and tomorrow ]
> 
> On Tue, Nov 22, 2016 at 12:47 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Dave Jiang <dave.jiang@intel.com> wrote:
> >
> >> CONFIG_RANDOMIZE_BASE relocates the kernel to a random base address.
> >> However it does not take into account the memmap= parameter passed in from
> >> the kernel commandline.
> >
> > memmap= parameters are often used as a list.
> >
> >> [...] This results in the kernel sometimes being put in the middle of the user
> >> memmap. [...]
> >
> > What does this mean? If memmap= is used to re-define the memory map then the
> > kernel getting in the middle of a RAM area is what we want, isn't it? What we
> > don't want is for the kernel to get into reserved areas, right?
> 
> Right, this is about teaching kaslr to not land the kernel in newly
> defined reserved regions that were not marked reserved in the initial
> e820 map from platform firmware.

If only tell kaslr to not land kernel in newly defined reserved regions,
memory added by "memmap=nn[KMG]@ss[KMG]" should not be avoided since
it's usable memory. Kernel randomized into this region is also what we
want. Not sure if I understand it right.

Thanks
Baoquan
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

WARNING: multiple messages have this Message-ID (diff)
From: Baoquan He <bhe@redhat.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>, Dave Jiang <dave.jiang@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	X86 ML <x86@kernel.org>, david <david@fromorbit.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>,
	Kees Cook <keescook@chromium.org>,
	dyoung@redhat.com
Subject: Re: [PATCH] x86: fix kaslr and memmap collision
Date: Tue, 3 Jan 2017 16:31:37 +0800	[thread overview]
Message-ID: <20170103083137.GA15788@x1> (raw)
In-Reply-To: <CAPcyv4i+2NxdTc1xzVL+KQs8hLfUhbpGX3zstO_b=RY3hCy64w@mail.gmail.com>

Hi Dan,

On 11/22/16 at 09:26am, Dan Williams wrote:
> [ replying for Dave since he's offline today and tomorrow ]
> 
> On Tue, Nov 22, 2016 at 12:47 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Dave Jiang <dave.jiang@intel.com> wrote:
> >
> >> CONFIG_RANDOMIZE_BASE relocates the kernel to a random base address.
> >> However it does not take into account the memmap= parameter passed in from
> >> the kernel commandline.
> >
> > memmap= parameters are often used as a list.
> >
> >> [...] This results in the kernel sometimes being put in the middle of the user
> >> memmap. [...]
> >
> > What does this mean? If memmap= is used to re-define the memory map then the
> > kernel getting in the middle of a RAM area is what we want, isn't it? What we
> > don't want is for the kernel to get into reserved areas, right?
> 
> Right, this is about teaching kaslr to not land the kernel in newly
> defined reserved regions that were not marked reserved in the initial
> e820 map from platform firmware.

If only tell kaslr to not land kernel in newly defined reserved regions,
memory added by "memmap=nn[KMG]@ss[KMG]" should not be avoided since
it's usable memory. Kernel randomized into this region is also what we
want. Not sure if I understand it right.

Thanks
Baoquan

  parent reply	other threads:[~2017-01-03  8:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22  0:22 [PATCH] x86: fix kaslr and memmap collision Dave Jiang
2016-11-22  0:22 ` Dave Jiang
2016-11-22  8:47 ` Ingo Molnar
2016-11-22  8:47   ` Ingo Molnar
2016-11-22 17:26   ` Dan Williams
2016-11-22 17:26     ` Dan Williams
2016-11-22 18:54     ` Kees Cook
2016-11-22 18:54       ` Kees Cook
2016-11-22 19:01       ` Dan Williams
2016-11-22 19:01         ` Dan Williams
2016-11-22 22:37         ` Kees Cook
2016-11-22 22:37           ` Kees Cook
2016-11-24  0:04         ` Dave Chinner
2016-11-24  0:04           ` Dave Chinner
2016-11-24 19:30           ` Dan Williams
2016-11-24 19:30             ` Dan Williams
2017-01-03  8:31     ` Baoquan He [this message]
2017-01-03  8:31       ` Baoquan He
2017-01-03 16:27       ` Ross Zwisler
2017-01-03 16:27         ` Ross Zwisler
2017-01-03 18:24       ` Dan Williams
2017-01-03 18:24         ` Dan Williams
2017-01-03 20:15         ` Dave Jiang
2017-01-03 20:15           ` Dave Jiang
2017-01-04  1:57           ` Baoquan He
2017-01-04  1:57             ` Baoquan He

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=20170103083137.GA15788@x1 \
    --to=bhe@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=david@fromorbit.com \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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.