aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/arm64/Kconfig
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2020-06-11 14:43:30 +0200
committerWill Deacon <will@kernel.org>2020-06-11 14:13:13 +0100
commitdd4bc60765873445893037ae73a5f75398a8cd19 (patch)
tree8b0551131f609fcd3ccfa232e49d05f3983510a8 /arch/arm64/Kconfig
parentarm64: acpi: fix UBSAN warning (diff)
downloadwireguard-linux-dd4bc60765873445893037ae73a5f75398a8cd19.tar.xz
wireguard-linux-dd4bc60765873445893037ae73a5f75398a8cd19.zip
arm64: warn on incorrect placement of the kernel by the bootloader
Commit cfa7ede20f133c ("arm64: set TEXT_OFFSET to 0x0 in preparation for removing it entirely") results in boot failures when booting kernels that are built without KASLR support on broken bootloaders that ignore the TEXT_OFFSET value passed via the header, and use the default of 0x80000 instead. To work around this, turn CONFIG_RELOCATABLE on by default, even if KASLR itself (CONFIG_RANDOMIZE_BASE) is turned off, and require CONFIG_EXPERT to be enabled to deviate from this. Then, emit a warning into the kernel log if we are not booting via the EFI stub (which is permitted to deviate from the placement restrictions) and the kernel base address is not placed according to the rules as laid out in Documentation/arm64/booting.rst. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20200611124330.252163-1-ardb@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/Kconfig')
-rw-r--r--arch/arm64/Kconfig3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 63d711001dab..061a72156208 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1746,8 +1746,9 @@ config ARM64_DEBUG_PRIORITY_MASKING
endif
config RELOCATABLE
- bool
+ bool "Build a relocatable kernel image" if EXPERT
select ARCH_HAS_RELR
+ default y
help
This builds the kernel as a Position Independent Executable (PIE),
which retains all relocation metadata required to relocate the