Bug 684015 - unchecked return value of getpwuid() in policycoreutils-rhat.patch
Summary: unchecked return value of getpwuid() in policycoreutils-rhat.patch
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: policycoreutils
Version: 6.1
Hardware: All
OS: Linux
high
low
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 750385 756082 787579
TreeView+ depends on / blocked
 
Reported: 2011-03-10 22:00 UTC by Kamil Dudka
Modified: 2012-06-20 15:10 UTC (History)
4 users (show)

Fixed In Version: policycoreutils-2.0.83-19.19.el6
Doc Type: Bug Fix
Doc Text:
The missing exit(1) function call in the underlying code of the sepolgen-ifgen utility could cause the restorecond daemon to access already freed memory when retrieving user's information. This would cause restorecond to terminate unexpectedly with a segmentation fault. With this update, restorecond has been modified to check the return value of the getpwuid() function to avoid this situation.
Clone Of:
Environment:
Last Closed: 2012-06-20 15:10:24 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0969 0 normal SHIPPED_LIVE policycoreutils bug fix update 2012-06-19 21:11:56 UTC

Description Kamil Dudka 2011-03-10 22:00:27 UTC
Description of problem:
Return value of getpwuid() should be checked before dereferencing.


Version-Release number of selected component (if applicable):
policycoreutils-2.0.83-19.1.el6


Additional info:
Missing call of exit(1) in sepolgen-ifgen-attr-helper.c may cause a double free:

    /* Open the output policy. */
    fp = fopen(argv[2], "w");
    if (fp == NULL) {
        fprintf(stderr, "error opening output file\n");
        policydb_destroy(p);
        free(p);
    }

    ...

    policydb_destroy(p);
    free(p);
    fclose(fp);

Comment 3 RHEL Program Management 2011-03-10 22:17:53 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 4 Daniel Walsh 2011-03-15 16:18:23 UTC
Fixed in policycoreutils-2.0.83-33.3.fc13

Comment 5 Daniel Walsh 2011-03-15 16:24:40 UTC
Fixed in policycoreutils-2.0.83-33.3.el6

Comment 10 Daniel Walsh 2012-01-25 22:24:18 UTC
Fixed in policycoreutils-2.0.83-19.19.el6

Comment 14 Miroslav Svoboda 2012-02-14 17:50:40 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The missing exit(1) function call in the underlying code of the sepolgen-ifgen utility could cause the restorecond daemon to access already freed memory when retrieving user's information. This would cause restorecond to terminate unexpectedly with a segmentation fault. With this update, restorecond has been modified to check the return value of the getpwuid() function to avoid this situation.

Comment 17 errata-xmlrpc 2012-06-20 15:10:24 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.

http://rhn.redhat.com/errata/RHBA-2012-0969.html


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