Bug 228725 - [RHEL4] [patch] cid-21 Fix memory leak in libss (ss_execute_line)
Summary: [RHEL4] [patch] cid-21 Fix memory leak in libss (ss_execute_line)
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 17:14 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:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Correct freeing of argv in ss_execute_line (820 bytes, patch)
2007-02-14 17:14 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 17:14:42 UTC
Description of problem:
The function ss_execute_line in execute_cmd.c contains the following code:

    /* parse it */
    argv = ss_parse(sci_idx, line_ptr, &argc);
    if (argc == 0)
        return 0;

Potentially we need to free argv before early return since it was allocated
memory. We need to be careful and check argv since it may be possible for
ss_parse() to have freed the memory allocated to it if it detects an unbalanced
set of quotes passed to it.

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

How reproducible:
Not sure.

Steps to Reproduce:
Also tricky to reproduce this one. I'm not familiar with ss's internals to come
up with a test case that will clearly show this problem, but again the flaw is
fairly obvious.
  
Actual results:
ss_execute_line may fail to free resources allocated by it.

Expected results:
ss_execute_line correctly frees resources allocated by it.

Comment 1 Bryn M. Reeves 2007-02-14 17:14:43 UTC
Created attachment 148070 [details]
Correct freeing of argv in ss_execute_line

Comment 4 RHEL Program Management 2007-05-09 07:39:06 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:35:52 UTC
upstream commit http://thunk.org/hg/e2fsprogs/?rev/68907ddfca40

Comment 6 Benjamin Kahn 2007-06-08 14:38:07 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:42:58 UTC
In cvs as of e2fsprogs-1.35-12.7.el4

Comment 12 errata-xmlrpc 2007-11-15 16:01:46 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.