P1: before the tag
An appendix to the milestone.
P1: before the first release
-
A caller-supplied root at the top of the page-number space makes the crate panic. Finding:
insert_rootandinsert_root_with_ceilingsaccept anybase_pageand anypages, zero included, and nothing checks any later sum.insert_root(u64::MAX, 4)followed byretype_pagepanics with "attempt to add with overflow" atsrc/table.rsline 604. A root atu64::MAX - 3with two children, the lower returned, panics atsrc/table.rsline 787 insidereturn_to_parent. Both verified with a throwaway test in a debug build. The tree builds its release profile with overflow checks on, so a kernel would panic too. A build without them hands out a wrong page number.insert_root(0x100, 0)succeeds and makes a zero-page region, whilesplitrefuses a zero-page child. The kernel never passes such values (itsbaseis a physical address overFRAME_BYTES), so no program breaks today. A stranger's firstTablewith a sentinel base does. Evidence:src/table.rslines 377 to 406 (no check),449,604,632,787,792(the sums).Cargo.tomlof the workspace,[profile.release] overflow-checks = true. Change:insert_root_with_ceilingsreturnsNoneunlesspages > 0andbase_page.checked_add(pages)isSome, and its documentation names that as the table's invariant ("a region's run ends inside the page-number space"), which bounds every interior+. A child's run lies inside its parent's, and a watermark never exceedspages. One host test for each refusal, and one Kani harness that inserts any root the table accepts and runs any one operation with Kani's overflow checks as the assertion. Door: two-way (a refusal where a panic was). Effort: S. -
A second
release_objectfor one object undercounts every ancestor for the rest of the boot. Finding:releasewalks the region and its ancestors and saturates each count on its own. A region that holds nothing of the kind stays at zero while its ancestors, which hold their own objects as well, lose one each. Verified: a root with a thread ceiling of 32 holding one thread, a child holding one. Two releases on the child leave the root reporting zero live with one live, and two more thread carves succeed where the ceiling allows one. The kernel's three callers (Threads::remove,AddressSpace::drop, a refused insert) should release exactly once. The crate cannot tell when one does not, and the ceiling is then one looser per such bug, for good. The same shape inchargedecides first and commits second so that a refusal writes nothing.releasehas no decision step. Evidence:src/table.rslines 512 to 525 (release),534-536(release_object). The proofs'Run::release(src/proofs.rslines 388 to 395) skips a release the region does not hold, so the harness never drives this case. Change: give a release the same two-step shape as a charge. Keep an own count per kind besidelive(own: [u32; COUNTED_KINDS], the ghost the proofs already keep inRun::own), raise it inretype_object_page, and havereleaserefuse, writing nothing, when the named region's own count is zero.release_objectreturnsboolso the kernel can log a double release. A host test for the case above, anda_release_keeps_every_count_exactcalls the table's method for a kind the region does not hold and assertsexactstill. Door: two-way now. The return type is public after a release. Effort: S. -
The six loom harnesses lose their runner at the move. Finding:
script/interleaving-checkruns the crate'sinterleavingsmodule under--cfg loomin nife'sinterleavingsjob, and the template's README records loom as dropped because none of the first crates used it. Only the loom model covers this crate's single-winner claim. The model covers two destroyers, a retype against a claim, a split against a claim, a parent against a returning child and a spending read against a return. It also holds the falsification witnessthe_pre_fix_protocol_double_frees_and_this_model_finds_it, which passes only when loom still finds the old double free. Kani does not model two callers (the crate says so). After the move those six run nowhere, and a change that reopens the check-then-remove gap passes every gate. Evidence:src/table.rslines 1385 to 1761.script/interleaving-check..github/workflows/ci.ymllines 1933 to 1972.crate-workflows/README.md, "What each nife gate became", the loom row. Change: aloomjob, in the template as an opt-in input (loom: true) that runscargo test --release --libwithRUSTFLAGS="--cfg loom"and the preemption bound nife's script sets, or failing that a repository-local workflow the move lane writes. And the README's "What is proven" says which properties loom checks and which Kani proves, so a reader does not take the Kani list for the whole story. Door: two-way. Effort: S in the repository, M in the template. -
Gates of the template refuse the shipped source and one regenerated patch. Finding: (a)
register_namesrefusesObjectKind::AddressSpaceunder the rule that an address is_VIRTUAL_ADDRESSor_PHYSICAL_ADDRESS. The variant names an address space, not an address, so the finding is the helper's, but the ceiling is 0 andcheck / standalonefails on it. (b)question_shaperefusessame_snapshotandunmoved_sinceinproofs.rs, bothbool-returning and not named as questions. The gate reads every tracked.rsfile,cfg(kani)or not. (c)prose_acronymsrefuses LIFO, TCB and IPC, each used before its words. (d) The move regeneratesproofs.a_release_keeps_every_count_exact.patchfor-p1, and the regenerated hunk has lost its trailing blank context line while its header still counts ten lines. GNUpatchaccepts the short hunk with no note, and the template'sfalsify.py --checkrefuses it as "corrupt patch at line 24" atv7and at head, soproofs / falsifyis red. Any patch whose hunk ends on a blank line meets this. (e)orphan_modulesat templatev7reportssrc/table/verification.rsas in no module tree (the file sits under#[cfg(kani)]). The helper at head passes it, andv8is the first release that carries the fix. Evidence:src/table.rsline 90.src/proofs.rslines 199 and 337.src/destroy.rsline 14,src/table.rslines 48 and 87. The staged tree'sfalsifications/proofs.a_release_keeps_every_count_exact.patchagainst the original atfalsifications/proofs.a_release_keeps_every_count_exact.patch:24.helpers/crate_move.pylines 72 to 116 (regenerate_patch). Change: (a) in the template, exemptaddress_spaceas a compound the rule does not cover, with a selftest. (b)is_same_snapshot,is_unmoved_since. (c) "last in, first out (LIFO)", "thread control block (TCB)" and "inter-process communication (IPC)" at each first use, or the plain words with no acronym. (d) in nife'shelpers/crate_move.py, keep a hunk's trailing blank context line through regeneration and add a selftest patch whose hunk ends on one. (e) pin the template atv8, which carries theorphan_modulesfix. Door: two-way. Effort: S. -
The documentation says things the code does not do. Finding:
RegionTable's doc says "the kernel picks 256".MAXIMUM_REGIONSis 1,024.usagesays it returns "how many pages the region has retyped". The first figure is the watermark, which counts pages carved into children too (the test atsrc/table.rsline 848 reads 12 of 16 after three splits and no retype).NO_PARENT's doc argues from the dependency's slot bits. The dependency names the same wordEntryName::NEVER_MINTEDand documents it as never minted, which is the fact to cite.ceiling_reached'slevels_upis "how many splits above the refused region", which reads as a count of splits rather than of ancestors. The crate root's doc names the two arithmetic functions and thedestroy_outcomedecision and not the table, the claim, the pin, the return or the ceilings, which is most of the crate. Evidence:src/table.rsline 297,kernel/src/memory_region.rsline 32.src/table.rslines 651 to 655.src/table.rslines 22 to 27.src/table.rslines 205 to 206.src/lib.rslines 1 to 7. Change: "Nbounds the regions live at once; the loom harnesses use 2 or 4". "the watermark (pages spent on retypes and on live children) and the region's size".pub const NO_PARENT: u64 = EntryName::<Region>::NEVER_MINTED.to_bits()with the dependency's guarantee cited. "how many ancestors above the refused region". And a crate-level doc that gives the model in one screen. It covers page units, the bump watermark, a pin while an object lives in a page, a claim as the only right to reclaim, a child's return to its parent and never to the allocator, and the subtree ceilings. TheRegionTableexample follows. Door: two-way. Effort: M. -
The manifest's metadata and its dependency line. Finding: no
description,repository,documentation,readme,keywordsorcategories.cargo packagewould warn on the first three (inferred, not run). The dependency ongenerational_tableis bygitandrev, at the commit thev0.1.0-pre.2tag names (verified withgit ls-remote). Crates.io refuses agitdependency at publish, so the crate cannot publish untilgenerational_tabledoes, and the own-crate dependency rule already covers that. Evidence:Cargo.tomllines 1 to 14. Change:description,documentation = "https://docs.rs/memory_regions",readme = "README.md",keywords = ["no-std", "allocator", "capability", "kernel", "memory"],categories = ["no-std", "no-std::no-alloc", "os", "memory-management"]. The move setsrepository. At publish,generational_table = "0.1"and the pull request on the blocked side names the release it waits for. Door: two-way now. The dependency is one-way at publish and is already ruled. Effort: XS. -
Public names for the naming pass. Finding: every public name but the crate's is provisional, and the move deletes the blocks that say so. Five read wrong to a stranger.
DestroyOutcome::FreeToGlobalsays "global", which a reader takes as scope, where it means the frame allocator.ReturnToParent { unbump }is not a word (the abbreviations report flags it) and names the mechanism rather than the quantity.destroy_outcome'sis_lifo_topcarries an acronym the prose gate refuses.Countedis a participle naming a type.usageandboundsboth return(u64, u64)with different meanings ((watermark, pages)and(base_page, pages)), so a swapped call type-checks. Evidence:src/destroy.rslines 9 to 20 and 26 to 31;src/table.rslines 115, 653 and 704. Change: candidates for the architect, not renames:FreeToAllocator;ReturnToParent { pages_given_back };is_last_carved(oris_at_watermark);CountedKind;Usage { watermark, pages }andSpan { base_page, pages }as two smallCopystructs. The privateCHILD_SHARE_OF_ROOTis a divisor named as a share;ROOT_CEILING_DIVISOR_FOR_CHILDREN. Door: one-way after publish for every public item, which is why the pass comes before it. Effort: S.