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 1445392 - PKCS #11 slot leakage hampers unload of nss-pem
Summary: PKCS #11 slot leakage hampers unload of nss-pem
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openldap
Version: 7.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Matus Honek
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-25 14:54 UTC by Kamil Dudka
Modified: 2018-01-31 21:54 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1444860
Environment:
Last Closed: 2018-01-31 21:54:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Kamil Dudka 2017-04-25 14:54:00 UTC
Same bug in openldap-2.4.40-13.el7.  The following patch will fix it:

--- a/openldap-2.4.40/libraries/libldap/tls_m.c
+++ b/openldap-2.4.40/libraries/libldap/tls_m.c
@@ -1590,12 +1590,15 @@ tlsm_add_key_from_file( tlsm_ctx *ctx, const char *filename )
                           filename, errcode, PR_ErrorToString( errcode, PR_LANGUAGE_I_DEFAULT ) );
                retcode = -1;
        } else {
+               PK11SlotInfo *tmp;
                tlsm_add_pem_obj( ctx, key );
                retcode = 0;

                /* When adding an encrypted key the PKCS#11 will be set as removed */
                /* This will force the token to be seen as re-inserted */
-               SECMOD_WaitForAnyTokenEvent( pem_module, 0, 0 );
+               tmp = SECMOD_WaitForAnyTokenEvent( pem_module, 0, 0 );
+               if ( tmp )
+                       PK11_FreeSlot( tmp );
                PK11_IsPresent( slot );
        }


+++ This bug was initially created as a clone of Bug #1444860 +++

Description of problem:
The PKCS #11 slot object returned by SECMOD_WaitForAnyTokenEvent() is leaked, which later prevents nss-pem from being unloaded.


Version-Release number of selected component (if applicable):
curl-7.29.0-42.el7


Steps to Reproduce:
1. install nss-pem-1.0.3-2.el7
2. load a private key from file using libcurl


Actual results:
nss-pem fails to unload


Expected results:
nss-pem unloads properly


Additional info:
This bug was revealed by the following nss-pem commit:
https://github.com/kdudka/nss-pem/commit/eefef228

Unfortunately, reverting the commit would reintroduce the one second sleep after loading a private key, which is something we do not want to do?

--- Additional comment from Kamil Dudka on 2017-04-25 14:17:12 CEST ---

upstream commit:

https://github.com/curl/curl/commit/curl-7_54_0-24-gc8ea86f

--- Additional comment from Kamil Dudka on 2017-04-25 16:48:07 CEST ---

Removing the Regression keyword.  The bug is triggered by a change in nss-pem, so the change will be reverted.


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