Bug 1178725 (CVE-2014-9482)

Summary: CVE-2014-9482 libdwarf: use-after-free when parsing a crafted ELF file
Product: [Other] Security Response Reporter: Vasyl Kaigorodov <vkaigoro>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: carnil, fche, orion, sisharma
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-18 18:46:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1177758    
Bug Blocks: 1225848    

Description Vasyl Kaigorodov 2015-01-05 12:09:52 UTC
Use-after-free vulnerability was reported in libdwarf [1].
If dwarfdump is passed a corrupted ELF file, 'Dwarf_Debug' object will be freed in 'dwarf_elf_object_access_finish', but then this object is being referenced later in 'print_error':

--------------------------------
res = dwarf_object_init(binary_interface, errhand, errarg,
        ret_dbg, error);
    if (res != DW_DLV_OK){
        dwarf_elf_object_access_finish(binary_interface);
    }
--------------------------------
...
--------------------------
    if (obj->object) {
        dwarf_elf_object_access_internals_t *internals =
            (dwarf_elf_object_access_internals_t *)obj->object;
--------------------------

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1177758

Comment 1 Martin Prpič 2015-01-06 09:20:10 UTC
MITRE assigned CVE-2014-9482 to this issue: http://seclists.org/oss-sec/2015/q1/20

Comment 2 Orion Poplawski 2015-01-24 04:06:28 UTC
It appears to me that the EPEL6 version - 20140413 - is vulnerable to this as well.  I believe that upstream commit 9a2dfcfe020314672086e44bddd81c155cba2a6d is the primary fix for this, but it does not apply cleanly to 20140413.

I don't want to update to the latest release due to apparent ABI incompatibilities - see http://upstream.rosalinux.ru/versions/libdwarf.html