This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 496643 - Possible segfault in SSL_new()
Possible segfault in SSL_new()
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: nss_compat_ossl (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Rob Crittenden
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-20 09:56 EDT by Ondrej Vasik
Modified: 2009-05-09 00:04 EDT (History)
3 users (show)

See Also:
Fixed In Version: 0.9.5-2.fc11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-02 12:35:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Ensure we have an SSL_CTX before doing work (1.23 KB, application/octet-stream)
2009-04-20 10:57 EDT, Rob Crittenden
no flags Details

  None (edit)
Description Ondrej Vasik 2009-04-20 09:56:01 EDT
Description of problem:
When calling SSL_new() with NULL argument in some application (e.g. it could happen with actual elinks devel branch, compiled, when its binary executed as `SSL_DIR=<some file, not nss database dir> ./elinks https://<somepage>` with SSL certification enabled), application will segfault.

Version-Release number of selected component (if applicable):
nss_compat_ossl-0.9.4-3

How reproducible:
always

Steps to Reproduce:
1. compile elinks binary, devel branch (linked with nss_compat_ossl)
2. run it's binary with invalid SSL_DIR envvar 
  
Actual results:
It will segfault

Expected results:
It will return some error 

Additional info:
Something like that patch fixes my problem, it could be of course handled/prevented on elinks side, but it would be better to prevent such things directly in library.

diff -urNp nss_compat_ossl-0.9.4-orig/src/ssl.c nss_compat_ossl-0.9.4/src/ssl.c
--- nss_compat_ossl-0.9.4-orig/src/ssl.c        2009-04-15 16:55:03.000000000 +0200
+++ nss_compat_ossl-0.9.4/src/ssl.c     2009-04-15 16:56:25.000000000 +0200
@@ -1968,6 +1968,9 @@ SSL *SSL_new(SSL_CTX *templ_s)
     ossl_ctx_t *ossl;
     ossl_ctx_t *ossl_templ;

+    if (templ_s == NULL)
+       return NULL;
+
     /* This layer contains the TCP/IP functions we need */
     s = PR_NewTCPSocket();
     if (s == NULL)
Comment 1 Rob Crittenden 2009-04-20 10:48:50 EDT
Your patch looks good, thanks.

I'll get this committed upstream and create a set of Fedora updates.
Comment 2 Rob Crittenden 2009-04-20 10:57:19 EDT
Created attachment 340360 [details]
Ensure we have an SSL_CTX before doing work
Comment 3 Rob Crittenden 2009-04-20 11:00:45 EDT
Committed revision 70.
Comment 4 Fedora Update System 2009-04-20 15:53:20 EDT
nss_compat_ossl-0.9.5-2.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-2.fc10
Comment 5 Fedora Update System 2009-04-20 15:53:25 EDT
nss_compat_ossl-0.9.5-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-1.fc11
Comment 6 Fedora Update System 2009-04-20 15:53:30 EDT
nss_compat_ossl-0.9.5-1.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-1.fc9
Comment 7 Fedora Update System 2009-04-21 20:49:17 EDT
nss_compat_ossl-0.9.5-2.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update nss_compat_ossl'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-3767
Comment 8 Fedora Update System 2009-04-21 20:54:02 EDT
nss_compat_ossl-0.9.5-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing-newkey update nss_compat_ossl'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2009-3796
Comment 9 Fedora Update System 2009-04-29 10:43:53 EDT
nss_compat_ossl-0.9.5-3.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-3.fc10
Comment 10 Fedora Update System 2009-04-29 10:44:03 EDT
nss_compat_ossl-0.9.5-2.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-2.fc11
Comment 11 Fedora Update System 2009-04-29 10:44:12 EDT
nss_compat_ossl-0.9.5-2.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/nss_compat_ossl-0.9.5-2.fc9
Comment 12 Fedora Update System 2009-05-02 12:35:27 EDT
nss_compat_ossl-0.9.5-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 13 Fedora Update System 2009-05-02 12:36:35 EDT
nss_compat_ossl-0.9.5-3.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 14 Fedora Update System 2009-05-09 00:04:02 EDT
nss_compat_ossl-0.9.5-2.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.