[PATCH v3 2/3] arm64: mm: use XN table mapping attributes for the linear region

Anshuman Khandual anshuman.khandual at arm.com
Wed Mar 10 11:35:37 GMT 2021



On 3/10/21 4:19 PM, Ard Biesheuvel wrote:
> The way the arm64 kernel virtual address space is constructed guarantees
> that swapper PGD entries are never shared between the linear region on
> the one hand, and the vmalloc region on the other, which is where all
> kernel text, module text and BPF text mappings reside.
> 
> This means that mappings in the linear region (which never require
> executable permissions) never share any table entries at any level with
> mappings that do require executable permissions, and so we can set the
> table-level PXN attributes for all table entries that are created while
> setting up mappings in the linear region. Since swapper's PGD level page
> table is mapped r/o itself, this adds another layer of robustness to the
> way the kernel manages its own page tables. While at it, set the UXN
> attribute as well for all kernel mappings created at boot.
> 
> Acked-by: Mark Rutland <mark.rutland at arm.com>
> Signed-off-by: Ard Biesheuvel <ardb at kernel.org>

LGTM, thanks for adding those comments.

Reviewed-by: Anshuman Khandual <anshuman.khandual at arm.com>



More information about the linux-arm-kernel mailing list