RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2040853 - Double free due to incorrect fix for CVE-2021-3712
Summary: Double free due to incorrect fix for CVE-2021-3712
Keywords:
Status: CLOSED DUPLICATE of bug 2039993
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openssl
Version: 7.9
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Sahana Prasad
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-14 19:37 UTC by Sara Golemon
Modified: 2022-01-17 03:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-01-17 03:37:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2039993 1 urgent CLOSED httpd fails to start with double free after updating to openssl-1.0.2k-23.el7_9 2023-09-27 08:04:05 UTC
Red Hat Issue Tracker RHELPLAN-108224 0 None None None 2022-01-14 19:38:13 UTC

Description Sara Golemon 2022-01-14 19:37:37 UTC
Description of problem:

The fix for CVE-2021-3712 (Ref: https://git.centos.org/rpms/openssl/blob/2906dac54f4739d3cad6c96ad5dd11fec982098b/f/SOURCES/openssl-1.0.2k-cve-2021-3712.patch#_304 ) incorrectly frees `emtmp` and destroys the target stack after *successfully* adding it to the stack.  When this stack is destroyed, the pointer is freed again, causing a fault.

The root cause seems to be a logic inversion where, prior to this patch, destruction and `return 0;` happens on `!sk_OPENSSL_STRING_push(*sk, emtmp)` whereas after the patch, it happens on `sk_OPENSSL_STRING_push(*sk, emtmp)` (note the lack of negation in the latter case.

Version-Release number of selected component (if applicable):
1.0.2k-22.el7_9 vs 1.0.2k-23.el7_9

How reproducible:
This was reported by a customer of ours (MongoDB) with OCSP enabled.

Steps to Reproduce:
1. Install MongoDB 4.4.latest with RHEL7 openssl-1.0.2k-23.el7_9
2. Startup mongod with OCSP enabled.
3. Crash.

Actual results:

No crash.

Expected results:

Crash due to double free.

Additional info:

Interrestingly, upstream sources do not try to free emtmp even in the event of failure, but I suspect that's either a leak, or intentionally ignoring the use of block allocated scratch space. (Ref: https://github.com/openssl/openssl/blob/081314d07705aa58912845c213a48414d8f616a9/crypto/x509v3/v3_utl.c#L621-L626 )

Comment 3 Sahana Prasad 2022-01-17 03:37:09 UTC

*** This bug has been marked as a duplicate of bug 2039993 ***


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