https://sourceware.org/bugzilla/show_bug.cgi?id=20921
Bug ID: 20921 Summary: STRIP crashes when writing stripped file Product: binutils Version: 2.28 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: boehme.marcel at gmail dot com Target Milestone: --- Dear all, The following bug was found with AFLFast, a fork of AFL, in a 24 hour fuzzing session on Binutils. Thanks also to Van-Thuan Pham. We also thank Nick Clifton for addressing our reported bugs so promptly. Objcopy/Strip crashes with an invalid read of size 4 for the following execution on Ubuntu 16.04 x86_64 in Binutils trunk and for preinstalled version v2.26.1 and on Ubuntu 14.04 x86_64 for Binutils in trunk and preinstalled version v2.24. $ printf "\x08\x01\x000\x04\x00\x00\x00\x08\x00\x00\x000000\x00\x00\x00\x000000\x00\x00\x00\x00\x15\x00\x00\x00000000000000000000000000000000000" > test $ ./strip -S test Segmentation fault UBSAN says: ../../bfd/aoutx.h:1958:22: runtime error: member access within null pointer of type 'const struct reloc_howto_type' VALGRIND tells us: ==47599== Invalid read of size 4 ==47599== at 0x6E6A2B: aout_32_swap_std_reloc_out (aoutx.h:1961) ==47599== by 0x6E6A2B: aout_32_squirt_out_relocs (aoutx.h:2404) ==47599== by 0x6D27A2: i386linux_write_object_contents (i386linux.c:77) ==47599== by 0x4F8809: bfd_close (opncls.c:733) ==47599== by 0x42F4C7: copy_file (objcopy.c:2886) ==47599== by 0x41670E: strip_main (objcopy.c:3788) ==47599== by 0x41670E: main (objcopy.c:4888) ==47599== Address 0x0 is not stack'd, malloc'd or (recently) free'd Best regards, - Marcel -- 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