P1: before the first tag
An appendix to the milestone.
P1: before the first tag
-
The crate's BUGS section states a kernel fact that is no longer true. Finding: the module documentation and the README both say the invariant time stamp counter bit (
CPUID.80000007H:EDX[8]) is not checked. The kernel'sx86_64ISA discovery documents the opposite: it refuses a part that does not advertise an invariant TSC and warns under a hypervisor. A stranger reading the contract learns a wrong fact about a kernel the crate will no longer be able to see. The deeper problem is that a contract's BUGS section describes one kernel's behavior at all. Evidence:crates/counter_frequency_contract/src/lib.rslines 9 to 11;README.mdlines 55 to 57;kernel/src/arch/x86_64/isa.rslines 4 and 10;kernel/src/arch/x86_64/timer.rsline 5. Change: rewrite the three BUGS entries in the contract's own terms. The page carries one number for the life of a process, so the contract cannot express a counter whose rate changes after the page is written, and the writer establishes whether a given counter is invariant. A reader of a process with no mapping at the fixed address faults, by design. Drop the sentence about QEMU's code generator; it is a fact about one writer's environment. Door: two-way. Effort: XS. -
hertzreturns whatever number the page carries, and no reader in the tree applies the band. Finding:hertzanswersSome(n)for any page with the magic, sobuild_page(0)reads back asSome(0)andbuild_page(u64::MAX)asSome(u64::MAX). The review package proposes to keep that and document that the reader callsis_plausible. The readers do not:user_mode_runtime::cntfrq_checkedreturnspage.hertz()directly on both architectures, andprocess_builderrelays that number into a child's page unchecked. In nife this is safe only because the kernel asserts the band beforebuild_page; a third-party writer has no such assertion, and aSome(0)becomes a division by zero in any reader that computes seconds. Evidence:crates/counter_frequency_contract/src/lib.rslines 208 to 216;crates/user_mode_runtime/src/clock.rslines 82 to 94 and 137 to 147;crates/process_builder/src/lib.rsline 335;kernel/src/arch/x86_64/timer.rslines 257 to 267. Change, within the baseline: say athertzand in the README's contract list thathertzreturns the number as written and the band is the reader's to apply. Add one unit test pinningbuild_page(0)toSome(0)so the behavior is explicit. Havecntfrq_checkedinuser_mode_runtimeapplyis_plausiblebefore returning. The stricter alternative,hertzansweringNoneoutside the band, is compatible with a later release and the maintainer can take it then; the package already leaves this with the maintainer. Door: two-way. Effort: S (the reader change is in nife, not in the crate). -
newtruncates its address on a target narrower than 64 bits. Finding:new(virtual_address: u64)casts withas *const u8. On a 32-bit target both fixed addresses (0x7000_0000_0000and0x38_0000_0000) are aboveu32::MAX, so the cast yields address 0 and the reader dereferences a null page. This leaves every target the crate names unaffected; the three bare-metal targets are all 64-bit. It is a hole in the claim, not a defect a current user can reach. Evidence:crates/counter_frequency_contract/src/lib.rslines 106 to 122 and 175 to 179. Change: aconstassertion thatPAGE_VIRTUAL_ADDRESS <= usize::MAX as u64, so a narrow target fails to compile instead of reading address 0, and one sentence innew's safety section saying the address must be representable as a pointer on the target. Keepingu64as the parameter type is right: the kernel's mapper and the fixed constant areu64, and ausizeparameter would move the cast to every caller. Door: two-way. Effort: XS. -
The manifest's
publishcomment points into nife. Finding: thepublish = falseline citescrates/publish-allowlist.txt, a file the new repository will not hold. The dry run's citation check did not report it (BUGS). Evidence:crates/counter_frequency_contract/Cargo.tomlline 11. Change: one sentence a stranger can act on, in the shape thegenerational_tablereview settled: the line stays until the release that publishes, which this crate's own release milestone owns under the publishing hold. Door: two-way. Effort: XS. -
Documentation a stranger reads, beyond the three edits the package already assigns. Finding, four parts. (a) The
PAGE_VIRTUAL_ADDRESSdocumentation says the address-space map's table of fixed pages "should list it, and does not yet". The map's own documentation now says that above 2 GiB only this page has an assignment, so the sentence is stale, and it describes another crate's internals. (b) The same item'sName:block saysVAis the abbreviation alias, but no#[doc(alias)]attribute exists. The rule that a crate carries no alias for this tree's own earlier spelling before its first release means none should. This is the one place a later rule contradicts the baseline's text, and the move strips the block, so the fix is cosmetic on the nife side. (c)build_page's example comment promises an "aligned buffer" whilenewrequires only byte alignment; the two should agree, and byte alignment is the true requirement because the reader copies into a local array. (d)build_pageandhertzsay "the calibrated TSC rate" andnew's safety section says "everyx86_64process" and opens a sentence in lowercase; the package's proposed items 1 and 2 cover these and they belong in the same lane. Evidence:crates/counter_frequency_contract/src/lib.rslines 102, 104 to 105, 119 to 120, 124, 134, 170 to 171 and 190;crates/address_space_layout/src/lib.rslines 4 to 5. Change: delete the stale sentence and the alias sentences, say "byte-aligned" in the example, and apply the package's items 1 and 2 in the same pull request. Door: two-way. Effort: S. -
The template's next release refuses the prose. Finding: at the template's head,
check / standalonerunsprose_acronymsover the README and every doc comment at ceiling zero, andpassive_voiceover the README at two per thousand words. Over the standalone copy,prose_acronymsrefusesGHz(README line 23,src/lib.rsline 56),MHzandCSR(src/lib.rsline 50), andpassive_voicerefuses the README (six passive constructions in 392 words, which allows none). The pinned template releasev7does not run either check, so the dry run passes today; the weeklylagjob turns red when the next release lands, Dependabot opens the bump, and the bump is red until the prose changes. Evidence:crate-workflows/.github/workflows/check.ymllines 255 to 286;crates/counter_frequency_contract/README.mdlines 3, 8, 19, 23, 56 and 59;crates/counter_frequency_contract/src/lib.rslines 50 and 56. Change: write "100 kilohertz" and "100 gigahertz" in prose and keep the symbol only inside a code span where it names a value. Expand "control and status register (CSR)" at first use. Put the six README sentences into the active voice; the first is the baseline's "was written for the nife kernel" sentence, which the move lane rewrites anyway. Door: two-way. Effort: XS. -
Nothing is machine-checked, and the manifest says a model checker proves the crate's harnesses. Finding: the README says so plainly, and the package leaves a harness to the maintainer. The reader's one decision is the magic compare, and the whole value of the crate is that a frame without the magic reads as
None. A harness proving it over every 16-byte frame costs little and is the kind of claim a stranger wants checked before trusting theunsafereader. The manifest'scheck-cfgcomment says "the Kani model checker, which proves this crate's harnesses" setscfg(kani), which is not true until a harness exists. Nobody verified whether the template'sproofs / kanijob is green on a crate with no harness;falsify.pyreports "nothing to falsify" and exits 0. Evidence:crates/counter_frequency_contract/README.mdlines 45 to 48;Cargo.tomllines 20 to 21;crates/counter_frequency_contract/src/lib.rslines 185 to 216. Change: two harnesses in averificationmodule behindcfg(kani), each with a falsification patch the template replays red. The first takeshertzover an arbitrary[u8; PAGE_CONTENT_BYTES]and assertsNoneexactly when the first eight bytes differ fromMAGIC, and otherwise the little-endianu64of the next eight. The second assertsbuild_page(x).hertz() == Some(x)for an arbitraryx. The README's "What is proven" section then says what the two prove and that no proof covers the caller's mapping promise, which the package already states. The pattern isblock_roster_contract'sverificationmodule and itsfalsifications/directory. Door: two-way. Effort: S.