Add checks for memory access violations exposed by fuzzed archives.
[deliverable/binutils-gdb.git] / binutils / ChangeLog
index 0dc603acd4afc1ffb1b1cb6e84d8bf9dac3074b3..ecb7c8bf8e90f8548fd4bf0ed0a7d1b19097e835 100644 (file)
@@ -1,3 +1,547 @@
+2014-12-01  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * dwarf.c (process_cu_tu_index): Check for an out of range row
+       index.
+       * elfcomm.c (adjust_relative_path): Change name_len parameter to
+       an unsigned long.  Check for path length overflow.
+       (process_archive_index_and_symbols): Check for invalid header
+       size.
+       (setup_archive): Add checks for invalid archives.
+       (get_archive_member_name): Add range checks.
+       * elfcomm.h (adjust_relative_path): Update prototyoe.
+       * readelf.c (process_archive): Add range checks.
+
+2014-11-28  Alan Modra  <amodra@gmail.com>
+
+       * readelf.c (get_32bit_elf_symbols): Cast bfd_size_type values to
+       unsigned long for %lx.
+       (get_64bit_elf_symbols, process_section_groups): Likewise.
+
+2014-11-27  Espen Grindhaug <espen@grindhaug.org>
+           Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * readelf.c (get_data): Move excessive length check to earlier on
+       in the function and allow for wraparound in the arithmetic.
+       (get_32bit_elf_symbols): Terminate early if the section size is
+       zero.  Check for an invalid sh_entsize.  Check for an index
+       section with an invalid size.
+       (get_64bit_elf_symbols): Likewise.
+       (process_section_groups): Check for an invalid sh_entsize.
+
+2014-11-24  Mark Wielaard  <mjw@redhat.com>
+
+       * dwarf.c (read_and_display_attr_value): Handle DW_LANG_C11,
+       DW_LANG_C_plus_plus_11 and DW_LANG_C_plus_plus_14.
+
+2014-11-26  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17512
+       * dwarf.c (display_block): Do nothing if the block starts after
+       the end of the buffer.
+       (read_and_display_attr_value): Add range checks.
+       (struct Frame_Chunk): Make the ncols and ra fields unsigned.
+       (frame_need_space): Test for an ncols of zero.
+       (read_cie): Fail if the augmentation data extends off the end of
+       the buffer.
+       (display_debug_frames): Add checks for read_cie failing.  Add
+       range checks.
+
+2014-11-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * objdump.c (objdump_print_symname): Replace
+       bfd_elf_get_symbol_version_string with
+       bfd_get_symbol_version_string.
+
+2014-11-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/16496
+       * objdump.c (objdump_print_symname): Call
+       bfd_elf_get_symbol_version_string to get ELF symbol version
+       string.  Append version string if needed.
+
+       * readelf.c (versioned_symbol_info): New enum.
+       (get_symbol_version_string): New.  Extracted from
+       process_symbol_table.
+       (dump_relocations): Add a new argument to indicate if dynamic
+       symbol table is used.  Use get_symbol_version_string to get
+       symbol version string for dynamic symbol.  Append version string
+       if needed.
+       (process_relocs): Updated dump_relocations call.
+       (process_symbol_table): Use get_symbol_version_string.
+
+2014-11-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * configure: Regenerated.
+
+2014-11-21  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17512
+       * dwarf.c (get_encoded_value): Check for an encoded size of 0.
+       (display_debug_lines_raw): Check for an invalid line range value.
+       (display_debug_frames): Check for corrupt augmentation data.
+
+2014-11-21  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * readelf.c (process_version_sections): Prevent an infinite loop
+       processing corrupt version need data.
+       (process_corefile_note_segment): Handle corrupt notes.
+
+2014-11-21  Terry Guo  <terry.guo@arm.com>
+
+       * readelf.c (arm_attr_tag_FP_arch): Extended to support FPv5.
+
+2014-11-19  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
+
+       * dwarf.c (process_extended_line_op): Fix signedness warning.
+
+2014-11-18  Nick Clifton  <nickc@redhat.com>
+
+       PR binutuls/17605
+       * bucomm.c (print_arelt_descr): Check for ctime returning NULL.
+
+2014-11-18  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17512
+       * dwarf.c (get_encoded_value): Warn and return if the encoded
+       value is more than 64-bits long.
+       (SAFE_BYTE_GET): Do not attempt to read more than 64-bits.
+       (process_extended_line_op): Add more range checks.
+       (decode_location_expression): Use the return value from
+       display_block.  Add more range checks.
+       (read_debug_line_header): Add range check.
+       (display_debug_lines_raw): Add range checks.
+       (display_debug_frames): Silently skip multiple zero terminators.
+       Add range checks.
+       (process_cu_tu_index): Check for non-existant or empty sections.
+       Use SAFE_BYTE_GET instead of byte_get.
+
+2014-11-18  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * readelf.c (get_unwind_section_word): Skip reloc processing if
+       there are no relocs associated with the section.
+       (decode_tic6x_unwind_bytecode): Warn and return if the stack
+       pointer adjustment falls off the end of the buffer.
+
+2014-11-14  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17512
+       * dwarf.c (get_encoded_value): Add an 'end' parameter.  Change the
+       'data' parameter to a double pointer and return the updated value.
+       (decode_location_expression): Update call to get_encoded_value.
+       (frame_need_space): Handle the case where one or both of the
+       mallocs fails.
+       (read_cie): Initialise the cie pointer, even if the read fails.
+       (display_debug_frames): Warn if the calculated block_end is before
+       the start of the block.  Break the loop if the CIE could not be
+       read.  Update call to get_encoded_value.  Warn if the read CFA
+       expressions are too big.
+
+2014-11-13  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * readelf.c (process_version_sections): If the read of the version
+       def information fails, make sure that the external verdef data is
+       not used.
+       (get_dynamic_data): Do not attempt to allocate memory for more
+       dynamic data than there is in the file.  If the read fails, free
+       the allocated buffer.
+       (process_symbol_table): Do not print dynamic information if we
+       were unable to read the dynamic symbol table.
+       (print_gnu_note): Do not print the note if the descsz is too
+       small.
+
+2014-11-12  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17512
+       * dwarf.c (read_and_display_attr_value): Check that we do not read
+       past end.
+       (display_debug_pubnames_worker): Add range checks.
+       (process_debug_info): Check for invalid pointer sizes.
+       (display_loc_list): Likewise.
+       (display_loc_list_dwo): Likewise.
+       (display_debug_ranges): Likewise.
+       (display_debug_aranges): Check for invalid address size.
+       (read_cie): Add range checks.  Replace call strchr with while loop.
+       * objdump.c (dump_dwarf): Replace abort with a warning message.
+       (print_section_stabs): Improve range checks.
+       * rdcoff.c (coff_get_slot): Use long for indx parameter type.
+       Add check for an excesively large index.
+       * rddbg.c (read_section_stabs_debugging_info): Zero terminate the
+       string table.  Avoid walking off the end of the stabs data.
+       * stabs.c (parse_stab_string): Add check for a NULL name.
+
+2014-11-11  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * binutils/readelf.c (dynamic_nent): Change type to size_t.
+       (slurp_rela_relocs): Use size_t type for nrelas.
+       (slurp_rel_relocs): Likewise.
+       (get_program_headers): Improve out of memory error message.
+       (get_32bit_section_headers): Likewise.
+       (get_32bit_section_headers): Likewise.
+       (get_64bit_section_headers): Likewise.
+       (get_32bit_elf_symbols): Likewise.
+       (get_64bit_elf_symbols): Likewise.
+       (process_section_groups): Likewise.
+       (get_32bit_dynamic_section): Likewise.
+       (get_64bit_dynamic_section): Likewise.
+       (process_dynamic_section): Likewise.
+       (process_version_sections): Likewise.
+       (get_symbol_index_type): Likewise.
+       (process_mips_specific): Likewise.
+       (process_corefile_note_segment): Likewise.
+       (process_version_sections): Use size_t type for total.
+       (get_dynamic_data): Change type of number parameter to size_t.
+       Improve out of memory error messages.
+       (process_symbol_table): Change type of nbuckets and nchains to
+       size_t.  Skip processing of sections headers if there are none.
+       Improve out of memory error messages.
+
+2014-11-11  Nick Clifton  <nickc@redhat.com>
+
+       * po/fr.po: Updated French translation.
+
+2014-11-11  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * readelf.c (display_arm_attribute): Avoid reading off the end of
+       the buffer when processing a Tag_nodefaults.
+
+2014-11-10  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * (ia64_process_unwind): Replace assertion with an error message.
+       Add range checking for group section indicies.
+       (hppa_process_unwind): Replace assertion with an error message.
+       (process_syminfo): Likewise.
+       (decode_arm_unwind_bytecode): Add range checking.
+       (dump_section_as_strings): Add more string range checking.
+       (display_tag_value): Likewise.
+       (display_arm_attribute): Likewise.
+       (display_gnu_attribute): Likewise.
+       (display_tic6x_attribute): Likewise.
+       (display_msp430x_attribute): Likewise.
+
+2014-11-10  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17552
+       * (copy_archive): Clean up temporary files even if an error
+       occurs.
+
+2014-11-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * readelf.c (process_dynamic_section): Cast time value to unsigned
+       long to print.
+
+2014-11-07  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * readelf.c (get_data): Avoid allocating memory when we know that
+       the read will fail.
+       (find_section_by_type): New function.
+       (get_unwind_section_word): Check for invalid symbol indicies.
+       Check for invalid reloc types.
+       (get_32bit_dynamic_section): Add range checks.
+       (get_64bit_dynamic_section): Add range checks.
+       (process_dynamic_section): Check for a corrupt time value.
+       (process_symbol_table): Add range checks.
+       (dump_section_as_strings): Add string length range checks.
+       (display_tag_value): Likewise.
+       (display_arm_attribute): Likewise.
+       (display_gnu_attribute): Likewise.
+       (display_tic6x_attribute): Likewise.
+       (display_msp430x_attribute): Likewise.
+       (process_mips_specific): Add range check.
+
+2014-11-06  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17552, binutils/17533
+       * bucomm.c (is_valid_archive_path): New function.  Returns false
+       for absolute pathnames and pathnames that include /../.
+       * bucomm.h (is_valid_archive_path): Add prototype.
+       * ar.c (extract_file): Use new function to check for valid
+       pathnames when extracting files from an archive.
+       * objcopy.c (copy_archive): Likewise.
+       * doc/binutils.texi: Update documentation to mention the
+       limitation on pathname of archive members.
+
+2014-11-05  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * readelf.c (printable_section_name): New function.
+       (printable_section_name_from_index): New function.
+       (dump_relocations): Use new function.
+       (process_program_headers, get_32bit_elf_symbols,
+       (get_64bit_elf_symbols, process_section_headers,
+       (process_section_groups, process_relocs, ia64_process_unwind,
+       (hppa_process_unwind, get_unwind_section_word, decode_arm_unwind,
+       (arm_process_unwind, process_version_sections,
+       (process_symbol_table, apply_relocations, get_section_contents,
+       (dump_section_as_strings, dump_section_as_bytes,
+       (display_debug_section, process_attributes, process_mips_specific,
+       (process_mips_specific process_gnu_liblist): Likewise.
+       (get_unwind_section_word): Check for a missing symbol table.
+       Replace aborts with error messages.
+       (arm_process_unwind): Check for a missing string table.
+       (process_attributes): Check for an attribute length that is too
+       small.
+       (process_mips_specific): Check for a corrupt GOT symbol offset.
+
+2014-11-05  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17533
+       * bucomm.c (is_valid_archive_path): New function.
+       * bucomm.h (is_valid_archive_path): Prototype it.
+       * ar.c (extract_file): Call is_valid_archive_path to verify a
+       member filename before extracting it.
+       * objcopy.c (copy_archive): Likewise.
+
+2014-11-05  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
+
+       * readelf.c (process_mips_specific): Fix format string warning.
+
+2014-11-04  Matthew Fortune  <matthew.fortune@imgtec.com>
+
+       * readelf.c (process_mips_specific): Rename index to idx.
+
+2014-11-04  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17531
+       * readelf.c (get_data): If the reason parameter is null, do not
+       print any error messages.
+       (get_32bit_section_headers): Verify section header entry size
+       before reading in the section headers.
+       (get_64bit_section_headers): Likewise.
+       (process_section_headers): Pass FALSE to get_section_headers.
+       (get_file_header): Pass TRUE to get_section_headers.
+       (process_dynamic_section): Change an assert to an error message.
+       (process_symbol_table): Handle corrupt histograms.
+
+       (get_32bit_program_headers): Verify program header entry size
+       before reading in the program headers.
+       (get_64bit_program_headers): Likewise.
+       (get_unwind_section_word): Do nothing if no section was provided.
+       Fail if the offset is outside of the section.
+       (print_dynamic_symbol): Catch out of range symbol indicies.
+       (process_mips_specific): Likewise.
+       (process_attributes): Make sure that there is enough space left in
+       the section before attempting to read the length of the next
+       attribute.
+
+2014-11-03  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17512
+       * objdump.c (slurp_symtab): Fail gracefully if the table could not
+       be read.
+       (dump_relocs_in_section): Likewise.
+
+2014-11-03  Nick Clifton  <nickc@redhat.com>
+
+       * po/fi.po: Updated Finnish translation.
+       * po/sv.po: Updated Swedish translation.
+
+2014-11-01  Hans-Peter Nilsson  <hp@axis.com>
+
+       * readelf.c (get_32bit_elf_symbols): Cast error
+       parameters of bfd_size_type with the %lx format to
+       unsigned long.
+
+2014-10-31  Andrew Pinski  <apinski@cavium.com>
+           Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>
+
+       * readelf.c (print_mips_isa_ext): Print the value of Octeon3.
+
+2014-10-31  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       * cxxfilt.c (main): Add case for dlang_demangling style.
+
+2014-10-31  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/17512
+       * readelf.c (process_program_headers): Avoid memory exhaustion due
+       to corrupt values in a dynamis segment header.
+       (get_32bit_elf_symbols): Do not attempt to read an over-large
+       section.
+       (get_64bit_elf_symbols): Likewise.
+
+2014-10-31  Nick Clifton  <nickc@redhat.com>
+
+       * strings.c: Add new command line option --data to only scan the
+       initialized, loadable data secions of binaries.  Choose the
+       default behaviour of --all or --data based upon a configure
+       option.
+       * doc/binutils.texi (strings): Update documentation.  Include
+       description  of why the --data option might be unsafe.
+       * configure.ac: Add new option --disable-default-strings-all which
+       restores the old behaviour of strings using --data by default.  If
+       the option is not used make strings use --all by default.
+       * NEWS: Mention the new behaviour of strings.
+       * configure: Regenerate.
+       * config.in: Regenerate.
+
+2014-10-30  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (CHECK_ENTSIZE_VALUES): Rewrite error message so that
+       there is a single string for translation.
+       (dynamic_section_mips_val): Likewise.
+
+2014-10-29  Nick Clifton  <nickc@redhat.com>
+
+       * po/bg.po: Updated Bulgarian translation.
+       * po/sr.po: New Serbian translation.
+       * po/sv.po: Updated Swedish translation.
+
+2014-10-22  Matthew Fortune  <matthew.fortune@imgtec.com>
+
+       * readelf.c (print_mips_ases): Print unknown ASEs.
+       (print_mips_isa_ext): Print the value of an unknown extension.
+
+2014-10-15  Tristan Gingold  <gingold@adacore.com>
+
+       * configure: Regenerate.
+
+2014-10-14  Tristan Gingold  <gingold@adacore.com>
+
+       * NEWS: Add marker for 2.25.
+
+2014-10-14  Alan Modra  <amodra@gmail.com>
+
+       PR 17453
+       * dwarf.c (read_leb128): Avoid signed overflow.
+       (read_debug_line_header): Likewise.
+
+2014-10-14  Alan Modra  <amodra@gmail.com>
+
+       PR 17453
+       * readelf.c (process_program_headers): Correct fscanf format used
+       for interpreter.
+
+2014-10-09  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+       * readelf.c (display_sparc_hwcaps2): New function.
+       (display_sparc_gnu_attribute): Call `display_sparc_hwcaps2' when
+       handling `Tag_GNU_Sparc_HWCAPS2' attributes.
+
+2014-09-22  Alan Modra  <amodra@gmail.com>
+
+       PR 16563
+       * dwarf.c (GET): Remove semicolon.
+       (read_cie): New function, extracted from..
+       (display_debug_frames): ..here.  Correctly handle signed offset
+       from FDE to CIE in .eh_frame.  Decode forward referenced CIEs too.
+
+2014-09-16  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (display_arm_attribute): Use unsigned int type for
+       tag, val and type variables.
+
+2014-09-16  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
+
+       * readelf.c (decode_NDS32_machine_flags): Display ABI2 FP+.
+
+2014-09-15  Andrew Bennett  <andrew.bennett@imgtec.com>
+           Matthew Fortune  <matthew.fortune@imgtec.com>
+
+       * readelf.c (get_machine_flags): Add support for mips32r6 and
+       mips64r6.
+
+2014-09-01  Jon TURNEY  <jon.turney@dronecode.org.uk>
+
+       * objcopy.c (is_nondebug_keep_contents_section): Change
+       '.build-id' to '.buildid'.
+
+2014-08-22  Richard Henderson  <rth@redhat.com>
+
+       * dwarf.h (init_dwarf_regnames_aarch64): Declare.
+       * dwarf.c (dwarf_regnames_aarch64): New.
+       (init_dwarf_regnames_aarch64): New.
+       (init_dwarf_regnames): Call it.
+       * objdump.c (dump_dwarf): Likewise.
+
+2014-08-19  Alan Modra  <amodra@gmail.com>
+
+       * configure: Regenerate.
+
+2014-08-14  Alan Modra  <amodra@gmail.com>
+
+       * configure.ac: Move ACX_LARGEFILE after LT_INIT.
+       * config.in: Regenerate.
+       * configure: Regenerate.
+
+2014-07-29  Matthew Fortune  <matthew.fortune@imgtec.com>
+
+       * readelf.c (get_mips_segment_type): Display name for PT_MIPS_ABIFLAGS.
+       (get_mips_section_type_name): Display name for SHT_MIPS_ABIFLAGS.
+       (display_mips_gnu_attribute): Abstracted fp abi printing to...
+       (print_mips_fp_abi_value): New static function. Handle new FP ABIs.
+       (print_mips_ases, print_mips_isa_ext): New static functions.
+       (get_mips_reg_size): Likewise.
+       (process_mips_specific): Display abiflags data.
+
+2014-07-28  Alan Modra  <amodra@gmail.com>
+
+       PR 13227
+       * nm.c (filter_symbols): Warn on __gnu_lto_slim.
+
+2014-07-07  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (get_symbol_type): Revert accidental change to
+       detection of thumb function symbols.
+
+2014-07-04  Alan Modra  <amodra@gmail.com>
+
+       * configure.ac: Rename from configure.in.
+       * Makefile.in: Regenerate.
+       * config.in: Regenerate.
+       * doc/Makefile.in: Regenerate.
+
+2014-07-04  Alan Modra  <amodra@gmail.com>
+
+       * configure.in: Include bfd/version.m4.
+       (AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
+       (BFD_VERSION): Delete.
+       * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+       * doc/Makefile.in: Regenerate.
+
+2014-07-03  Tristan Gingold  <gingold@adacore.com>
+
+       * doc/binutils.texi: Clarify addr2line output.
+
+2014-07-01  Alan Modra  <amodra@gmail.com>
+
+       * objdump.c (dump_bfd_header): Don't print HAS_LOAD_PAGE.
+
+2014-06-26  Erik Akermann  <kurterikackermann@gmail.com>
+
+       * strings.c: Add -w/--include-all-whitespace option to include any
+       whitespace character in the displayed strings.
+       * NEWS: Mention the new feature.
+       * doc/binutils.texi (strings): Document the new command line
+       option.
+
+2014-06-26  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (process_note_sections): If there are no note sections
+       try processing note segments instead.
+
+2014-06-17  Anton Lavrentiwev  <lavr@ncbi.nim.nih.gov>
+
+       PR binutils/16923
+       * rcparse.y (fixedverinfo): Prevent large version numbers from
+       corrupting other values.
+
+2014-06-09  Romain Chastenet  <romain.chastenet@free.fr>
+
+       PR binutils/16252
+       * dwarf.c (display_debug_frames): Remember the state of the
+       cfa_offset, cfa_reg, ra and cfa_exp field
+
 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
 
        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
 
 2014-03-14  Meador Inge  <meadori@codesourcery.com>
 
-         * dwarf.c (strnlen): Move prototype ...
-        * sysdep.h (strnlen): ... to here.
+       * dwarf.c (strnlen): Move prototype ...
+       * sysdep.h (strnlen): ... to here.
 
 2014-03-12  Nick Clifton  <nickc@redhat.com>
 
This page took 0.033421 seconds and 4 git commands to generate.