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 785760 - libtar: file descriptor leaks reported by cppcheck
Summary: libtar: file descriptor leaks reported by cppcheck
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libtar
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: alpha
: 7.2
Assignee: Kamil Dudka
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1191020
TreeView+ depends on / blocked
 
Reported: 2012-01-30 14:57 UTC by Karel Volný
Modified: 2018-03-13 04:00 UTC (History)
3 users (show)

Fixed In Version: libtar-1.2.11-29.el7
Doc Type: Bug Fix
Doc Text:
Previously, the error handling code in libtar did not properly release file descriptors before losing track of them. This led to unnecessary file descriptor leakage. An upstream patch has been applied on libtar source code to properly release file descriptors on error paths. Now, libtar no longer leaks file descriptors.
Clone Of:
Environment:
Last Closed: 2015-05-18 08:22:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix (1.90 KB, patch)
2012-02-07 13:08 UTC, Kamil Dudka
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1014 0 normal SHIPPED_LIVE libtar bug fix update 2015-05-18 12:22:11 UTC

Description Karel Volný 2012-01-30 14:57:11 UTC
Description of problem:
Running cppcheck on libtar sources reports several errors - resource leaks.
As far as I can understand the source code, these are valid concerns, files are being opened, and in case of some errors, the functions exit without closing the files.

Version-Release number of selected component (if applicable):
libtar-1.2.11-17.el6

How reproducible:
always

Steps to Reproduce:
1. rpm -i libtar-1.2.11-17.el6.src.rpm
2. cppcheck /root/rpmbuild/BUILD/libtacat newr-1.2.11/ | grep error
  
Actual results:
[/root/rpmbuild/BUILD/libtar-1.2.11/lib/append.c:237]: (error) Resource leak: filefd
[/root/rpmbuild/BUILD/libtar-1.2.11/lib/extract.c:249]: (error) Resource leak: fdout
[/root/rpmbuild/BUILD/libtar-1.2.11/libtar/libtar.c:86]: (error) Resource leak: fd


Expected results:
(no output)

Additional info:

Comment 1 Kamil Dudka 2012-02-07 13:08:27 UTC
Created attachment 559936 [details]
proposed fix

Comment 3 Suzanne Logcher 2012-02-14 23:29:39 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 8 Kamil Dudka 2013-10-04 12:47:57 UTC
fixed in libtar-1.2.11-27.fc21

Comment 11 Kamil Dudka 2014-10-23 15:26:46 UTC
It is too late to fix the bug in RHEL-6.  I am moving it to RHEL-7...

Comment 13 Kamil Dudka 2015-04-21 18:51:04 UTC
up2date cppcheck does not detect the descriptor leaks above.  However, it detects a memory leak on OOM path, which I reported upstream:

https://lists.feep.net:8080/pipermail/libtar/2015-April/000412.html

... but I am not going to fix that one in RHEL.

Comment 14 Kamil Dudka 2015-04-22 15:07:56 UTC
reproducible with cppcheck-1.53

Comment 21 errata-xmlrpc 2015-05-18 08:22:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1014.html


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