-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add fuzzing application for gcoap #13898
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I like how the more examples will make it easier to write new fuzz tests.
Please add a comment to the sock inserts so they keep doing the right thing should those parts get refactored.
This is unrelated but I've noticed |
AFL has it's own parallel fuzzing setup. See: |
@nmeum ping 😉 |
This is a perquisite for fuzzing applications using sock_async_event.
Sorry, been very busy with other things lately. Pushed a few additional commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
Having thought about this further commit 7d1cf1d is probably not needed since |
Well feel free to drop it then 😉 |
Contribution description
Based on #13157, this PR adds a fuzzing application for the
gcoap
module. Since it's initial implementation in 2019 thegcoap
module switched to usingsock_async_event
. For this reason, this PR also includes an implementation of a fuzzing termination condition forsock_async_event
. After the callback has been invoked, the code checks if the previous packet returned bygnrc_sock_recv
was the fuzzing packet, if so the fuzzing application is terminated.Testing procedure
One function tested extensively by this fuzzing application is
coap_parse()
. As such, this fuzzing application would have been capable of finding #10753. To test this, remove the following code from thecoap_parse()
function:RIOT/sys/net/application_layer/nanocoap/nanocoap.c
Lines 111 to 114 in b6be8af
Afterwards run:
AFL should discover a crash, in the modified code branch, within a few minutes.
Issues/PRs references