Bug 228725 - [RHEL4] [patch] cid-21 Fix memory leak in libss (ss_execute_line)
[RHEL4] [patch] cid-21 Fix memory leak in libss (ss_execute_line)
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: e2fsprogs (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Eric Sandeen
Jay Turner
:
Depends On:
Blocks: 234251 239341
  Show dependency treegraph
 
Reported: 2007-02-14 12:14 EST by Bryn M. Reeves
Modified: 2015-01-07 19:15 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2007-0758
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 11:01:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Correct freeing of argv in ss_execute_line (820 bytes, patch)
2007-02-14 12:14 EST, Bryn M. Reeves
no flags Details | Diff

  None (edit)
Description Bryn M. Reeves 2007-02-14 12:14:42 EST
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 12:14:43 EST
Created attachment 148070 [details]
Correct freeing of argv in ss_execute_line
Comment 4 RHEL Product and Program Management 2007-05-09 03:39:06 EDT
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 16:35:52 EDT
upstream commit http://thunk.org/hg/e2fsprogs/?rev/68907ddfca40
Comment 6 Benjamin Kahn 2007-06-08 10:38:07 EDT
Applying a DEV_ACK for Eric Sandeen <sandeen@redhat.com>.  This bug
    was found by coverity and has a patch available.
Comment 8 Eric Sandeen 2007-07-02 16:42:58 EDT
In cvs as of e2fsprogs-1.35-12.7.el4
Comment 12 errata-xmlrpc 2007-11-15 11:01:46 EST
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.