[PATCH v6 2/9] arm64: kaslr: don't pretend KASLR is enabled if offset < MIN_KIMG_ALIGN

Mark Brown broonie at kernel.org
Fri Jul 1 07:12:44 PDT 2022


On Fri, Jul 01, 2022 at 03:04:37PM +0200, Ard Biesheuvel wrote:
> Our virtual KASLR displacement consists of a fully randomized multiple
> of 2 MiB, combined with an offset that is equal to the physical
> placement modulo 2 MiB. This arrangement ensures that we can always use
> 2 MiB block mappings (or contiguous PTE mappings for 16k or 64k pages)
> to map the kernel.
> 
> This means that a KASLR offset of less than 2 MiB is simply the product
> of this physical displacement, and no randomization has actually taken
> place. So let's avoid misreporting this case as 'KASLR enabled'.

Might be worth backporting to stable?  Though the consequence is
just that we might enable KPTI when we don't *need* it which is
not the end of the world.

Reviewed-by: Mark Brown <broonie at kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220701/d494c32d/attachment-0001.sig>


More information about the linux-arm-kernel mailing list