diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-04-18 17:09:48 +0200 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-04-28 19:44:15 +0100 |
commit | 6f26b3671184c36d07eb5d61ba9a6d0aeb583c5d (patch) | |
tree | 97f3fe9aee28cce11f4620ca6624aa0a982d2fb8 /arch | |
parent | 99a507771fa57238dc7ffe674ae06090333d02c9 (diff) | |
download | op-kernel-dev-6f26b3671184c36d07eb5d61ba9a6d0aeb583c5d.zip op-kernel-dev-6f26b3671184c36d07eb5d61ba9a6d0aeb583c5d.tar.gz |
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>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions