ci: nightly fuzz job for fuzz/ (PR #103 harness) - fix build+run container #106
Loading…
Reference in a new issue
No description provided.
Delete branch "wt/t_16e835ef"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rework the fuzz CI job so it passes.
Problem: The fuzz job's two CI steps ran in separate Docker containers. Step 1 installed
cargo-fuzzinto/usr/local/cargo/bin(ephemeral - only/usr/local/cargo/registryis volume-mounted) and built+listed the targets. Step 2 was a fresh container wherecargo-fuzzwas not installed, sobash run-fuzz.shfailed witherror: no such command: 'fuzz'.Fix: Merge the nightly toolchain + cargo-fuzz install +
cargo fuzz build+cargo fuzz list+bash run-fuzz.shinto a single container step so the installed binary and the built targets persist across the run. Also keep the/target/tmpmkdir from1b2c63b(rustup needs it for its temp dir when TMPDIR=/target/tmp).This PR also contains a throwaway crash-test commit (
b76bf46,panic!()injected into qr_decode) to prove acceptance criterion #2 - the job must go red when a target crashes. Revert that commit before merging.CI result to verify: the fuzz job runs all 4 targets for 15s each with crashes=0/0/0, and
cargo +nightly fuzz listlists all 4 targets.Four pure parsers eat untrusted peer input and had no structured fuzzing: - ratchet_frame -> RatchetState::from_bytes + RatchetState::decrypt (the 'rat ' frame parser: prefix, version, length, N/PN bounds, DH step, AEAD open) - qr_decode -> qr::decode on pasted/scanned invite strings - dispatch_classify -> dispatch::classify on raw decrypted plaintext, including the 'rat ' -> Kind::Ratchet routing arm - file_decode -> file::decode on 'fil ' chunk frames No src/ change: every target calls the shipped public API. The fuzz crate is its own workspace (empty [workspace] table), so no root Cargo.toml dependency is added and cargo build/test at the root never compiles it. Seeds in fuzz/seeds/ are committed and copied into the gitignored working corpus by scripts/run-fuzz.sh; each target asserts properties a panic-free decode must hold (a rejected ratchet frame leaves the state byte-identical, a decoded invite is 32/32/onion-shaped, a decoded chunk re-encodes). Verified: cargo +nightly fuzz list -> 4 targets; scripts/run-fuzz.sh with FUZZ_SECS=60 FUZZ_JOBS=4 -> exit 0, oom/timeout/crash: 0/0/0 for all four, fuzz/artifacts/* empty.