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

types/alpine: add fuzzer #1200

Merged
merged 1 commit into from Nov 15, 2022
Merged

types/alpine: add fuzzer #1200

merged 1 commit into from Nov 15, 2022

Conversation

AdamKorcz
Copy link
Contributor

Signed-off-by: AdamKorcz adam@adalogics.com

Summary

Adds a fuzz test for the unmarshalling of the Apk type.

Signed-off-by: AdamKorcz <adam@adalogics.com>
@AdamKorcz AdamKorcz requested review from bobcallaway and a team as code owners November 10, 2022 16:12
return
}
p := &Package{}
p.Unmarshal(bytes.NewReader(tarBytes))
Copy link
Member

Choose a reason for hiding this comment

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

Unmarshal assumes a concatenation of 3 tar.gz files with some headers removed... so is just TarBytes() the correct input to be passing?

// signature.tar.gz | control.tar.gz | data.tar.gz

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I would say it is good enough to get started since the fuzzer does not do any assertions to assess whether the function behaves correctly. I tested this locally, and it does get into the file readings of the tar archives which is great.

Wrt to leaving out the footers, I will add that as an option in go-fuzz-headers.

I plan to iterate over the fuzzer based on the feedback from OSS-Fuzz. If we get a lot of false crashes, then we can modify.

@codecov-commenter
Copy link

Codecov Report

Merging #1200 (5c56c05) into main (21e5b63) will decrease coverage by 22.23%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             main    #1200       +/-   ##
===========================================
- Coverage   64.22%   41.99%   -22.24%     
===========================================
  Files          82       74        -8     
  Lines        7625     7206      -419     
===========================================
- Hits         4897     3026     -1871     
- Misses       2100     3871     +1771     
+ Partials      628      309      -319     
Flag Coverage Δ
e2etests ?
unittests 41.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/api/metrics.go 0.00% <0.00%> (-100.00%) ⬇️
cmd/rekor-cli/app/useragent.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/api/trillian_client.go 0.00% <0.00%> (-66.31%) ⬇️
pkg/api/api.go 0.00% <0.00%> (-64.29%) ⬇️
pkg/api/entries.go 0.00% <0.00%> (-64.00%) ⬇️
pkg/types/types.go 0.00% <0.00%> (-63.64%) ⬇️
pkg/types/versionmap.go 0.00% <0.00%> (-63.42%) ⬇️
pkg/api/error.go 0.00% <0.00%> (-59.78%) ⬇️
cmd/rekor-cli/app/verify.go 2.47% <0.00%> (-53.72%) ⬇️
cmd/rekor-cli/app/log_info.go 2.50% <0.00%> (-52.50%) ⬇️
... and 46 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dlorenc dlorenc merged commit cabfc41 into sigstore:main Nov 15, 2022
@github-actions github-actions bot added this to the v1.1.0 milestone Nov 15, 2022
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

4 participants