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

More useful output on NEW_FUNC -- include function names #4

Closed
alex opened this issue Dec 3, 2020 · 3 comments
Closed

More useful output on NEW_FUNC -- include function names #4

alex opened this issue Dec 3, 2020 · 3 comments

Comments

@alex
Copy link

alex commented Dec 3, 2020

libFuzzer will print a handy NEW_FUNC output when running to show the first time it executes a new function. This is very helpful when developing a fuzzer to get a sense of the coverage you're achieving. Unfortunate with atheris, it seems to always be address only -- no function name:

#201019 NEW    cov: 7502 ft: 11769 corp: 91/1040b lim: 32 exec/s: 665 rss: 44Mb L: 24/32 MS: 3 ChangeBinInt-ChangeBit-ShuffleBytes-
        NEW_FUNC[1/2]: 0x238e9e5
        NEW_FUNC[2/2]: 0x238e9e9

I imagine this will require some wiring up to get libFuzzer to know about Python function names, but if there were a way to make it work, that'd be a boon for fuzzer development.

@TheShiftedBit
Copy link
Contributor

I think this should be possible when fuzzing pure Python, simply by providing the right symbolizer symbols. I'll have to ensure that this doesn't break native symbolization though.

@TheShiftedBit
Copy link
Contributor

Done. Pushed a change that replicates the NEW_FUNC feature from libFuzzer as NEW_PY_FUNC; this means Atheris will print data about some new functions when it discovers them.

Initially, I implemented this by providing a definition of __sanitizer_symbolize_pc, which taught libFuzzer how to print this information itself. However, said function is not called when using a sanitizer that provides its own definition of that function. This simpler approach therefore seems better.

@alex
Copy link
Author

alex commented Dec 10, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants