Bug 228749 - [RHEL4][patch] cid-17 cid-18 Fix memory leak in libe2p (e2p_edit_mntopts)
Summary: [RHEL4][patch] cid-17 cid-18 Fix memory leak in libe2p (e2p_edit_mntopts)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: e2fsprogs
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Eric Sandeen
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks: 234251 239341
TreeView+ depends on / blocked
 
Reported: 2007-02-14 19:43 UTC by Bryn M. Reeves
Modified: 2018-10-19 22:58 UTC (History)
2 users (show)

Fixed In Version: RHBA-2007-0758
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-15 16:01:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Correctly free buffer before returning from e2p_edit_mntopts (770 bytes, patch)
2007-02-14 19:43 UTC, Bryn M. Reeves
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0758 0 normal SHIPPED_LIVE e2fsprogs bug fix update 2007-11-14 17:06:52 UTC

Description Bryn M. Reeves 2007-02-14 19:43:20 UTC
Description of problem:
Another small memory leak in e2fsprogs. This time affecting the e2p_edit_mntopts
routine.

A temporary buffer is allocated and never freed upon return.

Version-Release number of selected component (if applicable):
e2fsprogs-1.35-12.4.EL4

How reproducible:
100%

Steps to Reproduce:
1. Use an e2fsprogs command that will edit mountopts, e.g. "tune2fs -ouid_16"
2. Run the command under valgrind, e.g.:

# valgrind --tool=memcheck tune2fs -ouid_16 /tmp/img0
 
Actual results:
A leak for this buffer is evident in --leak-check=yes output.

==22480== 7 bytes in 1 blocks are definitely lost in loss record 1 of 16
==22480==    at 0x4004405: malloc (vg_replace_malloc.c:149)
==22480==    by 0x402C82D: e2p_edit_mntopts (mntopts.c:102)
==22480==    by 0x804A2AF: main (tune2fs.c:270)
==22480==
==22480==
...
==22480==
==22480== LEAK SUMMARY:
==22480==    definitely lost: 39 bytes in 2 blocks.
==22480==    indirectly lost: 944 bytes in 50 blocks.
==22480==      possibly lost: 0 bytes in 0 blocks.
==22480==    still reachable: 12,022 bytes in 18 blocks.
==22480==         suppressed: 0 bytes in 0 blocks.
==22480== Reachable blocks (those to which a pointer was found) are not shown.
==22480== To see them, rerun with: --show-reachable=yes


Expected results:
No leak for this buffer is evident in --leak-check=yes output.

...
==22682== 
==22682== LEAK SUMMARY:
==22682==    definitely lost: 32 bytes in 1 blocks.
==22682==    indirectly lost: 944 bytes in 50 blocks.
==22682==      possibly lost: 0 bytes in 0 blocks.
==22682==    still reachable: 12,022 bytes in 18 blocks.
==22682==         suppressed: 0 bytes in 0 blocks.
==22682== Reachable blocks (those to which a pointer was found) are not shown.
==22682== To see them, rerun with: --show-reachable=yes

Additional info:

Comment 1 Bryn M. Reeves 2007-02-14 19:43:21 UTC
Created attachment 148083 [details]
Correctly free buffer before returning from e2p_edit_mntopts

Comment 4 RHEL Program Management 2007-05-09 07:35:46 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 5 Eric Sandeen 2007-05-29 20:52:58 UTC
upstream commit for both patches http://thunk.org/hg/e2fsprogs/?rev/35af21f328c2

Comment 6 Benjamin Kahn 2007-06-08 14:38:47 UTC
Applying a DEV_ACK for Eric Sandeen <sandeen>.  This bug
    was found by coverity and has a patch available.

Comment 8 Eric Sandeen 2007-07-02 20:43:33 UTC
In cvs as of e2fsprogs-1.35-12.7.el4

Comment 12 errata-xmlrpc 2007-11-15 16:01:59 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 the 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-2007-0758.html



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