roadmap BUILT

307. Which assertion actually fires when a confinement claim is broken

Why this exists

Milestone 305 found two independent cases where the assertion a reader would quote is not the assertion doing the work, and one where a test could not fail at all. It said in its own block that a sweep would probably find more. This is that sweep, over all 26 rows of notes/confinement-claims.md, which are the confinement claims this project makes in public.

One question, asked of every row: when the claim is broken, which assertion fires, and is the one a reader would quote reachable at all?

The framing matters because AGENTS.md's first principle says an experiment that can only confirm is not a test, and design/fatal-risks/README.md's risk 7 is the claim that the property the whole system is built to provide does not hold. Risk 3's mutation census, which measures exactly this property, runs over host crates and cannot see kernel tests. Nothing the project owns would have found 305's survivor, and nothing would have found this one.

The finding: a second proof that could not fail

page_tables::x86_64::no_vtd_entry_ever_sets_a_reserved_bit is the whole of row 12's evidence for §20 (IOMMU-backed DMA isolation)'s claim that an IOMMU entry sets no bit the hardware treats as reserved. It stated everything through VTD_ADDR_MASK, VTD_R and VTD_W, as the note shows. Those are the three constants Vtd::leaf_entry builds its result out of, so the assertion read

fn leaf_entry(pa: u64, flags: Flags) -> u64 { (pa & VTD_ADDR_MASK) | bits }  // bits ⊆ {VTD_R, VTD_W}
kani::assume(pa & !VTD_ADDR_MASK == 0);
assert_eq!(leaf & !(VTD_ADDR_MASK | VTD_R | VTD_W), 0);

and (pa & M) | bits sets no bit outside M | VTD_R | VTD_W for every value of M. The assume narrowed the inputs by the same constant, so a widened mask admitted exactly the addresses it had just started letting through. The address half of the claim was a tautology.

Measured both ways on patagonia, 2026-09-16, kani 0.67.0, with VTD_ADDR_MASK widened from bits 51:12 to bits 62:12:

Harness Result
as it stood before this milestone SUCCESSFUL, 0 of 45 failed. A survivor.
as it stands now FAILED, 1 of 68
as it stands now, honest tree SUCCESSFUL, 0 of 68

Neither the defect nor its consequence is exotic. The constant's own doc comment records that VT-d's real address width is CAP_REG.MGAW-defined and this driver has never narrowed to it, so the mask is a number somebody could plausibly change. And the harness's own doc comment explains why the failure would be bad: QEMU's model and real silicon fault a transaction over a reserved bit rather than ignoring it. The symptom is an IOMMU whose every translation fails, which reads as broken hardware rather than as a bad table.

The surprise is that the tree had already recorded the opposite. Forty lines up, the comment on the_leaf_keeps_address_and_permissions_apart explains this exact trap correctly, in full, and then says: "no_vtd_entry_ever_sets_a_reserved_bit in this crate already works this way; this is the same move on the portable leaf." It did not work that way. A lane that had just avoided the trap reached for a precedent and picked the one harness in the crate still caught in it, and that sentence then stood as the tree's only statement about the question. The comment is corrected here rather than deleted, because the citation is the more interesting half: this is AGENTS.md's ladder failing at rung four exactly as it says it will. The rung-one fix is that the constant is now a literal that no implementation can reach.

The host twin a_vtd_leaf_sets_no_bit_outside_read_write_and_address was blind for a second, independent reason, which is worth naming because a literal alone would not have fixed it. Its one concrete address 0x10_0000 carries no bits above 51. So the encoder's masking was never exercised and a widened mask changed nothing it could observe. It runs three addresses now and catches the same defect in microseconds, which is where this tree prefers to catch things.

The 305 shape recurs, six more times, and in proofs rather than only in kernel tests

305 promoted "in a test that states its property twice, the readable statement is usually the unreachable one" from an anecdote about §31 to a thing to look for. Eight rows carry such an assertion. Three were removed because they restate the guard itself and no defect can separate them (rows 13, 14, 18). Five are left in place because they are genuine redundancy that costs a line, and the distinction between redundancy and decoration is the thing worth keeping. Every one is recorded beside its claim in notes/confinement-claims.md.

Row 18 is the one to read, because it inverted. notes/confinement-claims.md has a section crediting a_plan_never_grants_a_right_the_declaration_did_not_ask_for's & GRANT == 0 line as the only explicit assertion that catches the defect. Milestone 211 then repaired the assertion above it by writing the expected rights out in literals, and since READ is 1 << 0, WRITE is 1 << 1 and GRANT is 1 << 2, that equality now implies the & GRANT == 0 line entirely. The rescue became the decoration, and the note went on describing code that had changed for four weeks. That paragraph is rewritten rather than patched, because the corrected version teaches more than the original did.

Counts

Fires as advertised: 17 rows. Quotable assertion cannot run: 8. Answered by refusing to look: 1.

The third number is the one that mattered and the first is not padding: saying plainly that 17 rows are exactly what they look like is what makes the other nine worth reading.

What it cost

Reading is what found all nine unreachable assertions and it is nearly free. Breaking is the only instrument that can find a survivor, and it costs one solver run or one boot per defect: the row 12 measurement above is three cargo kani invocations at about two seconds each. The asymmetry is the practical lesson. Reading predicts. Only breaking decides; and a prediction about a proof is cheap enough to confirm that there is no excuse for leaving one unconfirmed.

BUGS

Follow-on

Index row

Milestone 305 (the six kernel confinement rows get a falsification a machine can replay) found two cases where the assertion a reader would quote is not the assertion doing the work and predicted a sweep would find more. This is that sweep, over all 26 rows of notes/confinement-claims.md. The finding is a second proof that could not fail, and it is a Kani harness rather than a kernel test, which is where nobody was looking. no_vtd_entry_ever_sets_a_reserved_bit stated all three assertions and its assume through the three constants the encoder builds its entry out of. So (pa & M) | bits setting no bit outside M | R | W held for every value of M. Widening VTD_ADDR_MASK over bits a VT-d entry really reserves left it SUCCESSFUL, 0 of 45 failed, while every translated DMA would fault as broken hardware. The tree had recorded the opposite forty lines away, citing this harness as the example of avoiding that exact trap. Fixed, measured both ways, and the shape found six more times: 17 rows fire as advertised, 8 have a quotable assertion that cannot run, 1 was answered by refusing to look.