edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
Lane fuzzvpx: cargo-fuzz targets for ec-vp8 and ec-vp9
Goal: DONE.md gate 2, one cargo-fuzz target per untrusted VP8/VP9 entry point, smoke-run on
the servers. Base sha: 3e6d0111 (main).
What changed
Cargo.toml(root):exclude = ["crates/*/fuzz"]added to[workspace].crates/ec-vp8/fuzz/Cargo.toml: packageec-vp8-fuzz,cargo-fuzz = true,libfuzzer-sys 0.4, path dep onec-vp8,[workspace] members = ["."].fuzz_targets/decode_frame.rs: one frame throughec_vp8::decode::Decoder::decode.fuzz_targets/decode_ivf.rs: whole IVF throughec_vp8::stream::decode_stream.seed.sh: rebuildscorpus/fromfixtures/vp8/*.ivf(frames and whole/prefix IVFs)..gitignore:corpus/,artifacts/.
crates/ec-vp9/fuzz/Cargo.toml: packageec-vp9-fuzz, same shape, path dep onec-vp9.fuzz_targets/decode_frame.rs: the whole input as one frame/superframe on a freshDecoder, then the same bytes cut at 2 or 3 points (cut points chosen from the first byte) and decoded in order on oneDecoderto exercise inter state.fuzz_targets/decode_stream.rs: whole IVF throughec_vp9::stream::decode_stream.seed.sh: rebuildscorpus/fromfixtures/vp9/*.ivfandcrates/ec-vp9/tests/data/*.ivf..gitignore:corpus/,artifacts/.
Seed corpus sizes (generated locally, not committed): vp8 95 frames + 14 IVFs; vp9 113 frames
- 13 IVFs.
Commands
Build (both crates, on a server):
scripts/remote-run.sh fuzzvpx -- bash -c 'cd crates/ec-vp8 && cargo +nightly fuzz build'
(and the same for crates/ec-vp9): both built clean.
Smoke runs (each target, 120 s):
cargo +nightly fuzz run <t> -- -max_total_time=120 -rss_limit_mb=3000 -timeout=10
run from crates/<crate>/ inside scripts/remote-run.sh fuzzvpx.
Smoke results
| target | runs | result |
|---|---|---|
ec-vp8 decode_frame |
stopped early | CRASH (see below) |
ec-vp8 decode_ivf |
1195 in 124 s | pass, exit 0 |
ec-vp9 decode_frame |
8722 in 121 s | pass, exit 0 |
ec-vp9 decode_stream |
2399 in 121 s | pass, exit 0 |
Crash: ec-vp8 decode_frame
- libFuzzer:
deadly signal(exit 77) after a panic atcrates/ec-vp8/src/mc.rs:72:5, which is the firstdebug_assert!(vis_w >= 1 && vis_h >= 1)inmc::extend_plane. The reference frame extension (decode.rs:489-491) reaches it with a zero-width or zero-height plane. The likely source is a key-frame header with a zero dimension that the decoder accepts (not verified; the decoder was not touched). - Reproducer (base64, 32 bytes,
crash-4060390d42f351775b974bd9b72e3e9f647c000eon the server undercrates/ec-vp8/fuzz/artifacts/decode_frame/):EAIAnQEqEBAAAAAHCIWFiIWEiAAoEABgawD+/zGrUIA= - Per DONE.md this crash must become a regression test once the decoder is fixed. Not done here: the decoder is out of scope for this lane. Fix belongs to an ec-vp8 decoder lane. The artifact is gitignored and stays on the host.
Not run
- Full 1 CPU-hour per target (DONE.md item 2). Only the 120 s smoke was run.
cargo clippyon the fuzz crates: they are outside the main workspace and not part of the-D warningsgate.
Left
- Fix the ec-vp8
extend_planezero-size path (decoder side) and add the regression test. - Longer runs (1 CPU-hour each) once the vp8 crash is fixed.