HomeFreeBSD

Teach vm.pmap.kernel_maps about both XN bits

Description

Teach vm.pmap.kernel_maps about both XN bits

The arm64 vm.pmap.kernel_maps sysctl would only check the kernel XN bit
when printing the kernel mapping. It can also be useful to check none
of the mappings allow userspace to execute from a given virtual address.
To check for this add the user XN bit when getting the kernel maps.

While here fix the ATTR_S1_AP_USER check to use ATTR_S1_AP to shift the
value to the correct offset.

Reviewed by: kib (earlier version), markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33304

(cherry picked from commit 38dbca724335fec679e79b72d91a8e36b2624fe1)

Details

Provenance
andrewAuthored on Dec 6 2021, 1:08 PM
Reviewer
kib
Differential Revision
D33304: Teach vm.pmap.kernel_maps about both XN bits
Parents
rG28e0603813cd: Don't fail changing props for unmapped DMAP memory
Branches
Unknown
Tags
Unknown