Page MenuHomeFreeBSD

arm64: Create an L3 table to limit permissions
ClosedPublic

Authored by andrew on May 2 2024, 4:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 17, 1:35 PM
Unknown Object (File)
Tue, Jun 10, 3:01 PM
Unknown Object (File)
Wed, Jun 4, 12:27 PM
Unknown Object (File)
May 14 2025, 7:26 PM
Unknown Object (File)
May 14 2025, 11:33 AM
Unknown Object (File)
May 1 2025, 8:23 AM
Unknown Object (File)
Apr 26 2025, 1:23 PM
Unknown Object (File)
Mar 15 2025, 2:59 AM
Subscribers

Details

Summary

When building a 4k page kernel we use 2M blocks to map the kernel
contents. As the .text section may not end on a 2M aligned address
we need to split one block into level 3 pages and pad the end of the
section to an appropriate boundary.

With both these changes we can then mapjust the code as executable.
While here also map it as read-only as none ofthis shouldbe written
to directly.

Sponsored by: Arm Ltd

Diff Detail

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

Event Timeline

sys/arm64/arm64/locore.S
965

This seems to be missing commit 94b09d3 that sets ATTR_CONTIGUOUS. That is now going to matter for the 4KB base page size.

sys/conf/ldscript.arm64
21
23

My one concern about this is hypothetical. Suppose that someone in the not-so-distant future tries to implement support for a base page size of 64KB. I suspect that they will fail to notice this until experience a mysterious failure. Is there a compelling reason not to use CONSTANT (MAXPAGESIZE) here instead?

Update based on feedback from @alc

This revision is now accepted and ready to land.Mon, Jun 16, 4:46 PM