[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5j+amHGGCxC9PVrCfV8qNchyAyxd225F1rW2o2t=NRogDg@mail.gmail.com>
Date: Sat, 22 Sep 2018 08:46:22 -0700
From: Kees Cook <keescook@...omium.org>
To: Chao Fan <fanc.fnst@...fujitsu.com>
Cc: linux-efi <linux-efi@...r.kernel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, Baoquan He <bhe@...hat.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
indou.takao@...fujitsu.com, caoj.fnst@...fujitsu.com
Subject: Re: [PATCH v7 2/3] x86/boot/KASLR: Walk srat tables to filter
immovable memory
On Thu, Sep 13, 2018 at 3:46 AM, Chao Fan <fanc.fnst@...fujitsu.com> wrote:
> If CONFIG_MEMORY_HOTREMOVE enabled, walk through the acpi srat memory
> tables and store those immovable memory regions so that kaslr can get
> where to choose for randomization.
>
> Signed-off-by: Chao Fan <fanc.fnst@...fujitsu.com>
> ---
> arch/x86/boot/compressed/kaslr.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
> index 9ed9709d9947..0c3567bc231c 100644
> --- a/arch/x86/boot/compressed/kaslr.c
> +++ b/arch/x86/boot/compressed/kaslr.c
> @@ -417,6 +417,11 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
> /* Mark the memmap regions we need to avoid */
> handle_mem_options();
>
> +#ifdef CONFIG_MEMORY_HOTREMOVE
> + /* Mark the immovable regions we need to choose */
> + get_immovable_mem();
> +#endif
Style nit-pick: I'd prefer the definition of get_immovable_mem() do
the ifdef so it doesn't appear here.
-Kees
> +
> #ifdef CONFIG_X86_VERBOSE_BOOTUP
> /* Make sure video RAM can be used. */
> add_identity_map(0, PMD_SIZE);
> --
> 2.17.1
>
>
>
--
Kees Cook
Pixel Security
Powered by blists - more mailing lists