rules_fuzzing icon indicating copy to clipboard operation
rules_fuzzing copied to clipboard

Support specifying runtime fuzzing options in the fuzz target rule.

Open stefanbucur opened this issue 5 years ago • 4 comments

The initial set of options should include the maximum input length. That seems to be referenced in a number of fuzz targets in GRPC, for example.

stefanbucur avatar Jan 06 '21 14:01 stefanbucur

It seems like options_file was added to the provider? What do we need to do next to get it available for cc_fuzz_test?

luxe avatar Sep 21 '21 01:09 luxe

Apologies for the delay! This feature is currently deprioritized, because the consensus in our discussions with OSS-Fuzz is that the file should actually not be needed for the vast majority of purposes.

Can you share more info about your use case? I'm happy to reconsider the prioritization if there is functionality that can't be achieved without an options file.

stefanbucur avatar Oct 15 '21 01:10 stefanbucur

I was looking for a way to set the maximum input length. Seems minor now that I changed the code to if (len > max) {return;}. Still seems like it wasting cycles though on large inputs.

luxe avatar Oct 15 '21 01:10 luxe

I was looking for a way to set the maximum input length. Seems minor now that I changed the code to if (len > max) {return;}. Still seems like it wasting cycles though on large inputs.

Ah, for that particular use case OSS-Fuzz actually recommends using the approach you just mentioned: https://google.github.io/oss-fuzz/getting-started/new-project-guide/#input-size

I believe this should not affect much the performance of the fuzzing engine - IIRC, libFuzzer will also not end up generating large inputs unless it observes they bring a coverage increase. With an early return statement like this one, it should not generate large inputs at all.

Do you happen to run on a seed corpus of large files? That might explain why the fuzzer attempts to generate large inputs.

stefanbucur avatar Oct 15 '21 02:10 stefanbucur