[PATCH] arm64: head: Ignore bogus KASLR displacement on non-relocatable kernels

Will Deacon will at kernel.org
Thu Sep 1 06:06:30 PDT 2022


On Sat, 27 Aug 2022 09:09:04 +0200, Ard Biesheuvel wrote:
> Even non-KASLR kernels can be built as relocatable, to work around
> broken bootloaders that violate the rules regarding physical placement
> of the kernel image - in this case, the physical offset modulo 2 MiB is
> used as the KASLR offset, and all absolute symbol references are fixed
> up in the usual way. This workaround is enabled by default.
> 
> CONFIG_RELOCATABLE can also be disabled entirely, in which case the
> relocation code and the code that captures the offset are omitted from
> the build. However, since commit aacd149b6238 ("arm64: head: avoid
> relocating the kernel twice for KASLR"), this code got out of sync, and
> we still add the offset to the kernel virtual address before populating
> the page tables even though we never capture it. This means we add a
> bogus value instead, breaking the boot entirely.
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: head: Ignore bogus KASLR displacement on non-relocatable kernels
      https://git.kernel.org/arm64/c/e62b9e6f25fc

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev



More information about the linux-arm-kernel mailing list