Repository navigation
Conversation
When a callback raises during SSLSocket#connect or #accept, the stored callback state is kept, and the next SSLSocket#sysread or #syswrite calls rb_jump_tag() with the stored callback state and crashes the VM. Clear the callback state in ossl_start_ssl() before rb_jump_tag(). Co-authored-by: Claude Mythos 5.2 <noreply@anthropic.com>
Member
|
Thanks for spotting this! I'm closing this PR since it would cause conflicts with #1080, which will remove the ivar
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a callback raises during
SSLSocket#connectorSSLSocket#accept, the socket keeps the stored callback state. Since aac9ce1 (#821), the nextSSLSocket#sysreadorSSLSocket#syswriteon the socket callsrb_jump_tag()with the stored callback state while no exception is pending, and the VM crashes.Releases from 3.3.0 on likewise crash.
Fix
ossl_start_ssl()now clears the stored callback state before callingrb_jump_tag().ossl_ssl_read()andossl_ssl_write()already clear the stored callback state before callingrb_jump_tag(). Thesyswritein the example raisesOpenSSL::SSL::SSLError.