]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: kaslr: Adjust the offset to avoid Image across alignment boundary
authorCatalin Marinas <catalin.marinas@arm.com>
Tue, 22 Aug 2017 14:39:00 +0000 (15:39 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 22 Aug 2017 17:15:42 +0000 (18:15 +0100)
commitaf69c4e12abd16ac24dad65426a3ae994cca9c04
treea9a77b734e1d41672784140020add86574b48e08
parent973e709e4a6578ad53867b03c779f52560d504a3
arm64: kaslr: Adjust the offset to avoid Image across alignment boundary

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: c5d3c6eb9d5c ("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: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/kaslr.c