[PATCH 0/2] arm64: use XN table mappings for the linear region

Ard Biesheuvel ardb at kernel.org
Thu Mar 4 17:11:43 GMT 2021


This patch tweaks the kernel page table population code to set the UXNTable
and PXNTable bits on all table entries that cover the linear region. This
removes the ability for lower level mappings to grant executable permissions
which are never needed in the linear region. And given that swapper's PGD
level is mapped r/o and can only be updated via the fixmap API, this cannot
be trivially reverted by poking writable memory.

This does not address a known exploit or vulnerability, but it applies the
principle of least privilege in a way that does not result in any space
or runtime overhead.

Cc: maz at kernel.org
Cc: catalin.marinas at arm.com
Cc: will at kernel.org
Cc: mark.rutland at arm.com
Cc: anshuman.khandual at arm.com
Cc: qperret at google.com
Cc: kernel-team at android.com

Ard Biesheuvel (2):
  arm64: mm: add missing P4D definitions and use them consistently
  arm64: mm: use XN table mapping attributes for the linear region

 arch/arm64/include/asm/pgtable-hwdef.h | 12 ++++++++
 arch/arm64/mm/mmu.c                    | 31 ++++++++++++++------
 2 files changed, 34 insertions(+), 9 deletions(-)

-- 
2.20.1




More information about the linux-arm-kernel mailing list