Page MenuHomeFreeBSD

arm64: Mark EFI memory as userspace non-executable
ClosedPublic

Authored by andrew on Fri, Sep 26, 11:46 AM.
Tags
None
Referenced Files
F133421154: D52750.id162881.diff
Sat, Oct 25, 4:35 PM
Unknown Object (File)
Tue, Oct 21, 11:25 PM
Unknown Object (File)
Sun, Oct 12, 1:03 AM
Unknown Object (File)
Sun, Oct 12, 1:03 AM
Unknown Object (File)
Sun, Oct 12, 1:02 AM
Unknown Object (File)
Sat, Oct 11, 3:33 PM
Unknown Object (File)
Mon, Oct 6, 2:44 AM
Unknown Object (File)
Thu, Oct 2, 3:27 PM
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