From 690eaa53205769fd5c0c36e3aa737a615135f969 Mon Sep 17 00:00:00 2001 From: Chao Fan Date: Wed, 23 Jan 2019 19:08:50 +0800 Subject: 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 Signed-off-by: Borislav Petkov Cc: Ard Biesheuvel Cc: Baoquan He Cc: caoj.fnst@cn.fujitsu.com Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: indou.takao@jp.fujitsu.com Cc: Ingo Molnar Cc: Juergen Gross Cc: kasong@redhat.com Cc: Kees Cook Cc: "Kirill A. Shutemov" Cc: msys.mizuma@gmail.com Cc: Thomas Gleixner Cc: Tom Lendacky Cc: x86-ml Link: https://lkml.kernel.org/r/20190123110850.12433-8-fanc.fnst@cn.fujitsu.com --- arch/x86/boot/compressed/misc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/x86/boot/compressed/misc.h') 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; } -- cgit v1.2.3