Bug 675758 - Leak of /proc/mtrr file descriptor by pci_system_cleanup
Summary: Leak of /proc/mtrr file descriptor by pci_system_cleanup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libpciaccess
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Dave Airlie
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-07 16:43 UTC by Daniel Berrangé
Modified: 2011-05-19 14:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 14:30:38 UTC
Target Upstream Version:


Attachments (Terms of Use)
Demo program for /proc/mtrr leak (95 bytes, text/plain)
2011-02-07 16:43 UTC, Daniel Berrangé
no flags Details
Proposed patch to close /proc/mtrr (583 bytes, patch)
2011-02-07 16:44 UTC, Daniel Berrangé
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0806 0 normal SHIPPED_LIVE libpciaccess bug fix update 2011-05-18 18:21:21 UTC

Description Daniel Berrangé 2011-02-07 16:43:56 UTC
Created attachment 477455 [details]
Demo program for /proc/mtrr leak

Description of problem:

The pci_system_init() function opens the /proc/mtrr file and saves its file descriptor.  pci_system_cleanup() fails to close this file descriptor resulting in a leak of the FD.

Version-Release number of selected component (if applicable):
libpciaccess-0.10.9-2.el6

How reproducible:
Always

Steps to Reproduce:
1. Save attached demo to pcidemo.c
2. gcc -o pcidemo pcidemo.c -lpciaccess
3. valgrind --track-fds=yes ./pcidemo
  
Actual results:
==7197== FILE DESCRIPTORS: 4 open at exit.
==7197== Open file descriptor 3: /proc/mtrr
==7197==    at 0x5105FC0: __open_nocancel (syscall-template.S:82)
==7197==    by 0x4E302C3: pci_system_linux_sysfs_create (fcntl2.h:54)
==7197==    by 0x40062C: main (in /root/pcidemo)


Expected results:
No leaked FD for /proc/mtrr

Additional info:

Comment 1 Daniel Berrangé 2011-02-07 16:44:21 UTC
Created attachment 477456 [details]
Proposed patch to close /proc/mtrr

Comment 3 RHEL Program Management 2011-02-07 17:08:30 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 9 errata-xmlrpc 2011-05-19 14:30:38 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0806.html


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