Skip to content

Serialization: Refine safety checks for extensions/protocols #68205

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

Conversation

tshortli
Copy link
Contributor

In #65267 deserialization safety was made more conservative, allowing deserialization of any protocol and deserialization of any extension declaring an explicit conformance to any protocol. We can refine this to only allow deserialization of safe protocols and deserialization of extensions declaring conformances to safe protocols. Importantly, though, we must look up all conformances declared by the extension, not just the explicit ones.

Resolves rdar://114673761

@tshortli tshortli requested a review from xymus August 30, 2023 03:06
@tshortli tshortli force-pushed the conformance-deserialization-safety-refinement branch from 44d8251 to 892b1bf Compare August 30, 2023 04:57
In swiftlang#65267 deserialization safety was made
more conservative, allowing deserialization of any protocol and
deserialization of any extension declaring an explicit conformance to any
protocol. We can refine this to only allow deserialization of safe protocols
and deserialization of extensions declaring conformances to safe protocols.
Importantly, though, we must look up all conformances declared by the
extension, not just the explicit ones.

Resolves rdar://114673761
@tshortli tshortli force-pushed the conformance-deserialization-safety-refinement branch from 892b1bf to 4622873 Compare August 30, 2023 04:58
@tshortli
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@xymus xymus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks much better, thanks!

@tshortli tshortli merged commit 9e91f4e into swiftlang:main Aug 30, 2023
@tshortli tshortli deleted the conformance-deserialization-safety-refinement branch August 30, 2023 16:24
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