P1: before the first green pull request in the new repository
An appendix to the milestone.
P1: before the first green pull request in the new repository
-
The proved
deriveis not the delegation the kernel runs. Finding:CapabilityTable::derive, the subject ofderive_never_widens_rights(which the crate,notes/verification/core-harnesses.mdand the lifecycle note all call the central theorem), has no caller in the kernel. Neither doputandget_with. Delegation runs inkernel/src/sched/capabilities.rs(Delegation::derive, lines 366 to 383), which rereads the source, requiresGRANT, requires the subset, and builds the copy by hand; the twoREVOKEarms inkernel/src/system_call.rs(lines 198 and 212) checkGRANTthe same way. None of those three sites is under a Kani harness (kernel/src/system_call/proofs.rshas none for them). Inside the crate, the docs describeRights::GRANTas the right to pass a capability on, and nothing in the crate consults it: an outside user who callsderivegets a copy of aGRANT-less capability. Within nife this widens nothing, because the kernel never callsderive; it means the proof and the code it describes have drifted apart, and the crate's own API contradicts its own documentation ofGRANT. Evidence:src/lib.rslines 62 to 64, 453 to 472, 717 to 758;kernel/src/sched/capabilities.rslines 340 to 400;kernel/src/system_call.rslines 196 to 214;grep -rn '\.derive(' kernel/src. Change: put the rule in the crate once, as a method onCapability<O>:delegate(&self, rights: Rights) -> Result<Capability<O>, Error>, refusing withoutGRANTand refusing a widening, with a new error variant for the first refusal (GrantRequired). HaveDelegation::deriveandCapabilityTable::derivecall it, so the kernel's lock discipline stays where it is and the rule has one body. Prove it: a harness over all 2^32 source and requested rights thatOkimpliesGRANTheld and the result's bits are within the source's, stated in raw bits asderive_never_widens_rightsis, with a falsification patch that drops theGRANTcheck. Then either giveget_witha caller or delete it;putstays as the proof builder's door and says so. Door: two-way (no behavior changes on the kernel's path when the rule is the same). Effort: M. -
A slot number truncates on a 32-bit target. Finding:
get,put,deleteand (through them)derivecastslot as usize(src/lib.rslines 389, 439, 448, 476; its range check guardsinsert_atfirst andinsert_at_or_aboveusestry_from). On a target with 32-bitusize, slot2^32 + knames slotk. The caller only reaches its own table, so the caller gains no authority. The claim that "the entire security mechanism is a bounds check" stops being true as stated, andget(u64::MAX)passing the test (usize::MAXis out of range) hides it. No target nife builds is 32-bit, so this is a hole in the claim, not a defect a current user can reach. Evidence: the four lines above;cargo clippy -W clippy::pedanticnames fivecast_possible_truncationsites;tests.rsline 103. Change: makestorage::slot,fillandemptytakeu64and convert withusize::try_from(slot).ok()?, so an unrepresentable slot isNoSuchSloteverywhere; one test with1 << 32besideu64::MAX; one sentence onget. Door: two-way. Effort: S. -
lenmeans capacity. Finding:CapabilityTable::lenreturnsN, the capacity, whileis_emptyandusedspeak of occupancy, so a table withlen() == 64isis_empty(). The naming rule says a method takes std's spelling and meaning where std has one, andlenin std is the number of elements held. The ruling that standard-library names win came after this name, so this review rechecks it as the release-review rule allows. The kernel reads it as capacity atkernel/src/sched/ capabilities.rslines 88, 149, 303 and 328. Evidence:src/lib.rslines 377 to 385;design/naming.md, "Shapes". Change: rename tocapacity(std's word for exactly this onVecandHashMap), keepis_emptyandused, addlenonly if it returnsused. Four kernel call sites move with it. Door: two-way before the release; a published name after it. Effort: S. -
The move tool breaks every regenerated patch and skips the manifest step while reporting both as done. Finding: in the staged tree all 14 regenerated patches fail
git apply --checkwith "corrupt patch" (the template'sproofs / falsifyusesgit apply), while the tool's ownpatch -p1 --dry-run -F0passes them. The regenerated hunk header forsubset_is_reflexivesays 7 old lines and the body carries 6: the trailing blank context line is gone.regenerate_patchcallsrun, which returns(stdout + stderr).strip(), andstrip()removes a final line that is a single space, which is howdiff -uwrites a blank context line. Separately,add_repositorymatches only^license\s*=and this manifest haslicense.workspace = true, so the tool writes norepositoryline while the "rewrite" step reports it set. Evidence:helpers/crate_move.pylines 72 to 118 (regenerate_patch), 156 to 163 (add_repository), 574 to 576 (run); the staged tree'sfalsifications/ verification.subset_is_reflexive.patchlines 26 to 32;crate-move-static.logof the dry run. Change: haveregenerate_patchtakediff's output without stripping (or strip newlines only), add a selftest patch whose hunk ends in a blank line, and makeadd_repositoryinsert afterlicense.workspacetoo, or fail loudly when it inserted nothing. Any crate whose hunk ends at a blank line hits the first; any crate that inherits its license hits the second, so both belong in the tool, not in this crate. The template'sstandalonejob would have caught both on the first pull request; the point of the dry run is to catch them before it. Door: two-way. Effort: S. This item is against nife's tooling, not the crate. -
Two mutators are outside every harness. Finding:
insert_at_or_above(the floor insert thestdruntime relies on) appears in no harness, so no proof covers the free word or the count after it. Only the builder's first fill exercisesputover an occupied slot. One assertion covers the mark's monotonicity, aspeak() >= used()after a delete, not as "never falls across any operation". A test, not a proof, reaches thefloor >= 64arm offirst_free_from. Evidence:src/lib.rslines 294 to 302, 414 to 427, 601 to 677. Change: addinsert_at_or_above(kani::any(), ...)and a secondputtothe_free_mask_is_the_empty_slotsandthe_count_is_the_slots. Add a harness that applies one symbolic operation of any kind to a symbolic table and assertspeakdid not fall andinsert_at_or_abovenever landed below its floor. Each new harness arrives with its falsification patch. The unwind bound stays N + 1 by the existing argument. Door: two-way. Effort: S.