Summary: | A Heap-buffer-overflow problem was discovered in the function read_srclines in dwarf_getsrclines.c in libdw | ||
---|---|---|---|
Product: | elfutils | Reporter: | wcventure <wcventure> |
Component: | libdw | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | elfutils-devel, mark |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | 2019-01-20 00:00:00 | |
Attachments: |
POC1
POC2 POC3 |
Description
wcventure
2019-01-18 11:17:03 UTC
Created attachment 11543 [details]
POC2
Created attachment 11544 [details]
POC3
Nice find. Replicated using valgrind on the reproducers. We would assume the dir and file tables were properly terminated by a NUL byte. But if that wasn't actually there we could read one byte past the end of the data buffer. A similar issue was in readelf.c (although it is harder to trigger since readlelf has more sanity checks before it can get to this point). Proposed fix: https://sourceware.org/ml/elfutils-devel/2019-q1/msg00068.html commit 2562759d6fe5b364fe224852e64e8bda39eb2e35 Author: Mark Wielaard <mark@klomp.org> Date: Sun Jan 20 22:10:18 2019 +0100 libdw: Check terminating NUL byte in dwarf_getsrclines for dir/file table. For DWARF version < 5 the .debug_line directory and file tables consist of a terminating NUL byte after all strings. The code used to just skip this without checking it actually existed. This could case a spurious read past the end of data. Fix the same issue in readelf. https://sourceware.org/bugzilla/show_bug.cgi?id=24102 Signed-off-by: Mark Wielaard <mark@klomp.org> Pushed to master. Apparently this bug got assigned CVE-2019-7149 |