mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dou Liyang <douly.fnst@cn.fujitsu.com>
To: Ingo Molnar <mingo@kernel.org>, Baoquan He <bhe@redhat.com>,
	Chao Fan <fanc.fnst@cn.fujitsu.com>, <keescook@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	<linux-kernel@vger.kernel.org>, <x86@kernel.org>, <hpa@zytor.com>,
	<tglx@linutronix.de>, <mingo@redhat.com>,
	<yasu.isimatu@gmail.com>, <indou.takao@jp.fujitsu.com>,
	<lcapitulino@redhat.com>
Subject: Re: [PATCH v9 0/5] x86/KASLR: Add parameter kaslr_boot_mem=nn[KMG]@ss[KMG]
Date: Thu, 29 Mar 2018 09:47:04 +0800	[thread overview]
Message-ID: <e62ca2ec-a563-2f86-71f3-9eac698cf3ad@cn.fujitsu.com> (raw)
In-Reply-To: <20180312105727.mzrtjvnyxgyz7jn7@gmail.com>

Hi Ingo, Kees, Baoquan and Chao

At 03/12/2018 06:57 PM, Ingo Molnar wrote:
[...]
> So there's apparently a mis-design here:
> 
>   - KASLR needs to be done very early on during bootup: - it's not realistic to
>     expect KASLR to be done with a booted up kernel, because pointers to various
>     KASLR-ed objects are already widely spread out in memory.
> 
>   - But for some unfathomable reason the memory hotplug attribute of memory
>     regions is not part of the regular memory map but part of late-init ACPI data
>     structures.
> 
> The right solution would be _not_ to fudge the KASLR location, but to provide the
> memory hotplug information to early code, preferably via the primary memory map.
> KASLR can then make use of it and avoid those regions, just like it avoids other
> memory regions already.
> 
> In addition to that hardware makers (including virtualized hardware) should also
> fix their systems to provide memory hotplug information to early code.
> 

Yes, but before this, can we fix this problem by the following patch 
which has been sent and reviewed by Kees before[1]. its solution is:

   Extend movable_node option to restrict kernel to be randomized in
   immovable nodes by adding a parameter. this parameter sets up
   the boundaries between the home nodes and other nodes.

My reason is here:

   - What we really want to solve is the KASLR breaks *physical Node
     hotplug*, Keep the decompressed kernel in an immovable node is
     enough.

   - AFAICS, there are not too many systems where physical Node hotplug
     actually works in practice, and there mush be one node called *home
     node* which is immovable for storing basic information.

   - the node in modern systems could have double-digit gigabytes memory,
     It can completely satisfy the operation of KASLR.

So, Just restrict kernel to be randomized in the home node, and ignore
other nodes when kernel has the *movable_node* option in the command
line.

Thoughts? may I rebase and resend the patch?

[1] https://lkml.org/lkml/2017/8/3/401

Thanks,

	dou

      parent reply	other threads:[~2018-03-29  1:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28 10:51 Chao Fan
2018-02-28 10:51 ` [PATCH v9 1/5] x86/KASLR: Add kaslr_boot_mem=nn[KMG]@ss[KMG] Chao Fan
2018-02-28 10:51 ` [PATCH v9 2/5] x86/KASLR: Handle the memory regions specified in kaslr_boot_mem Chao Fan
2018-02-28 10:51 ` [PATCH v9 3/5] x86/KASLR: Give a warning if movable_node specified without kaslr_boot_mem= Chao Fan
2018-02-28 10:51 ` [PATCH v9 4/5] x86/KASLR: Skip memory mirror handling if movable_node specified Chao Fan
2018-02-28 10:51 ` [PATCH v9 5/5] document: add document for kaslr_boot_mem Chao Fan
2018-03-12  9:35 ` [PATCH v9 0/5] x86/KASLR: Add parameter kaslr_boot_mem=nn[KMG]@ss[KMG] Ingo Molnar
2018-03-12 10:10   ` Baoquan He
2018-03-12 10:57     ` Ingo Molnar
2018-03-12 12:04       ` Chao Fan
2018-03-13 14:02         ` Baoquan He
2018-03-19  7:24         ` Baoquan He
2018-03-19  8:17           ` Chao Fan
2018-03-29  1:47       ` Dou Liyang [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=e62ca2ec-a563-2f86-71f3-9eac698cf3ad@cn.fujitsu.com \
    --to=douly.fnst@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=fanc.fnst@cn.fujitsu.com \
    --cc=hpa@zytor.com \
    --cc=indou.takao@jp.fujitsu.com \
    --cc=keescook@chromium.org \
    --cc=lcapitulino@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yasu.isimatu@gmail.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®