From a8b104d77a52e0f83c74861a580692af1d0531d7 Mon Sep 17 00:00:00 2001 From: DevomB Date: Thu, 29 Oct 2026 03:05:32 -0700 Subject: [PATCH] The broker fuzz target builds again, and a pull request that touches the parsers builds both The weekly run of 2026-10-25 (40178127805) failed before fuzzing: broker_request.rs matches every broker::Request, and the `stick` request the USB stick grant added on 2026-10-13 had no arm, so the target no longer compiled. `stick` takes no argument, as `version` does, so it joins that arm. Nothing built the targets between weekly runs, which is how the break went unseen for twelve days. A pull request that touches kryptikd's sources, wlproxy or the fuzz crates now runs `cargo fuzz build` for both, on the same pinned nightly, without fuzzing. --- .github/workflows/fuzz.yml | 14 ++++++++++++++ compartments/kryptikd/fuzz/broker_request.rs | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index b4b832ccd..29e3a7905 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -1,11 +1,19 @@ name: Fuzz # Coverage-guided fuzzing of the two parsers of zone bytes (docs/design/broker.md), weekly on a pinned nightly. +# A pull request that touches their code builds both targets without fuzzing them, so a new request +# variant the harness does not match fails there, not on the next weekly run. on: schedule: - cron: '0 4 * * 0' workflow_dispatch: + pull_request: + paths: + - 'compartments/kryptikd/src/**' + - 'compartments/kryptikd/fuzz/**' + - 'compositor/wlproxy/**' + - '.github/workflows/fuzz.yml' permissions: contents: read @@ -59,8 +67,14 @@ jobs: fi echo "$(find "$RUNNER_TEMP/corpus" -type f | wc -l) seeds" + - name: The target builds + if: github.event_name == 'pull_request' + working-directory: ${{ matrix.dir }} + run: cargo fuzz build --sanitizer none "$FUZZ_TARGET" + # Safe Rust throughout, so no sanitizer: panics, overflow checks and the harness's asserts are the oracle. - name: Twenty minutes of fuzzing + if: github.event_name != 'pull_request' working-directory: ${{ matrix.dir }} run: cargo fuzz run --sanitizer none "$FUZZ_TARGET" "$RUNNER_TEMP/corpus" -- -max_total_time=1200 -max_len="$MAX_LEN" -timeout=10 -print_final_stats=1 diff --git a/compartments/kryptikd/fuzz/broker_request.rs b/compartments/kryptikd/fuzz/broker_request.rs index 3012a5111..dfa6e5bfc 100644 --- a/compartments/kryptikd/fuzz/broker_request.rs +++ b/compartments/kryptikd/fuzz/broker_request.rs @@ -11,7 +11,7 @@ fuzz_target!(|data: &[u8]| { let Some(nl) = data.iter().position(|b| *b == b'\n') else { return }; let header = String::from_utf8_lossy(&data[..nl]); match parse_request(&header) { - Err(_) | Ok(Request::Version | Request::ClipboardGet | Request::UpdatePoll) => {} + Err(_) | Ok(Request::Version | Request::ClipboardGet | Request::UpdatePoll | Request::Stick) => {} Ok(Request::ClipboardSet { mime, len }) => assert!(MIME_TYPES.contains(&mime.as_str()) && len <= CLIPBOARD_MAX), Ok(Request::Transfer { dest, name }) => { assert!((1..=12).contains(&dest.len()));