Page MenuHomeFreeBSD

arm64: Mark EFI memory as userspace non-executable
ClosedPublic

Authored by andrew on Sep 26 2025, 11:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 18, 5:03 AM
Unknown Object (File)
Mon, May 11, 12:28 PM
Unknown Object (File)
Mon, May 11, 9:06 AM
Unknown Object (File)
Mon, May 11, 4:49 AM
Unknown Object (File)
Sun, May 10, 10:55 PM
Unknown Object (File)
Fri, May 8, 10:05 AM
Unknown Object (File)
Tue, Apr 28, 5:53 AM
Unknown Object (File)
Tue, Apr 28, 4:02 AM
Subscribers

Details

Summary

FEAT_PAN3 adds the SCTLR_EL1.EPAN field. This tells the hardware to
raise a permission abort when userspace could execute a page, i.e. the
ATTR_S1_UXN field is clear in the page table.

This causes issues for the EFI runtime as we only mark non-executable
pages with this flag leading to a permission fault when accessing it.

Fix this by marking all EFI mappings with ATTR_S1_UXN. The kernel
already had this field set so was already safe.

Reported by: tuexen
Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable