arm64: mm: Take potential load offset into account when KASLR is off
authorArd Biesheuvel <ardb@kernel.org>
Wed, 29 Nov 2023 11:15:58 +0000 (12:15 +0100)
committerWill Deacon <will@kernel.org>
Tue, 12 Dec 2023 11:06:27 +0000 (11:06 +0000)
commita22fc8e102dc475e91dc13e6e1e395f4d95ae684
treeaff4d6df8a93cef7e4de6b99a874670651ec9286
parent3dfdc2750c6cdc6a5ebf5effb07f92db761de35d
arm64: mm: Take potential load offset into account when KASLR is off

We enable CONFIG_RELOCATABLE even when CONFIG_RANDOMIZE_BASE is
disabled, and this permits the loader (i.e., EFI) to place the kernel
anywhere in physical memory as long as the base address is 64k aligned.

This means that the 'KASLR' case described in the header that defines
the size of the statically allocated page tables could take effect even
when CONFIG_RANDMIZE_BASE=n. So check for CONFIG_RELOCATABLE instead.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20231129111555.3594833-45-ardb@google.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/kernel-pgtable.h