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

Buffer parser fuzzing #2496

Merged
merged 2 commits into from
Jan 28, 2020
Merged

Conversation

cryptocode
Copy link
Contributor

Alternative to #2106 which was based on fuzzing through udp. The same approach doesn't work for tcp because of state, and because it'll disconnect on bad data.

Combine NANO_FUZZER_TEST with a sanitizer such as ASAN, and RelWithDebugInfo.

This PR is more limited and tests buffer parsing for live messages - coverage thus also includes vote/block uniquer. It seems to reliably catch any manually introduced memory issues in those areas with ASAN on.

I propose we add fuzzer binaries for additional areas we wanna cover in separate PRs.

With NANO_FUZZER_TEST on, work_value is conditionally compiled to always succeed.

It's a bit of a challenge to build with libFuzzer on some platforms, i.e on latest clang on macos I had to symlink libclang_rt.fuzzer_osx.a from llvm 7.0 installed via brew - lemme know if there are better ways to deal with this.

@cryptocode cryptocode added the sanitizers Related to thread, address or undefined sanitizers label Jan 19, 2020
@cryptocode cryptocode self-assigned this Jan 19, 2020
@zhyatt zhyatt added this to the V21.0 milestone Jan 20, 2020
@cryptocode cryptocode merged commit d41d4c5 into nanocurrency:develop Jan 28, 2020
@cryptocode cryptocode deleted the fuzzer-buffer branch January 28, 2020 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sanitizers Related to thread, address or undefined sanitizers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants