Testing: Introduced continuous fuzzing #3031
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR introduces fuzzing for Loki. Fuzzing is a way of testing applications whereby pseudo-random data is passed to a target function with the goal of finding bugs and vulnerabilities. The fuzzer in this PR is implemented with the go-fuzz fuzzing engine.
I have worked on setting continuous fuzzing up for these two fuzzers which will allow them to run for longer and find harder-to-find bugs as well. I will shortly set up the integration for Loki on OSS-fuzz, and upon merging the fuzzer here, it will be able to run continuously through OSS-fuzz. OSS-fuzz is a free service for open source projects, and if/when bugs are found, maintainers get notified with an email containing a link to a detailed bug report with stacktrace and reproducer test-case. While it is a free service it is offered with an implied expectation that bugs are fixed, so that the resources spent on fuzzing Loki go towards resolving bugs in the codebase.
All that is needed to setup continuous fuzzing would be at least one maintainer email address.
For some examples of previous bugs found from fuzzing Golang projects I recommend checking out the trophy list on the go-fuzz repository: https://github.com/dvyukov/go-fuzz#trophies