Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2003742

Summary: [RHEL 8.2] Request to backport "Memory leak in X509v3 extension handler"
Product: Red Hat Enterprise Linux 8 Reporter: Kashyap Chamarthy <kchamart>
Component: python-cryptographyAssignee: Christian Heimes <cheimes>
Status: CLOSED DUPLICATE QA Contact: Kaleem <ksiddiqu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: apevec, frenaud, ssidhaye, tapazogl
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: 8.2Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2011720 2011721 (view as bug list) Environment:
Last Closed: 2021-10-19 16:03:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2011720, 2011721    
Attachments:
Description Flags
Preliminary backport
none
Additional patch none

Description Kashyap Chamarthy 2021-09-13 15:03:15 UTC
The fix[1] for the following issue

   https://github.com/pyca/cryptography/issues/4833

was issued as part of this security advisory:

    https://access.redhat.com/errata/RHSA-2021:1608
    — RHSA-2021:1608 - Security Advisory

which is currently only available for RHEL 8.4 customers.

However, there are layered product (e.g. Red Hat OpenStack) customers
that are on RHEL 8.2, and cannot be forced to move to RHEL 8.4.  So we
need to provide the fix for RHEL 8.2.

(I say "the fix"; but the 8.4 advisory seem to have several bugs, 
including a rebase.  So I'll leave it to the RHEL maintainers to decide
what is appropriate to backport to RHEL 8.2.)

This bug is a tracker to backport this fix for RHEL 8.2.



[1] https://github.com/pyca/cryptography/commit/9a22851fab924fd58482fdad3f8dd23dc3987f91

Comment 1 Lon Hohberger 2021-09-13 15:14:01 UTC
Created attachment 1822807 [details]
Preliminary backport

Comment 2 Lon Hohberger 2021-09-13 18:31:47 UTC
Created attachment 1822844 [details]
Additional patch

This other patch gets us a bit closer, but not 100%:

>               raise AssertionError(out)
E               AssertionError: {'93824997185568': {'size': 32, 'path': 'crypto/stack/stack.c', 'line': 209}, '93824997185664': {'size': 40, 'path': 'crypto/asn1/tasn_new.c', 'line': 122}, '93824997185712': {'size': 40, 'path': 'crypto/asn1/tasn_new.c', 'line': 122}, '93824997320368': {'size': 3, 'path': 'crypto/asn1/asn1_lib.c', 'line': 284}, '93824997320912': {'size': 3, 'path': 'crypto/asn1/asn1_lib.c', 'line': 284}, '93824997423424': {'size': 32, 'path': 'crypto/stack/stack.c', 'line': 180}}
tests/hazmat/backends/test_openssl_memleak.py:114: AssertionError

NOTE: other tests fail as well due to missing dependencies and other bits. This is one, however, seems to show that we are still leaking a bit.

Comment 3 Christian Heimes 2021-10-04 10:45:13 UTC
Your patch contains an additional test case that is neither in https://github.com/pyca/cryptography/pull/4836 nor in https://github.com/pyca/cryptography/pull/4889. I have created a personal branch with backports of the PRs, https://github.com/pyca/cryptography/compare/2.3...tiran:aiamemleak-2.3

Comment 6 Florence Blanc-Renaud 2021-10-19 16:03:15 UTC
RHEL 8.4.0 and RHEL 8.5.0 already have a newer version of python-cryptography that contains the fix for the memory leak.

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