[PATCH] arm64: kaslr: use callee saved register to preserve SCTLR across C call

Catalin Marinas catalin.marinas at arm.com
Thu Mar 24 09:19:37 PDT 2016


On Mon, Mar 21, 2016 at 06:35:11PM +0100, Ard Biesheuvel wrote:
> The KASLR code incorrectly expects the contents of x18 to be preserved
> across a call into C code, and uses it to stash the contents of SCTLR_EL1
> before enabling the MMU. If the MMU needs to be disabled again to create
> the randomized kernel mapping, x18 is written back to SCTLR_EL1, which is
> likely to crash the system if x18 has been clobbered by kasan_early_init()
> or kaslr_early_init(). So use x22 instead, which is not in use so far in
> head.S
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>

Applied. Thanks.

-- 
Catalin



More information about the linux-arm-kernel mailing list