[5.1] Compatibility50: Backport objc_getClass hook patch. #27037
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: Applies the security fix from #27015 for rdar://problem/54724618 so that binaries built to deploy back to Swift 5.0 are not vulnerable to malformed class names getting passed into objc_getClass. This is a toolchain fix that does not requiring updating the runtime in the OS.
Scope: Possible security hole if untrusted strings can be fed to NSClassFromString on Swift 5.0 runtimes
Issue: rdar://problem/55036306
Risk: Low
Testing: Swift CI, locally tested on macOS 10.15 beta and 10.14.6
Reviewed by: @mikeash