arm64: efi: invoke EFI_RNG_PROTOCOL to supply KASLR randomness
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 26 Jan 2016 13:48:29 +0000 (14:48 +0100)
committerAlex Shi <alex.shi@linaro.org>
Wed, 11 May 2016 15:21:22 +0000 (23:21 +0800)
commite009472925ee90986397518ef6796e6f8d12e1da
tree9824fe2ca751181a55c733520cd7f45f1324077e
parent4a9c1460b2b904c4a9b6438a14d10c56e0e9ab78
arm64: efi: invoke EFI_RNG_PROTOCOL to supply KASLR randomness

Since arm64 does not use a decompressor that supplies an execution
environment where it is feasible to some extent to provide a source of
randomness, the arm64 KASLR kernel depends on the bootloader to supply
some random bits in the /chosen/kaslr-seed DT property upon kernel entry.

On UEFI systems, we can use the EFI_RNG_PROTOCOL, if supplied, to obtain
some random bits. At the same time, use it to randomize the offset of the
kernel Image in physical memory.

Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 2b5fe07a78a09a32002642b8a823428ade611f16)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/Kconfig
drivers/firmware/efi/libstub/arm-stub.c
drivers/firmware/efi/libstub/arm64-stub.c
drivers/firmware/efi/libstub/fdt.c