Project

General

Profile

Bug #12680

Please backport memory leak fixes in ext/openssl

Added by rhenium (Kazuki Yamaguchi) almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:76922]

Description

The following methods have an issue of memory leak:

  • OpenSSL::X509::ExtensionFactory#create_ext
  • OpenSSL::X509::ExtensionFactory#config=
  • OpenSSL::X509::Extension#oid=
  • OpenSSL::X509::Extension#value=
  • OpenSSL::X509::Attribute#oid=
  • OpenSSL::X509::Request#set_attributes, #add_attribute
  • OpenSSL::X509::Revoked#set_extensions, #add_extension
  • OpenSSL::PKCS12.create
  • OpenSSL::PKey::EC#export
  • OpenSSL::PKCS7#verify
  • OpenSSL::PKCS7#add_data

They are fixed on GitHub ruby/openssl but they all exist in stable branches.

Here are the fixing commits:

https://github.com/ruby/openssl/compare/3a2840e80d275895523a526ce56e4f6e7b8f9cc4...1e30cd395b14ef46e04bdd9ab72f10067890b265

Or please use the attached patch that applies on top of ruby_2_3 branch if preferred.


Files

patches-ruby-2-3.tar.gz (6.69 KB) patches-ruby-2-3.tar.gz rhenium (Kazuki Yamaguchi), 08/16/2016 08:27 AM

Associated revisions

Revision ea5e22d1
Added by nagachika (Tomoyuki Chikanaga) almost 3 years ago

backport fix memory leak from upstream.
https://github.com/ruby/openssl/compare/3a2840e80d275895523a526ce56e4f6e7b8f9cc4...1e30cd395b14ef46e04bdd9ab72f10067890b265
patches are provided by rhe (Kazuki Yamaguchi).

  • ext/openssl/ossl_config.c: fix memory leak. [ruby-core:76922] [Bug #12680]

  • ext/openssl/ossl_ocsp.c: ditto.

  • ext/openssl/ossl_pkcs12.c: ditto.

  • ext/openssl/ossl_pkcs7.c: ditto.

  • ext/openssl/ossl_pkey_ec.c: ditto.

  • ext/openssl/ossl_x509.h: ditto.

  • ext/openssl/ossl_x509attr.c: ditto.

  • ext/openssl/ossl_x509crl.c: ditto.

  • ext/openssl/ossl_x509ext.c: ditto.

  • ext/openssl/ossl_x509req.c: ditto.

  • ext/openssl/ossl_x509revoked.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 56018
Added by nagachika (Tomoyuki Chikanaga) almost 3 years ago

backport fix memory leak from upstream.
https://github.com/ruby/openssl/compare/3a2840e80d275895523a526ce56e4f6e7b8f9cc4...1e30cd395b14ef46e04bdd9ab72f10067890b265
patches are provided by rhe (Kazuki Yamaguchi).

  • ext/openssl/ossl_config.c: fix memory leak. [ruby-core:76922] [Bug #12680]

  • ext/openssl/ossl_ocsp.c: ditto.

  • ext/openssl/ossl_pkcs12.c: ditto.

  • ext/openssl/ossl_pkcs7.c: ditto.

  • ext/openssl/ossl_pkey_ec.c: ditto.

  • ext/openssl/ossl_x509.h: ditto.

  • ext/openssl/ossl_x509attr.c: ditto.

  • ext/openssl/ossl_x509crl.c: ditto.

  • ext/openssl/ossl_x509ext.c: ditto.

  • ext/openssl/ossl_x509req.c: ditto.

  • ext/openssl/ossl_x509revoked.c: ditto.

Revision 18f287a3
Added by nagachika (Tomoyuki Chikanaga) almost 3 years ago

backport additional fix memory leak from openssl upstream.
https://github.com/ruby/openssl/commit/e76f076f093efb93dabf2cb042c527500f956061
patches are provided by rhe (Kazuki Yamaguchi).

  • ext/openssl/ossl_x509ext.c: additional fix memory leak.
    [ruby-core:76922] [Bug #12680]

  • text/openssl/test_x509ext.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 56032
Added by nagachika (Tomoyuki Chikanaga) almost 3 years ago

backport additional fix memory leak from openssl upstream.
https://github.com/ruby/openssl/commit/e76f076f093efb93dabf2cb042c527500f956061
patches are provided by rhe (Kazuki Yamaguchi).

  • ext/openssl/ossl_x509ext.c: additional fix memory leak.
    [ruby-core:76922] [Bug #12680]

  • text/openssl/test_x509ext.rb: test for above.

History

Updated by nagachika (Tomoyuki Chikanaga) almost 3 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: DONE

Thank you for your great work!
The patches are applied on ruby_2_3 branch at r56018.

Updated by rhenium (Kazuki Yamaguchi) almost 3 years ago

nagachika-san:

I'm so sorry, the third one of the patches was broken. Could you backport this as well?

https://github.com/ruby/openssl/commit/e76f076f093efb93dabf2cb042c527500f956061

Updated by nagachika (Tomoyuki Chikanaga) almost 3 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: DONE to 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) almost 3 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: DONE

Also available in: Atom PDF