Skip to content

Fix an OOB read in the demangler #31793

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

Merged
merged 1 commit into from
May 15, 2020

Conversation

tbkka
Copy link
Contributor

@tbkka tbkka commented May 14, 2020

A malformed mangled name that ends in a truncated symbolic
reference could trigger a read beyond the end of the name.
This is because the code that grabs the next four bytes
bypasses the existing bounds checks. Insert an explicit
bounds check to guard against this.

Resolves rdar://63128221

A malformed mangled name that ends in a truncated symbolic
reference could trigger a read beyond the end of the name.
This is because the code that grabs the next four bytes
bypasses the existing bounds checks.  Insert an explicit
bounds check to guard against this.
@tbkka
Copy link
Contributor Author

tbkka commented May 14, 2020

@swift-ci Please test

@tbkka tbkka requested a review from DougGregor May 14, 2020 20:28
@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d476247

@tbkka
Copy link
Contributor Author

tbkka commented May 15, 2020

@swift-ci Please test Linux

@tbkka tbkka requested a review from mikeash May 15, 2020 16:30
@tbkka tbkka merged commit a70e606 into swiftlang:master May 15, 2020
valeriyvan pushed a commit to valeriyvan/swift that referenced this pull request May 16, 2020
A malformed mangled name that ends in a truncated symbolic
reference could trigger a read beyond the end of the name.
This is because the code that grabs the next four bytes
bypasses the existing bounds checks.  Insert an explicit
bounds check to guard against this.
@tbkka
Copy link
Contributor Author

tbkka commented May 18, 2020

@swift-ci Please test Linux

tbkka added a commit to tbkka/swift that referenced this pull request May 22, 2020
A malformed mangled name that ends in a truncated symbolic
reference could trigger a read beyond the end of the name.
This is because the code that grabs the next four bytes
bypasses the existing bounds checks.  Insert an explicit
bounds check to guard against this.
tbkka added a commit that referenced this pull request Jul 6, 2020
A malformed mangled name that ends in a truncated symbolic
reference could trigger a read beyond the end of the name.
This is because the code that grabs the next four bytes
bypasses the existing bounds checks.  Insert an explicit
bounds check to guard against this.
@tbkka tbkka deleted the tbkka-rdar63128221-demangler-OOB branch October 16, 2020 00:32
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.

3 participants