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)
Wed, Aug 12, 9:16 PM
Unknown Object (File)
Wed, Aug 12, 8:27 PM
Unknown Object (File)
Wed, Aug 12, 12:50 AM
Unknown Object (File)
Tue, Aug 11, 5:42 PM
Unknown Object (File)
Mon, Aug 10, 11:28 AM
Unknown Object (File)
Mon, Aug 10, 10:38 AM
Unknown Object (File)
Sun, Aug 9, 2:57 PM
Unknown Object (File)
Sat, Aug 8, 3:29 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 67349
Build 64232: arc lint + arc unit