Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Correctgit_revparse_single and add revparse fuzzing#6730

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethomson merged 5 commits intomainfromethomson/revparse
Feb 6, 2024

Conversation

ethomson
Copy link
Member

  1. Introduce address sanitization during builds. Surprisingly, although we enabled various sanitizers (thread, memory, undefinedbehavior) we didnot have address sanitizer running. Add that.

  2. Address sanitizer correctly detected a failure to correctly parse capabilities in a first pkt. In our test corpus we have a message with no capabilities (the length of the message is the ref advertisement plus a trailing NUL). We walk off the end of that string trying to read capabilities. Now we honor thelen before checking for caps.

  3. Update revparse to correctly stop parsingspec when we find a trailing@. Thanks to the Amazon AWS Security team for finding and responsibly disclosing this.

Many fuzzers will need to operate with a repository; extract therepository initialization from downloads_refs_fuzzer.c into its ownutility area.
If there are no caps, don't try to advance past the first NULL to lookfor object-format. This prevents a possible out-of-bounds read.
When parsing a revspec that ends with a trailing `@`, explicitly stopparsing. Introduce a sentinel variable to explicitly stop parsing.Prior to this, we would set `spec` to `HEAD`, but were looping on thevalue of `spec[pos]`, so we would continue walking the (new) `spec`at offset `pos`, looking for a NUL. This is obviously an out-of-boundsread.Credit to Michael Rodler (@f0rki) and Amazon AWS Security.
@ethomson
Copy link
MemberAuthor

Note: this was included inv1.6.5 andv1.7.2.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@ethomson

[8]ページ先頭

©2009-2025 Movatter.jp