diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-04-15 12:06:01 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-04-16 20:07:10 +0900 |
commit | c4030a10535232988bf597759278f700d82f104b (patch) | |
tree | aa7b001dfadec9435c6fe542700e82dcb7fa24d1 /bootstraptest/test_gc.rb | |
parent | 1826991f26249735e29b06778723f4808f0ee1dc (diff) | |
download | ruby-c4030a10535232988bf597759278f700d82f104b.tar.gz |
ext/openssl: make OpenSSL::SSL::SSLSocket non-reusable
Fix the segmentation fault due to use after free of SSL object.
Don't free the SSL object in SSLSocket#stop and leave it in RTypedData.
OpenSSL::SSL::SSLSocket#stop (and the wrapper method #sysclose) was
documented as "Stops the SSL connection and prepares it for another
connection" and this patch changes it: once the SSLSocket stopped, it
can no longer hold a new SSL connection.
The method used to free the SSL object immediately after SSL_shutdown(),
but it is problematic. Since some methods, such as SSLSocket#connect
release the GVL while waiting the peer, there is a good chance that the
SSL object is freed from another thread and this leads to a segmentation
fault.
Diffstat (limited to 'bootstraptest/test_gc.rb')
0 files changed, 0 insertions, 0 deletions