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

Improve fuzzing speed and stack trace accuracy #6851

Merged

Conversation

Smjert
Copy link
Member

@Smjert Smjert commented Dec 26, 2020

Add a special define when osquery is built for fuzzing.

With that is possible to enable code that ignores
changing log levels.
With the config fuzzer, even if the fuzzer code was settings
the minloglevel to 4, that was immediately changed by the osquery logic.

Do not run queries parsed from the config to improve
the config fuzzer performance and avoid oom issues.

When built for fuzzing, compile osquery and libraries
without optimizing the frame pointer away.
This in some cases improves the accuracy of the stack trace
presented when a bug is found.


The config fuzzer was getting stuck on queries that would take all the time available to run, or would consume more than 2.5GB of memory, which is the limit oss-fuzz uses.
With Valgrind in front, instead of ASAN, a simple one line query with a join on all columns would consume 16GB+ of memory.

Add a special define when osquery is built for fuzzing.

With that is possible to enable code that ignores
changing log levels.
With the config fuzzer, even if the fuzzer code was settings
the minloglevel to 4, that was immediately changed by the osquery logic.

Do not run queries parsed from the config to improve
the config fuzzer performance and avoid oom issues.

When built for fuzzing, compile osquery and libraries
without optimizing the frame pointer away.
This in some cases improves the accuracy of the stack trace
presented when a bug is found.
@Smjert Smjert added performance oss-fuzz Issues related to integrations with oss-fuzz. labels Dec 26, 2020
@theopolis theopolis merged commit d8c3938 into osquery:master Dec 26, 2020
@mike-myers-tob mike-myers-tob deleted the stefano/improvement/fuzzers-speed branch January 5, 2021 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oss-fuzz Issues related to integrations with oss-fuzz. performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants