-
Notifications
You must be signed in to change notification settings - Fork 160
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
Fuzzing add seed, new target and remove bloat #592
Conversation
Fantastic, thank you so much @0x34d Can you fix the golangci-lint errors? If you don't feel comfortable doing it I can help! |
My bad I didn't run the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #592 +/- ##
==========================================
+ Coverage 77.97% 78.02% +0.04%
==========================================
Files 101 101
Lines 6444 6444
==========================================
+ Hits 5025 5028 +3
+ Misses 1047 1045 -2
+ Partials 372 371 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@Sean-Der ping, can you rerun the workflow? |
@0x34d you are in the org now so you can run yourself :) sorry for slowing you down |
ping for merge @hasheddan @stv0g @Sean-Der |
I think it would be nicer to put the fuzz corpus into files. The fuzzer reada them automatically from |
Done 816e084 and leave others as they are. |
) | ||
|
||
func FuzzUnmarshalBinary(f *testing.F) { | ||
TestResumeClient, err := os.ReadFile("testdata/seed/TestResumeClient.raw") |
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.
Please have a look at the Go fuzzing tutorial
The Go fuzzing enging has built-in support for reading files from the testdata
directory.
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.
Oh, My bad https://go.dev/security/fuzz/#glos-seed-corpus
and the files in the testdata/fuzz/{FuzzTestName} directory within the package
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.
Oh, My bad https://go.dev/security/fuzz/#glos-seed-corpus
and the files in the testdata/fuzz/{FuzzTestName} directory within the package
For a minute, I thought I was wrong.
Anything within testdata/fuzz/{FuzzTestName}
is a crash and cannot be accepted as a seed for fuzzing. So, yes, my previous commit
was on point.
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.
Hey @0x34d, I am not so sure about it.
According to the Go fuzzing documentation, both f.Add()
and the files in testdata
are used to seed the corpus:
seed corpus: A user-provided corpus for a fuzz test which can be used to guide the fuzzing engine. It is composed of the corpus entries provided by f.Add calls within the fuzz test, and the files in the testdata/fuzz/{FuzzTestName} directory within the package. These entries are run by default with go test, whether fuzzing or not.
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.
According to the Go fuzzing documentation, both f.Add() and the files in testdata are used to seed the corpus:
No, it's not. I already tried it. This was the whole reason for this comment #592 (comment)
testdata
is for reproducing crashes.
Signed-off-by: Arjun Singh <ajsinghyadav00@gmail.com>
ping |
Description
Add more
go-fuzz
tests, add input seed and remove bloat.Bug found: #591
Run: