roadmap BUILT

969. No frame is writable and executable in one address space

Branch: milestone/969-no-frame-is-writable-and-executable-in-one-space.

The tenth outsider pass (milestone 936 (a tenth outsider pass attacks the confinement claim)) mapped one READ | WRITE frame MAP_RW at one address and MAP_CODE at the next in one space. Each page-table leaf was honest and the page was writable and executable, which defeated claim 11 by alias. An architect ruled on 2026-10-27 (UTC) that the escape sits on a shipped path and that the fix is mandatory.

Reuse: the mapping log every space already keeps (kernel/src/revoke.rs), the leaf walk mmu::translate_at, and the pass's witness. No new dependency and no vendor.

What the kernel does

MappingHold::record_mapping refuses a mapping that would leave a page writable through one mapping and executable through another in the same address space. That one function serves every path that installs a recorded user leaf: AddressSpace::MAP_INTO, PageFrame::MAP, MemoryRegion::MAP and the kernel's loaders. Each path files its record before it writes the leaf, as MappingHold::retype_table does for tables. It hands the record back through MappingHold::forget_recorded if the leaf then fails. So no path installs a recorded leaf without the check, and no other core can fetch through a leaf the check would refuse. The record now goes in before the leaf (ruled 2026-10-31 UTC).

The refusal is narrow (ruled 2026-10-31 UTC). A new writable mapping fails when the space maps the frame executable anywhere, and a new executable mapping fails when it maps the frame writable anywhere. Read-only beside read-write passes, and so do read-only beside code and two mappings with the same flags. The pure predicate is page_tables::Flags::makes_writable_executable_pair. The log stores no permissions, so the check walks the leaf of each record that names the same frame. A read-only mapping cannot complete the pair, so it skips the scan, which leaves map_el0's read-only loop out of the cost. A caller sees NotPermitted, the error's second case, "the object refuses the operation whatever the rights", with no new error code and no wire-format change (ruled 2026-10-31 UTC, #2965). Inside the kernel the refusal is page_tables::MapError::WritableAndExecutable.

The check sees one address space at a time (ruled 2026-10-31 UTC). The same frame writable in one space and code in another maps, and loading relies on that: process_builder::fill_and_map writes a segment through its own writable view and then maps the frame as code into the child. Row 11 of notes/confinement-claims.md states the claim per space with that limit beside it. The shared code covers all three ISAs. Each ruling's background, options, prior art and cost are in the-rulings-the-alias-refusal-waits-on.

The tests, in system_tests/src/user/tenth_pass_map_gate_tests.rs, run in the default suite on every architecture:

Each test carries a replayable falsification under system_tests/falsifications/; the witness's patch and the reverse-order test's remove the check from record_mapping. The Kani harness page_tables::verification::no_admitted_pair_is_writable_here_and_executable_there proves the predicate over every access word, with its own patch.

BUGS

Follow-on

Index row

One physical page mapped writable at one address and as code at another, in one address space, defeated W^X by alias on a shipped path. MappingHold::record_mapping, which every mapping path reaches before its leaf goes in, now refuses that pair with NotPermitted and admits every other. The pass's witness joins the default suite on all three architectures, beside a reverse-order witness through PageFrame::MAP.