Bug 445584 - ldap_open() call is causing a leaked file descriptor in pam_ldap module
ldap_open() call is causing a leaked file descriptor in pam_ldap module
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: nss_ldap (Show other bugs)
9
All Linux
low Severity low
: ---
: ---
Assigned To: Nalin Dahyabhai
Fedora Extras Quality Assurance
:
: 443661 445564 447078 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-07 15:07 EDT by Daniel Walsh
Modified: 2009-07-14 14:12 EDT (History)
5 users (show)

See Also:
Fixed In Version: 264-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-14 14:12:52 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)
Attempt at closing fd on exec (671 bytes, application/octet-stream)
2008-05-07 15:08 EDT, Daniel Walsh
no flags Details

  None (edit)
Description Daniel Walsh 2008-05-07 15:07:26 EDT
Description of problem:

This is causing lots of SELinux avc messages

Need to add  a patch like the attached to close the file descriptor on exec.

Not sure if this patch is correct.
Comment 1 Daniel Walsh 2008-05-07 15:08:11 EDT
Created attachment 304798 [details]
Attempt at closing fd on exec
Comment 2 Daniel Walsh 2008-05-07 15:54:47 EDT
*** Bug 445564 has been marked as a duplicate of this bug. ***
Comment 3 Tom "spot" Callaway 2008-05-07 16:07:26 EDT
Dan, opendap is not the same thing as openldap.
Comment 4 Carl Roth 2008-05-07 16:55:35 EDT
All of my cron jobs are also complaining about access to crond_t:tcp_socket and
system_crond_t:fifo_file.  Is this related, or is it a different bug?
Comment 5 Jan Safranek 2008-05-12 07:06:23 EDT
(In reply to comment #4)
> All of my cron jobs are also complaining about access to crond_t:tcp_socket and
> system_crond_t:fifo_file.  Is this related, or is it a different bug?

This is definitely a different bug. Please fill one against cronie (or what your
crond provider is).
Comment 6 Jan Safranek 2008-05-12 08:25:47 EDT
reported upstream,
http://www.openldap.org/its/index.cgi/Incoming?id=5507;expression=leak

Let's wait for their response.
Comment 7 Daniel Walsh 2008-05-13 11:42:28 EDT
Jan it is not a different bug.  The cronnie problem is caused by cronnie calling
openldap in its pam configuration to check the uid, It then execs the app and
the app gets the leaked file descriptor.
Comment 8 Bug Zapper 2008-05-14 06:47:43 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 9 Jan Safranek 2008-05-15 07:27:17 EDT
(In reply to comment #7)
> Jan it is not a different bug.  The cronnie problem is caused by cronnie calling
> openldap in its pam configuration to check the uid.

Shouldn't cronie (and pam) release all its resources, e.g. LDAP connection,
before executing the binary? I know, fcntl(s, F_SETFD, FD_CLOEXEC); does the
same automatically, but it prevents an application intentionally pass LDAP
connection to executed binary. That's perfectly valid usage.

Comment 10 Daniel Walsh 2008-05-16 15:32:33 EDT
Turns out the bug is in nss_ldap,  Sorry about the confusion.
Comment 11 Carl Roth 2008-05-16 15:48:59 EDT
So just out of curiosity, how do you diagnose a bug like that?  The selinux logs
only reported anonymous sockets with weird integer identifers.
Comment 12 Daniel Walsh 2008-05-16 16:54:15 EDT
Share genius....

Well actually just seeing this for a very long time.

Usually you see a confined domain trying to access a file that it has nothing to
do with.  For example I saw an AVC today that showed consoletype trying to read
dhcp.leases file.  I know that consoletype has nothing to do with this file so I
know it is a leaked file descriptor.  If you know a confined app does not use
networking and you see it trying to read/write a tcp_socket, you know it is a leak.
Comment 13 Daniel Walsh 2008-05-20 09:07:15 EDT
*** Bug 447078 has been marked as a duplicate of this bug. ***
Comment 14 Nalin Dahyabhai 2009-01-27 18:23:46 EST
*** Bug 443661 has been marked as a duplicate of this bug. ***
Comment 15 Nalin Dahyabhai 2009-01-27 18:29:48 EST
This should fixed by libldap if we build against 2.4.10 (which fixed the above-mentioned ITS) or later, and the candidate fixes in the update system should be building against at least that version.
Comment 16 Bug Zapper 2009-06-09 20:40:14 EDT
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  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 '9'.

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 9'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 9 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 17 Bug Zapper 2009-07-14 14:12:52 EDT
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 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.

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