linux_dsm_epyc7002/drivers/firmware/efi/libstub
Ard Biesheuvel 6f26b36711 arm64: kaslr: increase randomization granularity
Currently, our KASLR implementation randomizes the placement of the core
kernel at 2 MB granularity. This is based on the arm64 kernel boot
protocol, which mandates that the kernel is loaded TEXT_OFFSET bytes above
a 2 MB aligned base address. This requirement is a result of the fact that
the block size used by the early mapping code may be 2 MB at the most (for
a 4 KB granule kernel)

But we can do better than that: since a KASLR kernel needs to be relocated
in any case, we can tolerate a physical misalignment as long as the virtual
misalignment relative to this 2 MB block size is equal in size, and code to
deal with this is already in place.

Since we align the kernel segments to 64 KB, let's randomize the physical
offset at 64 KB granularity as well (unless CONFIG_DEBUG_ALIGN_RODATA is
enabled). This way, the page table and TLB footprint is not affected.

The higher granularity allows for 5 bits of additional entropy to be used.

Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2016-04-28 19:44:15 +01:00
..
arm32-stub.c efi/arm: Check for LPAE support before booting a LPAE kernel 2016-02-22 08:26:27 +01:00
arm64-stub.c arm64: kaslr: increase randomization granularity 2016-04-28 19:44:15 +01:00
arm-stub.c Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-20 18:58:18 -07:00
efi-stub-helper.c efi: stub: use high allocation for converted command line 2016-02-24 14:57:28 +00:00
efistub.h Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-20 18:58:18 -07:00
fdt.c efi: ARM/arm64: ignore DT memory nodes instead of removing them 2016-04-15 18:06:07 +01:00
Makefile kernel: add kcov code coverage 2016-03-22 15:36:02 -07:00
random.c efi: stub: add implementation of efi_random_alloc() 2016-02-24 14:57:28 +00:00
string.c arm64/efi: isolate EFI stub from the kernel proper 2015-10-12 16:20:12 +01:00