https://sourceware.org/bugzilla/show_bug.cgi?id=21155
Bug ID: 21155 Summary: readelf segfault - PR 21137 seems to be incomplete Product: binutils Version: 2.29 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: thuanpv at comp dot nus.edu.sg Target Milestone: --- Created attachment 9822 --> https://sourceware.org/bugzilla/attachment.cgi?id=9822&action=edit Crashing input Dear all, This bug was found with AFLGo, a directed version of AFL/AFLFast. Thanks also to Marcel Böhme. 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 61697d017e114d7667fbb340fb73f8184d48ee5a (Tue Feb 14 00:00:30 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_1 readelf -w bug_1 Valgrind says: readelf: Error: Section 7 has invalid sh_entsize of 0000000000001118 readelf: Error: (Using the expected size of 16 for the rest of this dump) readelf: Error: Reading 0x210 bytes extends past end of file for symbols readelf: Warning: unable to apply unsupported reloc type 8 to section .debug_info readelf: Warning: unable to apply unsupported reloc type 0 to section .debug_info readelf: Warning: unable to apply unsupported reloc type 10 to section .debug_info readelf: Warning: unable to apply unsupported reloc type 53 to section .debug_info readelf: Warning: unable to apply unsupported reloc type 8 to section .debug_info readelf: Warning: unable to apply unsupported reloc type 2 to section .debug_info ==51968== ==51968== Process terminating with default action of signal 11 (SIGSEGV) ==51968== Bad permissions for mapped region at address 0x5033C3D ==51968== at 0x438EAB: byte_put_little_endian (elfcomm.c:81) ==51968== by 0x41D538: target_specific_reloc_handling (readelf.c:11805) ==51968== by 0x41D538: apply_relocations (readelf.c:12431) ==51968== by 0x41E506: load_specific_debug_section (readelf.c:13021) ==51968== by 0x4239DA: display_debug_section (readelf.c:13125) ==51968== by 0x4239DA: process_section_contents (readelf.c:13207) ==51968== by 0x4239DA: process_object (readelf.c:16899) ==51968== by 0x402111: process_file (readelf.c:17273) ==51968== by 0x402111: main (readelf.c:17344) ================================================================= ==73882==ERROR: AddressSanitizer: SEGV on unknown address 0x610fffe39dbd (pc 0x00000072497d sp 0x7ffc4e09d0a0 bp 0x7ffc4e09d350 T0) #0 0x72497c in byte_put_little_endian /home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/../../binutils/elfcomm.c:81 #1 0x54da2b in target_specific_reloc_handling /home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/../../binutils/readelf.c:11805 #2 0x52e8de in apply_relocations /home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/../../binutils/readelf.c:12431 #3 0x4847c9 in load_specific_debug_section /home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/../../binutils/readelf.c:13021 #4 0x56654c in display_debug_section /home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/../../binutils/readelf.c:13125 #5 0x4e1a7f in process_section_contents /home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/../../binutils/readelf.c:13207 #6 0x48d720 in process_object /home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/../../binutils/readelf.c:16899 #7 0x488475 in process_file /home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/../../binutils/readelf.c:17273 #8 0x4856d3 in main /home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/../../binutils/readelf.c:17344 #9 0x7f3fd362af44 (/lib/x86_64-linux-gnu/libc.so.6+0x21f44) #10 0x47ddfc in _start (/home/ubuntu/thesis/subjects/binutils-gdb-nick/build-asan/binutils/readelf+0x47ddfc) -- 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