Skip to content

[5.7][RemoteMirror] Add bounds checking to BitMask operations. #58525

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
Apr 29, 2022

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Apr 29, 2022

Cherry-pick #58507 to 5.7.

If we encounter any multi-paylaod enum descriptors with bad data, we can end up writing off the end of the bitmask allocation, causing heap corruption. Add range checks to let us fail gracefully instead.

rdar://91423283

@mikeash mikeash requested a review from tbkka April 29, 2022 14:19
@mikeash mikeash requested a review from a team as a code owner April 29, 2022 14:19
@mikeash
Copy link
Contributor Author

mikeash commented Apr 29, 2022

@swift-ci please test

If we encounter any multi-paylaod enum descriptors with bad data, we can end up writing off the end of the bitmask allocation, causing heap corruption. Add range checks to let us fail gracefully instead.

rdar://91423283
(cherry picked from commit a6de05b298278f5d3cc6e6f4b98994a458c28f47)
@mikeash mikeash force-pushed the bitmask-range-checks-5.7 branch from cb91b32 to 278edd0 Compare April 29, 2022 16:59
@mikeash
Copy link
Contributor Author

mikeash commented Apr 29, 2022

@swift-ci please test

@mikeash mikeash merged commit 9d39b4b into swiftlang:release/5.7 Apr 29, 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.

2 participants