Submit #545773: GNU Library Objdump in Binutil 2.44 and 2.43 (also other possible downward versions) Memory Leakinfo

TitleGNU Library Objdump in Binutil 2.44 and 2.43 (also other possible downward versions) Memory Leak
DescriptionHi We found a memory leakage issue in `objdump`, which tested the `objdump` in both binutils-2.43 and 2.44. Please check the following steps to reproduce. Build command: `CC=gcc CFLAGS="-g -fsanitize=address" ../configure --disable-nls --disable-largefile --disable-gdb --disable-sim --disable-readline --disable-libdecnumber --disable-libquadmath --disable-libstdcxx --disable-ld --disable-gprof --disable-gas --disable-intl --disable-etc` Environment: Ubuntu 18.04; GCC-7.5 The command for reproducing the memory leakage: $./objdump -a -Zi - BFD header file version (GNU Binutils) 2.44 elf64-x86-64 (header little endian, data little endian) i386 elf32-i386 (header little endian, data little endian) i386 elf32-iamcu (header little endian, data little endian) iamcu elf32-x86-64 (header little endian, data little endian) i386 pei-i386 (header little endian, data little endian) i386 pe-x86-64 (header little endian, data little endian) i386 pei-x86-64 (header little endian, data little endian) i386 elf64-little (header little endian, data little endian) i386 iamcu elf64-big (header big endian, data big endian) i386 iamcu elf32-little (header little endian, data little endian) i386 iamcu elf32-big (header big endian, data big endian) i386 iamcu srec (header endianness unknown, data endianness unknown) i386 iamcu symbolsrec (header endianness unknown, data endianness unknown) i386 iamcu verilog (header endianness unknown, data endianness unknown) i386 iamcu tekhex (header endianness unknown, data endianness unknown) i386 iamcu binary (header endianness unknown, data endianness unknown) i386 iamcu ihex (header endianness unknown, data endianness unknown) i386 iamcu plugin (header little endian, data little endian) elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 pei-i386 pe-x86-64 i386 elf64-x86-64 elf32-i386 ----------- elf32-x86-64 pei-i386 pe-x86-64 iamcu ------------ ---------- elf32-iamcu ------------ -------- --------- pei-x86-64 elf64-little elf64-big elf32-little elf32-big srec i386 pei-x86-64 elf64-little elf64-big elf32-little elf32-big srec iamcu ---------- elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex plugin i386 symbolsrec verilog tekhex binary ihex ------ iamcu symbolsrec verilog tekhex binary ihex ------ ================================================================= ==11652==ERROR: LeakSanitizer: detected memory leaks Direct leak of 12288 byte(s) in 1 object(s) allocated from: #0 0x7ffff6ef6b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40) #1 0x555555aa6139 in xrealloc ../../libiberty/xmalloc.c:179 #2 0x55555573eb1e in do_display_target ../../binutils/bucomm.c:277 #3 0x555555808cf4 in bfd_iterate_over_targets ../../bfd/targets.c:1772 #4 0x55555573f1d4 in display_target_list ../../binutils/bucomm.c:327 #5 0x55555573f81a in display_info ../../binutils/bucomm.c:434 #6 0x5555556b2b68 in main ../../binutils/objdump.c:6356 #7 0x7ffff6844c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) SUMMARY: AddressSanitizer: 12288 byte(s) leaked in 1 allocation(s). Thanks, Haoxin
Source⚠️ https://sourceware.org/bugzilla/show_bug.cgi?id=32716
User
 Haoxin Tu (UID 81718)
Submission03/29/2025 01:40 (1 Year ago)
Moderation04/03/2025 13:14 (5 days later)
StatusAccepted
VulDB entry303151 [GNU Binutils 2.43/2.44 objdump binutils/bucomm.c display_info memory leak]
Points20

Do you need the next level of professionalism?

Upgrade your account now!