Skip to content

TSCBasic: correct a use-after-free on Windows #232

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
Jun 28, 2021

Conversation

compnerd
Copy link
Member

This corrects a use-after-free caused by a pointer escape. The lifetime
of the pointer is not guaranteed, and the OS may free the pointer
early, particularly with OSSA. Push the handling into the closure to
ensure that the lifetime is extended for the duration.

This corrects a use-after-free caused by a pointer escape.  The lifetime
of the pointer is not guaranteed, and the OS may free the pointer
early, particularly with OSSA.  Push the handling into the closure to
ensure that the lifetime is extended for the duration.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@tomerd @abertelrud - I think that we should get this merged and then backported to 5.5. I was able to trigger this pretty consistently :-(.

@tomerd tomerd merged commit c5dd301 into swiftlang:main Jun 28, 2021
@compnerd compnerd deleted the use-after-free-escape-ossa branch June 28, 2021 17:15
@tomerd
Copy link
Contributor

tomerd commented Jun 28, 2021

@compnerd sgmt - please prepare a 5.5 patch

compnerd added a commit that referenced this pull request Jun 28, 2021
This corrects a use-after-free caused by a pointer escape.  The lifetime
of the pointer is not guaranteed, and the OS may free the pointer
early, particularly with OSSA.  Push the handling into the closure to
ensure that the lifetime is extended for the duration.
compnerd added a commit to compnerd/swift-tools-support-core that referenced this pull request Jul 19, 2021
This corrects a use-after-free caused by a pointer escape.  The lifetime
of the pointer is not guaranteed, and the OS may free the pointer
early, particularly with OSSA.  Push the handling into the closure to
ensure that the lifetime is extended for the duration.
drexin added a commit that referenced this pull request Jul 19, 2021
TSCBasic: correct a use-after-free on Windows (#232)
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