P2: later
An appendix to the milestone.
P2: later
-
The table check hashes an entry the kernel and the progenitor never see, and skips one they DONE by the item's own alternative: the three facts are in the crate's
BUGS. never read. Finding:inspect_tablewalksfs.entries()and reads each by name withfs.read(name), which returns the first entry of that name.nifefs::write_imagedoes not refuse duplicate names, so an archive with twoconsoleentries has its first hashed twice and its second never. The kernel and the progenitor also read the first, so the verdict is right and the second entry is dead bytes nobody reports. An entry whose name fails UTF-8 gets skipped withcontinue. No reader can name it, so it too is dead bytes, reported by nothing. And theunwrap_or_default()on line 339 hashes an empty slice in a case that cannot occur, which hides the impossible case as a healthy digest. Evidence:crates/sealed_pair/src/lib.rslines 334 to 348;crates/nifefs/src/lib.rslines 221 to 230 and 254 to 297. Change: hash the entry's own bytes (nifefscould expose aread_entry(&Entry)). Report a duplicate name and a name that is not UTF-8 as a fourth disagreement ("dead entry"). State inBUGSthat duplicates are not refused by the writer. Or state the three facts inBUGSand change nothing. Door: two-way. Effort: S. -
In the stick path the haystack contains the archive. DONE:
embedded_archivereturns the archive's span and the checker searches the bytes outside it. Finding:card_checkpasses the whole boot file as the kernel and the archive found inside it as the archive, socontainssearches the archive too. Today no archive entry carries another entry's digest as raw bytes (the table and the loader's words are hex text), so the search cannot find a digest the kernel lacks. A future entry that embeds raw digests (a binary catalog or index) would make a stick read as sealed with no digest in the kernel. The crate's documentation says searching the whole file is sound and does not state the condition. Evidence:crates/sealed_pair/src/lib.rslines 362 to 377;xtask/src/card_check.rslines 166 to 190. Change: haveembedded_archivereturn the archive's span (its start and its length, which the directory gives) so the caller can search the bytes outside it. Or state the condition inBUGSand add a test that an archive carrying a raw digest of its own entry is not vouched for by a kernel that lacks it. Door: two-way. Effort: S. -
containsis a byte-at-a-time window scan over a release kernel. DONE (a measurement: a 1 MiB image scans in about 1.6 ms, so the crate needs no searcher). Finding:haystack.windows(32).any(|w| w == needle)compares at every offset. A release kernel is several megabytes and the scan runs once per measured entry, so the cost is small today and unmeasured. The standard library'smemmem-style searchers and thememchrcrate'smemmem::findare the usual answer; the crate has no third-party dependency and the tree's rule on new dependencies applies. Evidence:crates/sealed_pair/src/lib.rslines 385 to 390. Change: measure first on a realnife-vf2.img; if it shows, a first-bytememchr-style skip written here (ten lines, no dependency) ormemchrbehind the dependency rule. Door: two-way. Effort: XS to measure, S to change. -
No proof, in a crate whose two neighbors each carry two. DONE:
contains_finds_a_digest_exactly_when_it_is_thereanda_table_line_vouches_for_an_entry_exactly_when_the_digests_are_equal, each with its falsification patch, and ascript/verifyrow. Finding:nifefsandmeasured_booteach have two Kani harnesses with falsification patches; this crate has none. Its logic is small and pure. It hascontains(a window exists if and only if the needle is at some offset) andembedded_archive(the result starts withMAGICand parses with aprogenitor). It also has the table comparison: everyChangednames an entry whose bytes hash to something other than the table's digest. Tests and the census cover the behavior; nothing covers it for all inputs. Evidence:crates/sealed_pair/src/lib.rslines 369 to 377 and 388 to 390; the packet's "Kani harnesses" section. Change: one harness forcontainsagainst a bounded haystack (aconstbound of 64 bytes) with its falsification patch, under the template'sproofsjob. The table comparison is a second, if the first is cheap enough. Door: two-way. Effort: S. -
hex_stringduplicates a function one level down, andmeasured_entrieshas one reader. LEFT: decided at the move. Finding:hex_stringwrapsmeasured_boot::hexinto aString; astdfeature onmeasured_bootcould offer it.measured_entriesis public and read only inside this crate and its tests;xtask::measurereadsBOOT_PROGRAMS. A public item with no outside reader is a promise nobody asked for. Evidence:crates/sealed_pair/src/lib.rslines 37 to 41 and 380 to 383;xtask/src/measure.rsline 25. Change: keep both until the move and decide then:measured_entriesprivate unless a caller appears,hex_stringmoved or kept with a sentence saying why it is here. Door: two-way until a release. Effort: XS. -
A note in this tree describes a list the crate no longer has. DONE (
notes/boot-stick.mdnames the two measured entries). Finding:notes/boot-stick.mdsays the loader's build hashes "the archive'sprogenitor, the six ELF child builders andprogram_measurements".BOOT_PROGRAMSholdsprogenitoralone, and the table measures the builders;measured_entriesis two names. The crate's own documentation is right. Evidence:notes/boot-stick.mdlines 150 to 153;crates/sealed_pair/src/lib.rslines 22 to 28. Change: the note states the two names and points atmeasured_entries, as milestone 971 (the boot stick notes are read against their code) intended. Door: two-way. Effort: XS.