Skip to content

Conversation

@bnbarham
Copy link
Contributor

There's a subtle stack UAF here - ~CodeCompletionResultBuilder would be called after ~ExpectedTypeContext. Fix the order they're created.

@bnbarham
Copy link
Contributor Author

@swift-ci please smoke test

@bnbarham
Copy link
Contributor Author

preset=asan
@swift-ci please test with preset macOS platform

@hamishknight
Copy link
Contributor

Also nit: shouldn't the PR title read as the following? :)

[Completion] ~ExpectedTypeContext must be called after ~CCResultBuilder

@bnbarham
Copy link
Contributor Author

bnbarham commented Aug 31, 2023

Also nit: shouldn't the PR title read as the following? :)

Hah, indeed it should 😅. I renamed that title a whole bunch of times trying to fit it in 80 characters.

There's a subtle stack UAF here - `~CodeCompletionResultBuilder` would
be called *after* `~ExpectedTypeContext` as `ExpectedTypeContext` was
defined after `CodeCompletionResultBuilder`. Fix the order they're
created to prevent this.
@bnbarham bnbarham force-pushed the fix-stack-use-after-free branch from 40c6d73 to 020f2b5 Compare August 31, 2023 16:10
@bnbarham
Copy link
Contributor Author

@swift-ci please smoke test

@rintaro
Copy link
Member

rintaro commented Aug 31, 2023

@swift-ci Please smoke test Linux

@bnbarham bnbarham merged commit 6894bd5 into swiftlang:main Sep 1, 2023
@bnbarham bnbarham deleted the fix-stack-use-after-free branch September 1, 2023 00:11
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.

4 participants