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
F163072467: D52750.diff
Sun, Jul 19, 8:15 PM
Unknown Object (File)
Wed, Jul 15, 6:46 AM
Unknown Object (File)
Wed, Jul 15, 6:46 AM
Unknown Object (File)
Tue, Jun 30, 9:36 PM
Unknown Object (File)
Mon, Jun 22, 12:56 PM
Unknown Object (File)
Jun 17 2026, 2:16 AM
Unknown Object (File)
Jun 6 2026, 7:40 PM
Unknown Object (File)
May 18 2026, 5:03 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