summaryrefslogtreecommitdiffstats
path: root/src/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
...
* Always call gelf_fsize with EV_CURRENT as argument.Mark Wielaard2015-05-131-0/+5
| | | | | | | | | | Don't trust the elf version given by the file. It could be completely bogus. In which case gelf_fsize just returns zero. Which could cause divide by zero errors. https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c34 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* elflint: Check gnu_hash has enough data and bitmask_words is not zero.Mark Wielaard2015-05-121-1/+2
| | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c31 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* elflint: Add sanity checks to check_attributes.Mark Wielaard2015-05-121-0/+2
| | | | | | | | | | This is similar to commit 9644aa for readelf print_attributes. Bail out when the vendor name isn't terminated and add overflow check for subsection_len. Note that readelf does handle non-gnu attributes, while elflint doesn't. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* elflint: Use Use Elf64_Word for shdr->sh_info cnt.Mark Wielaard2015-05-121-0/+2
| | | | | | | On 32bit using int might overflow. https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c31 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* elflint: Stop checking section when 2nd hash function shift too big.Mark Wielaard2015-05-121-0/+5
| | | | | | Nothing good comes from trying to continue with a bogus hash function. https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c31
* nm: Handle dwarf_linesrc returning NULL.Mark Wielaard2015-05-121-0/+4
| | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1170810#32 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Replace futimes with futimens.Max Filippov2015-05-051-0/+8
| | | | | | | | futimes is not standard function, and it's not available in uClibc. Use futimens which is POSIX. Suggested-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* Drop mtrace calls.Max Filippov2015-05-041-0/+12
| | | | | | | mtrace is a GNU extension not supported by uClibc and it's believed to not be really used. Drop mtrace() calls and #include <mcheck.h>. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* Link against standalone argp libraryAnthony G. Basile2015-05-041-0/+7
| | | | | | | | | | | | | | argp is not part of POSIX standards and not provided by uClibc or some other standard C libraries. However, it is possible to link against a breakout argp library. One is provided at http://www.lysator.liu.se/~nisse/misc/ This patch tests if libc provides argp otherwise it adds the linker flag -largp where needed in the build system. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* readelf: Fix cie_offset calculation comparison on 32bit.Mark Wielaard2015-04-281-0/+6
| | | | | | | | | gcc -fsanitize=undefined pointed out that on 32bit systems the calculation to match the cie_offset to the cie_id could be undefined because a cie_id could be an unsigned 64bit value while ptrdiff_t is only 32bits. Correct the calculation to use 64bit values. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Check all offsets used in print_gdb_index_section against d_size.Mark Wielaard2015-04-281-0/+5
| | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c29 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Always try to print some debug section information.Mark Wielaard2015-04-281-0/+4
| | | | | | | | Even if we cannot create a proper Dwarf dbg we can still print the information of various debug sections. All all debug print section functions already check first they can access the appropriate data. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Add overflow checking to print_gdb_index_section dataend checks.Mark Wielaard2015-04-281-0/+5
| | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c29 Signed-off-by: Mark Wielaard <mjw@redhat.com>
* src: Remove __DATE__ from internal error messages.Mark Wielaard2015-04-141-0/+7
| | | | | | | The date didn't really add much information (it is the day on which the code happened to be compiled) and it prevents creating reproducible builds. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Publish known-dwarf.hPetr Machata2015-03-311-0/+11
| | | | | | | | | | | | | - Make the macro names properly scoped (DWARF_ALL_KNOWN_* and DWARF_ONE_KNOWN_*). - Simplify the calling convention: don't keep track of the comment associated with the enumerator, always use the non-_DESC DWARF_ONE_KNOWN_* callback. - Install known-dwarf.h alongside libdw.h and others. Signed-off-by: Petr Machata <pmachata@redhat.com>
* elflint: Correct gnu_symbias usage in compare_hash_gnu_hash.Mark Wielaard2015-03-131-0/+4
| | | | | | | | | | | commit 0a545e "elflint: Add various low-level checks." introduced a bug in the handling of the gnu_symbias. The symbol in the bucket should first be compared to STN_UNDEF before applying the bias. And the used symbol index should have the bias added when compared against plain hash symbol. Found on Debian wheezy with run-elflint-self.sh. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* elfcmp: Add some NULL and zero checks.Mark Wielaard2015-01-151-0/+6
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c17 Reported-by: Alexander Cherepanov <cherepan@mccme.ru> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* elflint: Add various low-level checks.Mark Wielaard2015-01-151-0/+25
| | | | | | | | | elflint could crash or hang because it didn't check some low level issues. https://bugzilla.redhat.com/show_bug.cgi?id=1170810 Reported-by: Alexander Cherepanov <cherepan@mccme.ru> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* strings: Produce error when section data falls outside file.Mark Wielaard2015-01-121-0/+5
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1170810 Reported-by: Alexander Cherepanov <cherepan@mccme.ru> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* nm: Guard against divide by zero in error check.Mark Wielaard2015-01-121-0/+5
| | | | | | | | | Also add section index number in error message. https://bugzilla.redhat.com/show_bug.cgi?id=1170810 Reported-by: Alexander Cherepanov <cherepan@mccme.ru> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* nm: Handle/Skip /SYM64/ index entries.Mark Wielaard2015-01-121-0/+4
| | | | | | Add a testcase to show eu-nm now handles archives with 64-bit symbol table. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* nm: Stop processing ar members on first invalid offset.Mark Wielaard2015-01-121-0/+4
| | | | | | | | | Otherwise we will keep looping on that same invalid entry. https://bugzilla.redhat.com/show_bug.cgi?id=1170810 Reported-by: Alexander Cherepanov <cherepan@mccme.ru> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Don't try to read macinfo cus sentinel or beyond.Mark Wielaard2015-01-121-0/+5
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1170810 Reported-by: Alexander Cherepanov <cherepan@mccme.ru> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Add more sanity checks to print_debug_exception_table.Mark Wielaard2015-01-121-0/+6
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1170810 Reported-by: Alexander Cherepanov <cherepan@mccme.ru> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* avoid scary command outputUlrich Drepper2014-12-181-0/+4
| | | | | | The commands to check for invalid text relocations in the generated DSOs shouldn't be displayed. They contain an echo which prints the text. This patch suppresses the commands from being printed.
* readelf: Add bounds check before each CFA op that takes an argument.Mark Wielaard2014-12-171-0/+5
| | | | | | | Some CFA ops don't take any arguments, for those it is valid to be at the end of the data block. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Print dwarf_errmsg if dwarf_onesrcline or dwarf_linesrc fails.Mark Wielaard2014-12-171-0/+5
| | | | | | Don't just crash using the NULL result in print_decoded_line_section. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Correct overflow check for length in print_debug_aranges_section.Mark Wielaard2014-12-171-0/+1
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf,libdw: Correct .debug_line overflow check for unit_length.Mark Wielaard2014-12-171-0/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Warn, don't assert, if loclist or rangelist offset is too big.Mark Wielaard2014-12-171-0/+6
| | | | | | | | | We use a couple of bits to keep track of the addr size, dwarf size and warning given for a loclist or rangelist offset. Normally offset won't be that big and will fit in 61-bits easily. But if not, don't assert, but just warn we don't handle such large offsets. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Don't assert when addr_size or ref_size is not 4 or 8 in print_ops.Mark Wielaard2014-12-171-0/+5
| | | | | | Just report invalid data and continue. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Add more bounds checks to print_gdb_index_section.Mark Wielaard2014-12-171-0/+4
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Make sure there is enough room for reading .debug_line unit_length.Mark Wielaard2014-12-171-1/+2
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Check there is enough room for the DW_LNE_set_address argumentMark Wielaard2014-12-171-0/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdw: Add get_uleb128 and get_sleb128 bounds checking.Mark Wielaard2014-12-171-0/+13
| | | | | | | | | | | Both get_uleb128 and get_sleb128 now take an end pointer to prevent reading too much data. Adjust all callers to provide the end pointer. There are still two exceptions. "Raw" dwarf_getabbrevattr and read_encoded_valued don't have a end pointer associated yet. They will have to be provided in the future. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* elfcmp: Make sure Elf32_Word difference doesn't wrap around in int compare.Mark Wielaard2014-12-171-0/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Check TType base offset and Action table are sane in exception table.Mark Wielaard2014-12-151-0/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Don't print more augmentation characters than there are.Mark Wielaard2014-12-151-0/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Check count fits and doesn't overflow fptr in handle_file_note.Mark Wielaard2014-12-121-0/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Report invalid data if action table doesn't follow call site table.Mark Wielaard2014-12-121-0/+5
| | | | | | Don't assert. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* addr2line: Always prefer linkage_name over plain namesJosh Stone2014-12-111-0/+7
| | | | Signed-off-by: Josh Stone <jistone@redhat.com>
* addr2line: Iterate scopes for inline's parent functionJosh Stone2014-12-111-0/+4
| | | | | | | | The function which contains an inline might not be the immediate next die scope. For instance, there may be a lexical scope in between. Instead, iterate the remaining scopes until an appropriate tag is found. Signed-off-by: Josh Stone <jistone@redhat.com>
* readelf: maximum operations per instruction cannot be zero in .debug_line.Mark Wielaard2014-12-111-0/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: DW_OP_call_ref and DW_OP_GNU_implicit_pointer are invalid for CFA.Mark Wielaard2014-12-111-0/+5
| | | | | | | | | print_cfa_program might call print_ops with zero offset size. We don't need (and don't know) the DWARF offset size in that case. DW_OP_call_ref and DW_OP_GNU_implicit_pointer need to know the offset size because they reference a DIE. But they are invalid when used from CFA. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* objdump: Add various sanity checks to guard against corrupted data.Mark Wielaard2014-12-041-0/+7
| | | | | Reported-by: Alexander Cherepanov <cherepan@mccme.ru> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Fix overflow check in handle_sysv_hash64.Mark Wielaard2014-12-041-0/+4
| | | | | | | Since all values are 64bit, not 32bit as in other hashes, we need to explicitly check for overflow. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Don't trash destshdr for STT_SECTION in handle_relocs_rel[a].Mark Wielaard2014-12-041-0/+7
| | | | | | We might need the original destshdr for handling other relocations. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Cast Dwarf_Word length to ptrdiff_t for comparison.Mark Wielaard2014-11-271-0/+5
| | | | | | Avoids comparison between signed and unsigned integer expressions warning. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf, libdw: Guard against divide by zero line_range in .debug_line.Mark Wielaard2014-11-261-0/+5
| | | | | | | For DW_LNS_const_add_pc and special opcodes don't accept line_range being zero. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* readelf: Check length for nexthdr overflow in print_debug_aranges_section.Mark Wielaard2014-11-261-0/+5
| | | | Signed-off-by: Mark Wielaard <mjw@redhat.com>