Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: Enable KASLR by default

KASLR is mature (and important) enough to be enabled by default on x86.

Also enable it by default in the defconfigs.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: dan.j.williams@intel.com
Cc: dave.jiang@intel.com
Cc: dyoung@redhat.com
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

+7 -3
+3 -3
arch/x86/Kconfig
··· 1966 1966 config RANDOMIZE_BASE 1967 1967 bool "Randomize the address of the kernel image (KASLR)" 1968 1968 depends on RELOCATABLE 1969 - default n 1969 + default y 1970 1970 ---help--- 1971 1971 In support of Kernel Address Space Layout Randomization (KASLR), 1972 1972 this randomizes the physical address at which the kernel image ··· 1996 1996 theoretically possible, but the implementations are further 1997 1997 limited due to memory layouts. 1998 1998 1999 - If unsure, say N. 1999 + If unsure, say Y. 2000 2000 2001 2001 # Relocation on x86 needs some additional build support 2002 2002 config X86_NEED_RELOCS ··· 2045 2045 configuration have in average 30,000 different possible virtual 2046 2046 addresses for each memory section. 2047 2047 2048 - If unsure, say N. 2048 + If unsure, say Y. 2049 2049 2050 2050 config RANDOMIZE_MEMORY_PHYSICAL_PADDING 2051 2051 hex "Physical memory mapping padding" if EXPERT
+2
arch/x86/configs/i386_defconfig
··· 57 57 CONFIG_HZ_1000=y 58 58 CONFIG_KEXEC=y 59 59 CONFIG_CRASH_DUMP=y 60 + CONFIG_RANDOMIZE_BASE=y 61 + CONFIG_RANDOMIZE_MEMORY=y 60 62 # CONFIG_COMPAT_VDSO is not set 61 63 CONFIG_HIBERNATION=y 62 64 CONFIG_PM_DEBUG=y
+2
arch/x86/configs/x86_64_defconfig
··· 55 55 CONFIG_HZ_1000=y 56 56 CONFIG_KEXEC=y 57 57 CONFIG_CRASH_DUMP=y 58 + CONFIG_RANDOMIZE_BASE=y 59 + CONFIG_RANDOMIZE_MEMORY=y 58 60 # CONFIG_COMPAT_VDSO is not set 59 61 CONFIG_HIBERNATION=y 60 62 CONFIG_PM_DEBUG=y