Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support specifying runtime fuzzing options in the fuzz target rule. #103

Open
stefanbucur opened this issue Jan 6, 2021 · 4 comments
Open
Labels
feature New feature or request priority:low The issue is low priority for the milestone.

Comments

@stefanbucur
Copy link
Collaborator

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 stefanbucur added feature New feature or request priority:high The issue is high priority for the milestone. labels Jan 6, 2021
@luxe
Copy link

luxe commented Sep 21, 2021

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?

@stefanbucur
Copy link
Collaborator Author

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.

@luxe
Copy link

luxe commented Oct 15, 2021

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.

@stefanbucur
Copy link
Collaborator Author

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 stefanbucur added priority:low The issue is low priority for the milestone. and removed priority:high The issue is high priority for the milestone. labels Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request priority:low The issue is low priority for the milestone.
Projects
None yet
Development

No branches or pull requests

2 participants