Bug 552917 - freelb leaks fd on NSSLOW_Init() -- caused by dlopen calls
Summary: freelb leaks fd on NSSLOW_Init() -- caused by dlopen calls
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Andreas Schwab
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-06 14:36 UTC by Tom Hughes
Modified: 2016-11-24 15:42 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-11-09 20:05:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Test program (593 bytes, text/plain)
2010-01-06 14:36 UTC, Tom Hughes
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 699917 0 unspecified CLOSED Possible Memory leak in crypt_r 2021-02-22 00:41:40 UTC

Internal Links: 699917

Description Tom Hughes 2010-01-06 14:36:30 UTC
Created attachment 382002 [details]
Test program

Description of problem:

Calling crypt() with an SHA512 password salt causes it to open a file descriptor on /lib/nspr4.so and not close it again.

Each call to crypt opens a new descriptor.

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

glibc-2.11-4.x86_64

How reproducible:

Every time.

Steps to Reproduce:
1. Compile and run attached program
2. Monitor open files with lsof
  
Actual results:

No descriptors leaked.

Expected results:

Descriptors leaked.

Additional info:

The actual open is in NSSLOW_Init() in /lib64/libfreebl3.so but I'm not sure if the bug is there, or that crypt is not using libfreebl3 correctly.

This problem does not seem to exist in Fedora 12 so either glibc or nss-softokn-freebl has presumably been fixed at some point.

This is probably the underlying problem behind bug #523605.

Comment 1 Andreas Schwab 2010-01-07 16:05:06 UTC
Since crypt hasn't changed since F-11 this must be a bug in nss-softokn.

Comment 2 Bob Relyea 2010-01-07 22:22:22 UTC
Elio, we should probably refresh F11 to 3.12.4 or later. NOTE: F11 still has the combined NSS package.

Comment 3 Bernie Innocenti 2010-01-11 15:28:11 UTC
I'm not sure this is the same bug, but we have nss-softokn-freebl-3.12.4-3.fc11.i586 installed and the fd leak persists:

 # ls -l /proc/`pgrep slapd`/fd/ | grep nspr4 | wc -l
 12
 # ls -l /proc/`pgrep slapd`/fd/ | grep nspr4 | wc -l
 14
 # ls -l /proc/`pgrep slapd`/fd/ | grep nspr4 | wc -l
 15
 ...

Comment 4 Elio Maldonado Batiz 2010-01-11 17:22:39 UTC
F-11 is at 3.12.4 already and going into 3.12.5 soon.  I observerd the fd leaks in F-11 and not on F-12. I tested two ways: with F-11 versus F-12 with both nss-3.12.4 and also F-11 versus F-12 both 3.12.5. The nss-softokn-freebl code hasn't is the same. What changed for F-12 is the repackaging by splitting off nss-softokn (and nss-util) as their own packages. I'm surprised the splitting makes cures the leaks. I propose to do a split-off of softokn for F-11 but only via sub-packaging a try with a scratch build to see what happens. Shall I try this?

Comment 5 Bug Zapper 2010-04-28 11:40:05 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Bug Zapper 2010-06-28 15:36:04 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Elio Maldonado Batiz 2011-08-16 23:57:09 UTC
I don't think this is a bug in nss or nspr. In another bug Bob Relyea has hinted at dlopen being the ome leaking dile descriptors.

Let's trace through the code with the help of Mozilla mxr (the code is essentially the same as what we have in fedora)

NSSLOW_Init is here
http://mxr.mozilla.org/security/source/security/nss/lib/freebl/nsslowhash.c#316

The call to FREEBL_InitStubs sends us here
http://mxr.mozilla.org/security/source/security/nss/lib/freebl/stubs.c#636

Thre are calls to freebl_getLibrary(nsprLibName); and freebl_getLibrary(nsutlLibName);

Whose implementations is here
http://mxr.mozilla.org/security/source/security/nss/lib/freebl/stubs.c#613

As you can see it's a macro
#define freebl_getLibrary(libName) dlopen (libName, RTLD_LAZY|RTLD_NOLOAD)

I'm going to reassign this glibc.

Comment 8 John Poelstra 2011-11-09 20:05:07 UTC
    Thank you for your bug report. 

    We are sorry, but the Fedora Project is no longer releasing bug fixes or any other updates for Fedora 11. This bug will be set to CLOSED:WONTFIX to reflect this, but please reopen it exists against a currently supported version (Fedora 15 or 16).


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