efi/libstub: Add limit argument to efi_random_alloc()
authorArd Biesheuvel <ardb@kernel.org>
Mon, 7 Aug 2023 16:27:18 +0000 (18:27 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 7 Aug 2023 19:01:46 +0000 (21:01 +0200)
commitbc5ddceff4c14494d83449ad45c985e6cd353fce
tree4867cffc891dad0cbf9215160e17abdb6ed650b1
parent83381519352d6b5b3e429bf72aaab907480cb6b6
efi/libstub: Add limit argument to efi_random_alloc()

x86 will need to limit the kernel memory allocation to the lowest 512
MiB of memory, to match the behavior of the existing bare metal KASLR
physical randomization logic. So in preparation for that, add a limit
parameter to efi_random_alloc() and wire it up.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230807162720.545787-22-ardb@kernel.org
drivers/firmware/efi/libstub/arm64-stub.c
drivers/firmware/efi/libstub/efistub.h
drivers/firmware/efi/libstub/randomalloc.c
drivers/firmware/efi/libstub/zboot.c