Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upadler32 check in fuzz target interferes with fuzzing #29
Comments
This comment has been minimized.
This comment has been minimized.
|
Checksum validation happens at the very end, after decoding, so I'm not sure how that would be blocking anything. Could probably add a flag to disable it though, more fuzzing coverage won't hurt in any case. Didn't do much with the fuzzing code for a long time due to a rustc bug that triggered an LLVM assertion, but that's been fixed now. What's there currently is very basic, so adding your fuzzing corpus sounds like a good idea. We should be fuzzing streaming decoding as well. I've been working on adding some basic coverage tests ported from zlib-ng, which I will commit soon. |
This comment has been minimized.
This comment has been minimized.
|
Here are the fuzzing seeds, with and without zlib headers respectively. You will probably want to minify them before running the fuzzing. Just don't forget to add these to your fuzzing set and minify again after adding any new features. min_starting_points.tar.gz |
oyvindln
added
enhancement
help wanted
good first issue
labels
Jul 13, 2018
This comment has been minimized.
This comment has been minimized.
|
Thanks. As miniz_oxide seems to have made its way into gecko, getting a proper fuzzing setup has become even more important. |
Shnatsel
referenced this issue
Jul 17, 2018
Merged
Disable adler32 when fuzzing, add fuzzing seeds #31
This comment has been minimized.
This comment has been minimized.
|
I've disabled checksum verification and run the existing "inflate_nonwrapping" fuzz target through a total of over 1 billion iterations under afl-fuzz, honggfuzz and cargo-fuzz. That found no panics, crashes or memory leaks, including under address sanitizer. Kudos! I've opened a pull request to disable alder32 and add the fuzzing seeds to kickstart future fuzzing. |
oyvindln
closed this
in
#31
Jul 17, 2018
This comment has been minimized.
This comment has been minimized.
|
That sounds promising, nice work! Next up we should probably add some more fuzzing targets for different flags and for streaming configuration. |
Shnatsel commentedJun 28, 2018
•
edited
The fuzz target currently invokes
miniz_oxidelike this:miniz_oxide/fuzz/fuzz_targets/inflate_nonwrapping.rs
Line 7 in 01a5712
It does not seem to disable alder32 checks. Because of checksum verification fuzzers cannot reach the actually interesting decoding code.
Rust fuzzer integration provides special configuration option
fuzzingwhich is set when a binary is built with fuzzing instrumentation; you can use it to disable checksums via conditional compilation (example from lodepng-rust). Alternatively, you can adapt your fuzzing target to set the required configuration parameters to disable checksum verification (inflate crate provides a *_no_checksum function).cc @oyvindln who has authored the fuzz target.
I can also provide you with an initial fuzzing corpus to kickstart fuzzing, both with and without zlib headers, obtained by fuzzing
inflatecrate with afl-fuzz, libfuzzer and honggfuzz. If you're interested, let me know and I'll attach it here.honggfuzz-rs provides further documentation, including enabling sanitizers to catch bugs in code under
unsafe. Or ping me or https://github.com/rust-fuzz if you have any questions regarding fuzzing.