Bug 508499 - dbus is leaking open file descriptor in inotify_init [NEEDINFO]
dbus is leaking open file descriptor in inotify_init
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: dbus (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Matthias Clasen
Depends On: 505338
  Show dependency treegraph
Reported: 2009-06-27 19:09 EDT by Matthias Clasen
Modified: 2014-06-02 09:07 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 505338
Last Closed: 2014-06-02 09:07:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
pm-rhel: needinfo? (mclasen)

Attachments (Terms of Use)

  None (edit)
Description Matthias Clasen 2009-06-27 19:09:08 EDT
+++ This bug was initially created as a clone of Bug #505338 +++

Created an attachment (id=347420)
inotify patch to stop leak

Description of problem:

Should be back ported to F11, F10, RHEL5 if possible.  Just causes lots of AVC's in domains that do not use inotify.

--- Additional comment from eparis@redhat.com on 2009-06-11 11:02:03 EDT ---

I wouldn't really suggest that particular patch....

but it's close.  you can make it inotify_init1() which takes flags like IN_CLOEXEC, but inotify_init() takes a void.  inotify_init1 requires a newer kernel.  the safest most backwards compatible way would be to add

int flags;
flags = fcntl(inotify_fd, F_GETFD);
if (flags == -1)
    /* Handle error */;
flags |= FD_CLOEXEC;
fcntl(inotify_fd, F_SETFD, flags);

--- Additional comment from mclasen@redhat.com on 2009-06-11 15:21:03 EDT ---

Hmm, I guess other inotify using code should get the same fix ? Such as the file monitoring code in gio...

--- Additional comment from dwalsh@redhat.com on 2009-06-11 17:47:58 EDT ---

If they are going to execute a confined domain, then they need to make sure all file descriptors are locked before exec.  Otherwise the confined apps end up with avc's suggesting they need inotify.  So far we have found cron and dbus with this problem.

--- Additional comment from mclasen@redhat.com on 2009-06-27 18:54:51 EDT ---

Filed upstream: https://bugs.freedesktop.org/show_bug.cgi?id=22516
Comment 2 RHEL Product and Program Management 2014-03-07 08:39:14 EST
This bug/component is not included in scope for RHEL-5.11.0 which is the last RHEL5 minor release. This Bugzilla will soon be CLOSED as WONTFIX (at the end of RHEL5.11 development phase (Apr 22, 2014)). Please contact your account manager or support representative in case you need to escalate this bug.
Comment 3 RHEL Product and Program Management 2014-06-02 09:07:38 EDT
Thank you for submitting this request for inclusion in Red Hat Enterprise Linux 5. We've carefully evaluated the request, but are unable to include it in RHEL5 stream. If the issue is critical for your business, please provide additional business justification through the appropriate support channels (https://access.redhat.com/site/support).

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