An out-of-bounds vulnerability was found in dwarf_read_cie_fde_prefix function causing the aplication to crash. CVE request (contains reproducer and crash report): http://seclists.org/oss-sec/2016/q1/135
Created libdwarf tracking bugs for this issue: Affects: fedora-all [bug 1299966] Affects: epel-all [bug 1299967]
CVE assignment: http://seclists.org/oss-sec/2016/q1/237
- The issue appears to be resolved upstream - After bisecting, the patch seems to be included in the following 9565964f26 commit : https://github.com/tomhughes/libdwarf/commit/9565964f26 In particular, the following pick appears to be sufficient : ----8<---- diff --git a/libdwarf/dwarf_frame2.c b/libdwarf/dwarf_frame2.c index 472a174..e776020 100644 --- a/libdwarf/dwarf_frame2.c +++ b/libdwarf/dwarf_frame2.c @@ -964,7 +964,12 @@ dwarf_read_cie_fde_prefix(Dwarf_Debug dbg, Dwarf_Small *frame_ptr = frame_ptr_in; Dwarf_Small *cie_ptr_addr = 0; Dwarf_Unsigned cie_id = 0; + Dwarf_Small *section_end = section_ptr_in + section_length_in; + if(section_end < (frame_ptr +4)) { + _dwarf_error(dbg,error,DW_DLE_DEBUG_FRAME_LENGTH_BAD); + return DW_DLV_ERROR; + } /* READ_AREA_LENGTH updates frame_ptr for consumed bytes */ READ_AREA_LENGTH(dbg, length, Dwarf_Unsigned, frame_ptr, local_length_size, @@ -976,6 +981,10 @@ dwarf_read_cie_fde_prefix(Dwarf_Debug dbg, data. We should be very close to end of section. */ return DW_DLV_NO_ENTRY; } + if((frame_ptr + local_length_size) >= section_end) { + _dwarf_error(dbg,error,DW_DLE_DEBUG_FRAME_LENGTH_BAD); + return DW_DLV_ERROR; + } cie_ptr_addr = frame_ptr; READ_UNALIGNED(dbg, cie_id, Dwarf_Unsigned, --->8---
Created attachment 1142549 [details] Patch extracted from upstream commit 9565964f26
Statement: Red Hat Product Security has rated this issue as having Low security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.