-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Runtime: Only demangle symbolic references in constant memory. #17405
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
Runtime: Only demangle symbolic references in constant memory. #17405
Conversation
@swift-ci Please test |
@swift-ci Please benchmark |
Build failed |
Build comment file:Build failed before running benchmark. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! LGTM
493ac30
to
515b065
Compare
@swift-ci Please test |
515b065
to
fd3e209
Compare
@swift-ci Please test |
Build failed |
Build failed |
This provides a slight amount of defense against attackers constructing mangled names with offsets crafted to JOP the runtime into attacker-controlled code. (Someone could still find some random code or constant data artifact in a binary that *looks* like a mangled string with symbolic references and theoretically attack that way, but they at least wouldn't be able to construct their own string entirely.)
fd3e209
to
99842f9
Compare
@swift-ci Please test |
Build failed |
Build failed |
Why is this using an availability check instead of a weak import check? Did you verify that the symbol reference to |
Ah, I see it's not declared with availability attributes in the dyld headers. I'll fix that. |
This provides a slight amount of defense against attackers constructing mangled names with offsets crafted to JOP the runtime into attacker-controlled code. (Someone could still find some random code or constant data artifact in a binary that looks like a mangled string with symbolic references and theoretically attack that way, but they at least wouldn't be able to construct their own string entirely.)