Skip to content

test(fuzz): add buffered_map fuzz target + UTS-18 regression corpus - #5590

Merged
oferchen merged 1 commit into
masterfrom
test/edg-panic-4-buffered-map-fuzz-corpus
Jun 11, 2026
Merged

oferchen merged 1 commit into
masterfrom
test/edg-panic-4-buffered-map-fuzz-corpus

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds libFuzzer target fuzz/fuzz_targets/buffered_map.rs that drives transfer::map_file::BufferedMap through both UTS-18 panic sites (load_window overlap-shrink + map_ptr slice index) via the public MapStrategy::map_ptr entry point all four untrusted callers share. Coverage locks in the fail-loud guards from PR fix(transfer): turn buffered map_file out-of-range panic into Err #5566 and the window_len clamp from PR fix(transfer): clamp window_len to remaining file bytes in load_window #5569 so a regression in either path surfaces as a nightly fuzz-coverage finding instead of waiting on a real crash report.
  • Ships three deterministic corpus seeds under fuzz/corpus/buffered_map/ derived from the UTS-18 trigger scenarios: uts_18_overlap_shrink.bin mirrors the production crash math (file=48128, MAX_MAP_SIZE=262144); uts_18_truncated.bin covers the 48-byte header boundary; uts_18_zero_len.bin covers the len == 0 short-circuit in map_ptr.
  • Wires buffered_map into .github/workflows/fuzz-coverage-report.yml matrix (auto-discovery in fuzz-coverage.yml smoke run picks it up automatically) and documents the harness + seeds in docs/audits/edg-panic-4-buffered-fuzz.md.

Test plan

  • CI fuzz-coverage smoke run (fuzz-coverage.yml) auto-discovers buffered_map via ls fuzz/fuzz_targets/ and exits cleanly.
  • Nightly fuzz-coverage-report.yml includes a buffered_map matrix entry and uploads coverage/buffered_map.lcov to the run artifacts.
  • cargo +nightly fuzz build buffered_map succeeds against the transfer crate's default-features = false build (no new fuzz-crate dependencies beyond the already-pinned libfuzzer-sys and tempfile).
  • All three corpus seeds replay through the target without panic: cargo +nightly fuzz run buffered_map fuzz/corpus/buffered_map -- -runs=0.

Locks coverage of the UTS-18.f / UTS-18.g panic class in
`transfer::map_file::BufferedMap` closed by PR #5566 (fail-loud
`copy_within` + slice guards) and PR #5569 (`window_len` clamp at the
source). Future regressions in `load_window` overlap-shrink or
`map_ptr` slice bounds surface as nightly fuzz-coverage findings instead
of waiting on a real crash report.

- New libFuzzer target `fuzz/fuzz_targets/buffered_map.rs` drives both
  panic sites through the public `MapStrategy::map_ptr` entry. Six u64
  LE words at the head of each input parametrize `(file_size,
  window_size, request_start/len, second_start/len)`; remaining bytes
  tile the synthetic basis file. Two `map_ptr` calls per input cover
  the empty-cache load path and the forward-overlap branch of
  `load_window`.
- Three deterministic corpus seeds under `fuzz/corpus/buffered_map/`:
  `uts_18_overlap_shrink.bin` mirrors the production crash math
  (file=48128, MAX_MAP_SIZE=262144); `uts_18_truncated.bin` covers the
  48-byte header boundary; `uts_18_zero_len.bin` covers the `len == 0`
  short-circuit.
- `buffered_map` wired into `.github/workflows/fuzz-coverage-report.yml`
  matrix so the nightly run uploads lcov for the new target.
- Audit note at `docs/audits/edg-panic-4-buffered-fuzz.md`.
@oferchen
oferchen force-pushed the test/edg-panic-4-buffered-map-fuzz-corpus branch from 1b935d2 to 6d273b4 Compare June 10, 2026 19:03
@github-actions github-actions Bot added the test label Jun 10, 2026
@oferchen
oferchen merged commit d5eca44 into master Jun 11, 2026
62 checks passed
@oferchen
oferchen deleted the test/edg-panic-4-buffered-map-fuzz-corpus branch June 11, 2026 03:11
oferchen added a commit that referenced this pull request Aug 24, 2026
…fuzz-corpus

test(fuzz): add buffered_map fuzz target + UTS-18 regression corpus
oferchen added a commit that referenced this pull request Aug 24, 2026
UTS-18.j: extend URV-1 attestation with the basis-window panic chain
discovered after the original codec-only audit cleared the file.
Document the three follow-on regressions (window_len overstatement,
buffer.resize overlap-shrink, bare slice index on misaligned chunk
requests) and the remediation PRs (#5566, #5569, #5588, #5590, #5627).

UTS-18.i: keep `compress-zlib-insert` out of the upstream-testsuite
known-failures list so the workflow's wildcard run surfaces any
regression as an UNEXPECTED FAIL. The cell already iterates
`$suitedir/*.test`, so explicit wiring is the explanatory comment in
`tools/ci/upstream_testsuite_known_failures.conf` plus the
attestation-doc cross-reference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant