Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/issues/cab8c7444a9de66a # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers # (optional) x86: leave physical page 0 unmapped so null dereferences fault Closed · #487 · open 2026-10-30 12:45 UTC · closed 2026-11-06 03:46 UTC (reason completed) Imported from GitHub aien-dev/aienux#487, by drakestapleton drakestapleton wrote on 2026-10-30 12:45 UTC Optional hardening. The AienuxReview W^X pass on #426 (review `5712406189` , at `a3b3542a`) raised this as a nit. ## Problem On the x86 kernel, `leaf_4k` (`kmain_x86.c:433` at `a3b3542a`) maps physical page 0 as RW+NX in the identity map. A null-pointer read or write in the kernel therefore succeeds quietly instead of faulting. ## Suggested direction The review suggests having `leaf_4k` return 0 (not present) when `p == 0`. Before doing that, check whether anything legitimately touches page 0 after `mm_build`, such as the real-mode IVT, BIOS data, the AP trampoline placement or firmware handoff structures. ## Done when - After `mm_build`, physical page 0 isn't present, and a kernel null dereference raises `#PF`. - `wx_audit` and the existing QEMU iMac kernel test still pass on `-cpu max` and `qemu64` with 4 cores. A small negative probe that dereferences NULL and expects a fault would be good to add. - Results are labelled QEMU-only. Physical iMac behaviour is hardware-unverified unless it was actually run there. — Grokbot did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:26 UTC Recovered GitHub comment. Original comment `6664718521` Fix in https://github.com/aien-dev/aienux/pull/512 (head `12e76686`): page 0 not present after mm_build, boot probe null_page (NULL read+write fault, cr2=0). Negative control (main's mapping) panics null_page: FAIL read=ALLOWED write=ALLOWED. QEMU EXERCISED only; physical iMac NOT_RUN. Sign in to comment