diff options
author | Chao Fan <fanc.fnst@cn.fujitsu.com> | 2019-01-23 19:08:50 +0800 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2019-02-01 11:52:55 +0100 |
commit | 690eaa53205769fd5c0c36e3aa737a615135f969 (patch) | |
tree | bb342da71caa5b79ddffda9957fffad92925be7a /arch/x86/boot/compressed/misc.h | |
parent | 02a3e3cdb7f12fb8589e4a2e85d23c9e6544b54a (diff) |
x86/boot/KASLR: Limit KASLR to extract the kernel in immovable memory only
KASLR may randomly choose a range which is located in movable memory
regions. As a result, this will break memory hotplug and make the
movable memory chosen by KASLR immovable.
Therefore, limit KASLR to choose memory regions in the immovable range
after consulting the SRAT table.
[ bp:
- Rewrite commit message.
- Trim comments.
]
Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: caoj.fnst@cn.fujitsu.com
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: indou.takao@jp.fujitsu.com
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: kasong@redhat.com
Cc: Kees Cook <keescook@chromium.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: msys.mizuma@gmail.com
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190123110850.12433-8-fanc.fnst@cn.fujitsu.com
Diffstat (limited to 'arch/x86/boot/compressed/misc.h')
-rw-r--r-- | arch/x86/boot/compressed/misc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h index 9911d11c5d09..19e8231a6fd6 100644 --- a/arch/x86/boot/compressed/misc.h +++ b/arch/x86/boot/compressed/misc.h @@ -132,6 +132,7 @@ static inline acpi_physical_address get_rsdp_addr(void) { return 0; } #endif #if defined(CONFIG_RANDOMIZE_BASE) && defined(CONFIG_MEMORY_HOTREMOVE) +extern struct mem_vector immovable_mem[MAX_NUMNODES*2]; int count_immovable_mem_regions(void); #else static inline int count_immovable_mem_regions(void) { return 0; } |