P2: later
An appendix to the milestone.
P2: after the first tag
-
blk::request_block_countdecodes a count the contract refuses. Finding:src/blk.rsline 80 returns(w0 & 0xff) + 1, so a low byte of0xffdecodes as 256 whereTRANSFER_BLOCKSis 16. All three block servers clamp with.min(TRANSFER_BLOCKS)(components/src/designware_mobile_storage.rsline 187,components/src/non_volatile_memory_express_data_plane.rsline 335,crates/virtio/src/lib.rsline 953). Change: clamp in the decoder, or returnOption<usize>and let a server refuse withEINVAL; the contract then says which. Door: two-way. Effort: XS. -
dirent::encodeaccepts an empty name; its two siblings refuse one. Finding:src/dirent.rsline 13 writes a record with length 0 anditeryields an empty name;nameset::encodeandxattr::list::encoderefuse an empty name because zero is their terminator. The server never sends one (unverified). Change: refuse it inencodeand say so, or document that a listing may carry one. Door: two-way (a reader change could be one-way; refusing in the encoder is not). Effort: XS. -
The errno vocabulary has three spellings. Finding: the doc of
xattr::ENOTSUP(src/xattr.rsline 67) saysEOPNOTSUPP.blk::FLUSH(src/blk.rsline 33) saysEOPNOTSUPP (95).dir::explain(src/dir.rsline 114,:120,:123,:124) andstore::system_call_einval(src/xattr.rsline 340) use bare literals for ENOENT, EEXIST, EBADF, EMFILE and EINVAL.dirandgranteach defineEROFSandENOTDIR, andEBADFonce more underverb::file_grant.redox_syscallspells 95EOPNOTSUPP. Change: oneerrnomodule naming every number the contract answers, each with its sentence, andexplainmatching on names; the duplicates become re-exports. Door: the names are public (Decision B covers the spelling); the layout is two-way. Effort: S. -
MAXIMUM_LENGTH_OR_OFFSETdescribes a field that carries no offset. Finding:src/fs.rsline 304 says "the largest length or offset that fits the packing"; the offset ofREAD,WRITEandTRUNCATErides whole in the second word (src/fs.rsline 33,:36,:49), and the packing covers only the length. The name has its ratification. Change: correct the doc now; the name waits for Decision B's pass. Door: two-way for the doc. Effort: XS. -
Two distinctness tests are stale and redundant. Finding:
src/tests.rsline 7 lists seven verbs;src/fs/tests.rsline 83 lists twenty-two and omitsSTATFS. The compile-time assertions insrc/verb.rsline 307 and:311already prove every opcode inFIRST..=LASTis distinct, in order and in the 8-bit field. Change: derive one test fromverb::TABLEplusBIND,UNBIND,BIND_SYNC, or delete both. Door: two-way. Effort: XS. -
usizecasts on a narrower target. Finding:fs::request_length_bytes,fs::destination_length_bytes(src/fs.rsline 361,:376) andxattr::spec_value_lencast a 40-bit or 32-bit field tousize. On a 32-bit target the 40-bit cast drops the high byte; a length of2^32 + 4096reads as 4096, a smaller successful read, the failure theconstblock names. None of the crate's three targets is 32-bit. Inferred, not built. Change:usize::try_from(..).ok()where a caller can refuse, or aconstassertion thatusize::BITS >= 40is false on every target and so refuses a 32-bit build with a message. Door: two-way. Effort: XS. -
in_opcode_orderwarns on the minimum Rust version. Finding: stable 1.88 reports the function never used, since its only non-test use is inside aconst _assertion that 1.88's dead-code pass does not count; 1.99 does. The weeklymsrvjob builds and tests without-D warnings, so it stays green. Change:#[cfg_attr(not(test), allow(dead_code))]with the reason, or make the assertion call apubfunction. Door: two-way. Effort: XS. -
No fuzz target of the crate's own. Finding: the crate has no
unsafe, so it qualifies for the template's public-crash-inputs opt-in; nife's only fuzz target that links it drivesredoxfs_server. The four walkers andstore::set/removetake arbitrary bytes. Change: afuzz/with one target per walker (iterate, then re-encode what the walker read and check the round trip) and one for the store; opt in. Door: two-way. Effort: S. -
xattr::replymasks a kind it should never receive. Finding:src/xattr.rsline 101 maskskind & MAXIMUM_KIND;store::setrefuses such a kind, so a stored kind never has bit 31, and a caller that bypasses the store gets a different kind back without an error. The test atsrc/xattr/tests.rsline 288 calls the masking "rather than lies". Change: assert, as item 7. Door: two-way. Effort: XS.