Bug 1177758
Summary: | Use after free vulnerability in Dwarfdump. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | xqx <xiaoqixue2008> | ||||
Component: | libdwarf | Assignee: | Tom Hughes <tom> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | rawhide | CC: | carnil, fche, orion, tom | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | libdwarf-20150115-1.fc21 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2015-01-30 04:38:46 UTC | Type: | Bug | ||||
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: | |||||||
Bug Blocks: | 1178725 | ||||||
Attachments: |
|
Description
xqx
2014-12-30 09:58:09 UTC
Can you clarify something - is this an issue in the libdwarf library? or in the dwarfdump tool? If it's in the tool then is it dwarfdump or dwarfdump2 (or both)? (In reply to Tom Hughes from comment #1) > Can you clarify something - is this an issue in the libdwarf library? or in > the dwarfdump tool? If it's in the tool then is it dwarfdump or dwarfdump2 > (or both)? It is in dwarfdump, but the Segmentation fault caused in dwarf_original_elf_init.c which is a file in libdwarf library. And It is not in dwarfdump2. Right, the actual crash is in the library, but is it caused by a bug in the library or by dwarfdump misusing the library? That's what I'm trying to figure out... If it is in dwarfdump then Fedora is not affected, as we actually ship dwarfdump2 as dwarfdump currently. To answer my own question, it seems that this in fact effect dwarfdump2 (which we ship as dwarfdump) as valgrind reports two read after free errors: ==24438== Invalid read of size 8 ==24438== at 0x3D9B20DB55: dwarf_errmsg (dwarf_error.c:437 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x40E917: print_error_and_continue(Dwarf_Debug_s*, std::string const&, int, Dwarf_Error_s*) (dwarfdump.cc:1876 in /usr/bin/dwarfdump) ==24438== by 0x40EB38: print_error(Dwarf_Debug_s*, std::string const&, int, Dwarf_Error_s*) (dwarfdump.cc:1862 in /usr/bin/dwarfdump) ==24438== by 0x412026: process_one_file(Elf*, std::string const&, int, dwconf_s*) [clone .constprop.133] (dwarfdump.cc:938 in /usr/bin/dwarfdump) ==24438== by 0x40753F: main (dwarfdump.cc:388 in /usr/bin/dwarfdump) ==24438== Address 0x62c6ce30 is 16 bytes inside a block of size 24 free'd ==24438== at 0x62A5BE90: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==24438== by 0x3D9B21E957: dwarf_tdestroy_inner.isra.2 (dwarf_tsearchhash.c:632 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B21F346: _dwarf_tdestroy (dwarf_tsearchhash.c:665 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B20A94E: _dwarf_free_all_of_one_debug (dwarf_alloc.c:595 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B2156C3: dwarf_object_init (dwarf_init_finish.c:851 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B21B2F6: dwarf_elf_init_file_ownership (dwarf_original_elf_init.c:173 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B21B4E8: dwarf_elf_init (dwarf_original_elf_init.c:137 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x410054: process_one_file(Elf*, std::string const&, int, dwconf_s*) [clone .constprop.133] (dwarfdump.cc:932 in /usr/bin/dwarfdump) ==24438== by 0x40753F: main (dwarfdump.cc:388 in /usr/bin/dwarfdump) and: ==24438== Invalid read of size 8 ==24438== at 0x3D9B20DB35: dwarf_errno (dwarf_error.c:424 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x40E931: print_error_and_continue(Dwarf_Debug_s*, std::string const&, int, Dwarf_Error_s*) (dwarfdump.cc:1877 in /usr/bin/dwarfdump) ==24438== by 0x40EB38: print_error(Dwarf_Debug_s*, std::string const&, int, Dwarf_Error_s*) (dwarfdump.cc:1862 in /usr/bin/dwarfdump) ==24438== by 0x412026: process_one_file(Elf*, std::string const&, int, dwconf_s*) [clone .constprop.133] (dwarfdump.cc:938 in /usr/bin/dwarfdump) ==24438== by 0x40753F: main (dwarfdump.cc:388 in /usr/bin/dwarfdump) ==24438== Address 0x62c6ce30 is 16 bytes inside a block of size 24 free'd ==24438== at 0x62A5BE90: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==24438== by 0x3D9B21E957: dwarf_tdestroy_inner.isra.2 (dwarf_tsearchhash.c:632 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B21F346: _dwarf_tdestroy (dwarf_tsearchhash.c:665 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B20A94E: _dwarf_free_all_of_one_debug (dwarf_alloc.c:595 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B2156C3: dwarf_object_init (dwarf_init_finish.c:851 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B21B2F6: dwarf_elf_init_file_ownership (dwarf_original_elf_init.c:173 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x3D9B21B4E8: dwarf_elf_init (dwarf_original_elf_init.c:137 in /usr/lib64/libdwarf.so.1.20140805.0) ==24438== by 0x410054: process_one_file(Elf*, std::string const&, int, dwconf_s*) [clone .constprop.133] (dwarfdump.cc:932 in /usr/bin/dwarfdump) ==24438== by 0x40753F: main (dwarfdump.cc:388 in /usr/bin/dwarfdump) Switching back to dwarfdump (dwarfdump2 will be deprecated in the next release anyway) isn't going to help as it has exactly the same structure. I'm inclined to this this is a library API problem - the dwarf_elf_init is returning DLV_ERROR but attempts to ask the library for details of the error are causing it to access freed memory. So I don't think the dwarfdump tools are doing anything wrong in the way they use the library. Hopefully upstream will come up with something soon... libdwarf-20150112-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/libdwarf-20150112-1.fc21 Package libdwarf-20150112-1.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing libdwarf-20150112-1.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-0707/libdwarf-20150112-1.fc21 then log in and leave karma (feedback). Package libdwarf-20150115-1.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing libdwarf-20150115-1.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-0707/libdwarf-20150115-1.fc21 then log in and leave karma (feedback). libdwarf-20150115-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report. |