P1: before the tag
An appendix to the milestone.
P1
-
The ring layout is a copy of the proved layout, and nothing checks the copy. DONE (the constants live in
moho_abi::virtual_io, nifeos/moho_abi#3, and every driver imports them, nifeos/nife#4095).QSIZE(:72),OFF_DESC,OFF_AVAIL,OFF_USED(:99-101) and the net driver's0x200stride (:564-569) restatedirect_memory_access_validator::{LAYOUT_QSIZE, DESC_OFF, AVAIL_OFF, USED_OFF, RING_BLOCK}as literals. The kernel aliases those constants, so the layout it runs matches the layout Kani proves (kernel/src/virtual_io.rslines 422 to 442). The driver does not alias them. A change to the proved layout would leave the driver reading the wrong offsets, and nothing would fail until a QEMU test did.components/src/virtual_io_net_transport.rslines 28 to 31 records the same copy as a bug, and this crate records nothing.notes/net/the-driver-and-dhcp.mdlines 130 to 137 says ยง46 (thin primitives or whole subsystems; we write everything in between) priced the dependency edge and the tree did not take it. The validator has no dependencies of its own (crates/direct_memory_access_validator/Cargo.toml). The fix: the constants move tomoho_abi::virtual_io, as Decision 2 decides, provisionally, and this crate imports them. Effort: S. Two-way: the layout values do not change, only where their names live. -
The block server dies on a device error that a client can cause. DONE (a non-OK status answers
-5, an out-of-range or overflowing block answers-22, and only a refused notify panics).complete_blkpanics on a non-OK status (:1004-1007) andsubmit_blkpanics on a refused notify (:1153-1155). Meanwhileblk_flushdeliberately returns the verdict (:1037-1047) because, as its own comment says, the long-lived block server's death would block every filesystem client. Ablk::READorWRITEwhoseblocklies past the device's capacity completes withVIRTIO_BLK_S_IOERR, and the server panics. The sector arithmeticblock * blk::SECTORS_PER_BLOCK(:1017,:1031) can also overflow, which panics under the workspace's release overflow checks. Theblockword arrives from the FS server (:949), and nothing checks it againstdisk_size_bytes(:1161). Why it matters: the only production path in this crate (RedoxFS behind the FS server) has an availability failure that a bad request reaches, and the crate's own flush path shows the intended shape. The fix: checkblock + countagainst the capacity read once at start. Answer-22(EINVAL) for an out-of-range request and-5(EIO) for a non-OK status, as the flush verb does. Let the panic stay only for a refused notify (a server bug). Effort: M. Two-way. -
The two
unsafeblocks state a precondition nothing checks, and omit the one that matters. DONE (window_access_fitschecks the bounds and the alignment in both accessors).direct_memory_access_write<T>anddirect_memory_access_read<T>(:118-125) are safe functions whose SAFETY comments say the offset lies within the DMA page andTfits. Neither claim has a check, and the block server's region spans seventeen pages and not one (:912-919). The comments never mention alignment, whichwrite_volatileandread_volatilerequire. Every call site today has alignment by construction (u16at even offsets,u32at multiples of 4,u64at multiples of 8). Why it matters: the invariant lives at twenty call sites instead of at the one function that owes it, and the nextdirect_memory_access_write::<u32>(OFF_HEADER + 2, ...)has undefined behavior with no diagnostic. The fix: adebug_assert!on bounds andoff % size_of::<T>() == 0, orMappedWindow(item 2), whose constructor asserts once. Effort: S. Two-way. -
The handshake skipped a step the specification requires of a driver. DONE (the status read-back, bounded, in both handshakes:
a_reset_waits_for_status_to_read_back_as_zero). The driver'sVersioncheck is not done, on purpose. The kernel's scan refuses a slot whoseVersionis not 2 in every build and reports it once,a_slot_whose_version_is_not_2_is_refused, since the kernel's own queue setup writes modern registers; the PCI transport answers 2 there. The driver does not check it again (Decision 3, provisional, 2026-11-15 UTC). After writing 0 toStatus(:143,:624) the driver proceeds without readingStatusback as 0. The specification requires that read before reinitialization (virtio 1.2 section 4.1.4.3.2 for the PCI transport; for the MMIO transport virtio 1.2 has only section 2.4.2's SHOULD). It checks the magic value (:141,:622) and neverDeviceID. Today the kernel enumerates the device and QEMU resets synchronously, so the gap cannot bite. Under the ruled direct grant (milestone 1062 (the device control planes leave the kernel) step 7) a driver will own its own bring-up against a real device. The bounded wait forStatus == 0is the check that catches a half-reset device. Effort: S. Two-way. Inferred from reading. -
Four copies of one completion loop and three copies of one submit. DONE (
submitandcompleteserve every queue; the caller reads the status byte).complete_block(:487-510),complete_blk(:990-1008),complete_flush(:1091-1103) andwait_receive(:802-816) are one loop with three endings (panic, report, return).submit_block(:427-480),submit_blk(:1110-1157) andsubmit_flush(:1052-1087) are one publish with three chains. The ring publish sequence (:467-472) appears six times in all, the attackers included. Why it matters: item 4's fix lands in one place or in three, and a mutation census, once one can run, scores each copy separately. The fix:submit(chain: &[Descriptor]) -> u16andcomplete(used_before: u16) -> u8returning the status byte. The caller decides what a non-zero status means. Effort: M. Two-way. -
The receive parser trusts the buffer, not the device's length. DONE (
parse_dhcp_offerbounds every read by the used element's length).parse_dhcp_offer(:821-865) never reads the used ring element'slen(the bytes the device wrote), so it parses whatever the buffer held before, up toNET_RECEIVE_BUF_LEN. The option walk's guardo + 1 < end(:848) admits a read ato + 2(:858) wheno + 1 == end - 1. That read lands one byte past the receive buffer and into the transmit buffer at0xA00. It stays inside the DMA page, so it causes no memory-safety problem, but it parses wrongly.ihlhas a lower bound (:828) and no upper bound within the frame. The parser does not read the IPv4 total length or the UDP length.ip_checksum(:606-617) drops a trailing odd byte while its doc comment says it sumslenbytes. Why it matters: this is the only frame parser in the crate, and the stale-buffer case is exactly what a second broadcast in the loop at:883-897produces. The fix: readused.ring[i].len, bound every read by it, and make the option loop's guardo + 2 < end. Effort: S. Two-way. -
Names, against
design/naming.md. DONE (every name below is spelled out and provisional; each specification term keeps its spelling as#[doc(alias)], and the public entry points carryName:blocks). The rule covers parameters and private items as well as public ones, andscript/crate-standalonerequires every name a stranger meets to carry a ratification. Found, with the rule each breaks:
DMA_VA(:39):dmaandvaboth appear on the spelled-out list, and the appendix wants_VIRTUAL_ADDRESS.direct_memory_access_phys, the parameter of all seven public functions:physappears on the appendix's list (physical_address).CONFIG(:927):configappears on the list.INTERRUPT_ACK(:54) abbreviates, and a register offset ends_REGISTER. The same suffix applies toMAGIC,DEVICE_FEATURES,DEVICE_FEATURES_SEL(sel),DRIVER_FEATURES,DRIVER_FEATURES_SEL,INTERRUPT_STATUSandSTATUS(:48-55). Each keeps the specification's spelling as#[doc(alias)]and in the doc comment's opening.BLOCK(:106),NET_HDR_LEN(:558),NET_RECEIVE_BUF_LEN(:573): a length carries its unit (_BYTES), andhdrandbufare abbreviations.blkinrun_blk_server,blk_read,blk_write,blk_flush,submit_blk,complete_blk,BLK_REQ,BLK_READY,BLK_OFF_DATA: the acronyms appendix namesblkas a failing abbreviation, and the maintainers renamed the binary that carried it toblock_driveron that ground. (Thefile_system_contract::blkmodule it mirrors sits outside this crate.)mr,mw(:109,:114),wr_be16,wr_be32,rd_be16,rd_be32(:583-602),write_desc,desc_base,avail_idx,QSIZE,OFF_*,csum,istatus,dev_lo,dev_hi,ack_hi,req_type,req,w0,st,ihl: abbreviations a reader decodes.S_ACKNOWLEDGE,S_DRIVER,S_DRIVER_OK,S_FEATURES_OK,F_VERSION_1_HI,F_ACCESS_PLATFORM_HI,F_INDIRECT_DESC_LO,F_FLUSH_LO,VIRTQ_DESC_F_*,VIRTIO_BLK_T_*: specification terms a reader searches for. The rule lets a name keep them with an expansion and an alias, and today none carries either.- The seven public functions have no
Name:block.
Why it matters: if the crate leaves, the move check fails on the first bullet. If it folds into the program (Decision 1), the names become private and the same list becomes the program's worklist. The fix: one rename lane after Decision 1, bringing the public names to the architect. Effort: M. Two-way today (nothing has a release); one-way the day the crate publishes a name.
-
The documentation describes a different crate. DONE (the module doc lists the roles, a report-code table sits beside
report_code, the example imports nothing unused, and the kernel comments and notes namecomponents/src/block_driver_roles.rs; the fold leaves no README to write). The crate doc (:2) opens with "A virtio driver, block and net, at EL0". A stranger expects a library and finds seven-> !entry points. There is no README. Shipped text cites 17 paths into this tree, 9 milestones, 3 sections and the architect by name (script/crate-standalone), and a reader outside the tree can follow none of them. The report codes (0xE4through0xEA,0xE200 | status,0xDEAD_0000_0000_0000 | code) form a protocol with the kernel test, and no document tabulates them. Therunexample (:192-197) importsexitand never uses it.kernel/src/virtual_io.rsline 419 andkernel/src/user/virtual_io_service.rsline 9 say the layout andDMA_VAmust matchuser/src/virtio.rs, a file that no longer exists. The docs-versus-reality audit report indesign/audit-reports/recorded the rename tocrates/virtio, and the two kernel comments slipped through. The fix: a crate doc that says what the crate is (one program's roles, or the library of Decision 1). Add a table of the report codes besidereport_code, correct the stale paths, and, if the crate leaves, add a README and resolve the citations. Effort: S to M. Two-way. -
The manifest does not stand alone. It has no
rust-version. It setslicense.workspace = trueand[lints] workspace = true. It has no license files, and apublish = falsecomment that points at this tree's allowlist (Cargo.tomlline 5). Every one failsscript/crate-standalone, and every one stops mattering if Decision 1 folds the crate into its program. Effort: S. Two-way.