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

fuzz: Add support for fuzzing #1716

Merged
merged 13 commits into from Dec 8, 2022
Merged

fuzz: Add support for fuzzing #1716

merged 13 commits into from Dec 8, 2022

Conversation

silvergasp
Copy link
Contributor

Adds support for fuzzing with basic a cdc fuzzer.

Describe the PR
This fuzz harness adds the necessary build infrastructure for fuzzing tinyusb. As a proof of concept there is a cdc fuzz harness written in c++. The intention of this PR is to improve security and robustness of the tinyusb stack by tracking down bugs and performance problems using fuzz testing.

@silvergasp
Copy link
Contributor Author

I admit that I'm not sure what I've broken with the CI. I don't think I touched anything to do with the rp2040 configs. I'll just double-check in case there is something I missed.

@silvergasp
Copy link
Contributor Author

Ok, I don't think I've missed anything, perhaps it's a flake?

@silvergasp
Copy link
Contributor Author

I think I fixed the ci flake for the rp2040 in #1731.

@hathach
Copy link
Owner

hathach commented Dec 5, 2022

I think I fixed the ci flake for the rp2040 in #1731.

Sorry for super later response, sometime CI just break due to network/bandwidth issue since I have tried to run too many concurrent jobs (each for 1 supported mcu). It happens now and then, and often is fixed by re-run the failed workflow. I guess #1731 isn't related, sorry for not be able to response to this question of your in time.

I am learning fuzzing and basically try to catch up with your PR and making a good progress. The more I learn about fuzzing, the more I want to integrate it (i.e merging this PR). Thank you very much for making such a brilliant PR. Hopefully we could merge this soon enough (for real this time).

@silvergasp
Copy link
Contributor Author

Not a problem, feel free to ask any questions here

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

superb !! thank you very much for your time and effort (as well as your patient). Fuzzing is a realy useful/helpful testing for detecting memory overflow/leak issues. Which help to improve tinyusb a lot in the long run. And it indeed catch an overflow issue with tusb fifo. Thank you very much for introducing and adding harness.

PS: I have move fuzz into test/fuzz and integrate build fuzzer into pre-commit since it is quick to run on linux host, so it kind of make sense to bundle them together to save concurrent ci instances.

@hathach hathach merged commit d4620d9 into hathach:master Dec 8, 2022
@silvergasp
Copy link
Contributor Author

Not a problem, glad I could help. I'll put up a few more fuzz harnesses for the remaining device classes shortly.

@hathach
Copy link
Owner

hathach commented Dec 9, 2022

Not a problem, glad I could help. I'll put up a few more fuzz harnesses for the remaining device classes shortly.

thanks again :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants