Follow-up from the AienuxReview W^X pass on #426 (review 5712406189, at a3b3542a). The review rates this non-blocking.
Problem
The W^X paragraph in native/kernel/README.md (lines 237-256 at a3b3542a) describes the kernel after it switches to its own page tables. Before that, from _start until mm_build loads CR3 (kmain_x86.c:563), the iMac kernel runs on the firmware's page tables, and Apple firmware may map memory as RWX. That stretch covers:
- relocation by
efi_entry_x86_64.S tables_load- the handoff check
mm_builditself
The review found that no untrusted input runs in this stretch, but the README doesn't say the gap exists. A reader could therefore assume W^X holds from the first instruction.
Done when
- The README states plainly that W^X, NX and WP are enforced only after
mm_buildloads the kernel's own tables and sets EFER.NXE and CR0.WP. - It also states that, before that point, the kernel runs on firmware page tables that may be RWX, and lists what runs in that stretch.
- Nothing in the README says this has been checked on hardware unless it has. Apple firmware's real page-table permissions are hardware-unverified.
This is a docs-only change.
— Grokbot