https://sourceware.org/bugzilla/show_bug.cgi?id=21416
Bug ID: 21416 Summary: readelf segfault - null pointer dereferencing Product: binutils Version: 2.28 Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: dungnguy at comp dot nus.edu.sg Target Milestone: --- Created attachment 10013 --> https://sourceware.org/bugzilla/attachment.cgi?id=10013&action=edit Crashing input Dear All, This bug was found with AFLGo, a directed version of AFL/AFLFast. Thanks also to Marcel Böhme and Van-Thuan Pham. This bug was found on Ubuntu 14.04 64-bit & binutils was checked out from main repository at git://sourceware.org/git/binutils-gdb.git. Its commit is a6c21d4a553de184562fd8409a5bcd3f2cc2561a (Wed Apr 19 13:16:05 2017). binutils was built with ASAN using gcc-6.2 and clang-3.4. The configure command was: CC=clang CFLAGS="-DFORTIFY_SOURCE=2 -fstack-protector-all -fsanitize=undefined,address -fno-omit-frame-pointer -g -Wno-error" ../configure --disable-shared --disable-gdb --disable-libdecnumber --disable-readline --disable-sim To reproduce: Download the attached file - bug_14 readelf -wL bug_14 ASAN says: ==148446==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000762d96 bp 0x7ffc66657190 sp 0x7ffc66655580 T0) #0 0x762d95 in display_debug_lines_decoded /home/ubuntu/binutils-analysis/binutils-gdb/obj-asan/binutils/../../binutils/dwarf.c:3813:8 #1 0x6c20a1 in display_debug_lines /home/ubuntu/binutils-analysis/binutils-gdb/obj-asan/binutils/../../binutils/dwarf.c:4195:21 #2 0x5ae843 in display_debug_section /home/ubuntu/binutils-analysis/binutils-gdb/obj-asan/binutils/../../binutils/readelf.c:13299:16 #3 0x51ede8 in process_section_contents /home/ubuntu/binutils-analysis/binutils-gdb/obj-asan/binutils/../../binutils/readelf.c:13385:10 #4 0x4c99cb in process_object /home/ubuntu/binutils-analysis/binutils-gdb/obj-asan/binutils/../../binutils/readelf.c:17682:9 #5 0x4c46f0 in process_file /home/ubuntu/binutils-analysis/binutils-gdb/obj-asan/binutils/../../binutils/readelf.c:18074:13 #6 0x4c258a in main /home/ubuntu/binutils-analysis/binutils-gdb/obj-asan/binutils/../../binutils/readelf.c:18146:11 #7 0x7f5ab05c4f44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287 #8 0x4bae9c in _start (/home/ubuntu/binutils-analysis/binutils-gdb/obj-asan/binutils/readelf+0x4bae9c) VALGRIND says: ==148448== Invalid read of size 8 ==148448== at 0x44686A: display_debug_lines_decoded (dwarf.c:3813) ==148448== by 0x4479CF: display_debug_lines (dwarf.c:4195) ==148448== by 0x42D4D3: display_debug_section (readelf.c:13299) ==148448== by 0x42D7BF: process_section_contents (readelf.c:13385) ==148448== by 0x437F14: process_object (readelf.c:17682) ==148448== by 0x438E37: process_file (readelf.c:18074) ==148448== by 0x438FDF: main (readelf.c:18146) ==148448== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==148448== ==148448== ==148448== Process terminating with default action of signal 11 (SIGSEGV) ==148448== Access not within mapped region at address 0x0 ==148448== at 0x44686A: display_debug_lines_decoded (dwarf.c:3813) ==148448== by 0x4479CF: display_debug_lines (dwarf.c:4195) ==148448== by 0x42D4D3: display_debug_section (readelf.c:13299) ==148448== by 0x42D7BF: process_section_contents (readelf.c:13385) ==148448== by 0x437F14: process_object (readelf.c:17682) ==148448== by 0x438E37: process_file (readelf.c:18074) ==148448== by 0x438FDF: main (readelf.c:18146) -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils