• Catalin Marinas's avatar
    arm64: kaslr: Adjust the offset to avoid Image across alignment boundary · a067d94d
    Catalin Marinas authored
    With 16KB pages and a kernel Image larger than 16MB, the current
    kaslr_early_init() logic for avoiding mappings across swapper table
    boundaries fails since increasing the offset by kimg_sz just moves the
    problem to the next boundary.
    This patch rounds the offset down to (1 << SWAPPER_TABLE_SHIFT) if the
    Image crosses a PMD_SIZE boundary.
    Fixes: afd0e5a8 ("arm64: kaslr: Fix up the kernel image alignment")
    Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Cc: Neeraj Upadhyay <neeraju@codeaurora.org>
    Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
kaslr.c 5.42 KB