[all-commits] [llvm/llvm-project] 7df873: [llvm-readobj/elf] - Don't crash when the size of ...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Tue Sep 15 07:44:50 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7df873f9c67099a209f0122a1f5411e701a9d425
      https://github.com/llvm/llvm-project/commit/7df873f9c67099a209f0122a1f5411e701a9d425
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-09-15 (Tue, 15 Sep 2020)

  Changed paths:
    M llvm/test/tools/llvm-readobj/ELF/dyn-symbols-size-from-hash-table.test
    M llvm/test/tools/llvm-readobj/ELF/hash-histogram.test
    M llvm/test/tools/llvm-readobj/ELF/hash-symbols.test
    M llvm/test/tools/llvm-readobj/ELF/hash-table.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  [llvm-readobj/elf] - Don't crash when the size of s dynamic symbol table, inferred from the hash table, is broken.

Currently we might derive the dynamic symbol table size from the DT_HASH hash table (using its `nchain` field).
It is possible to crash dumpers with a broken relocation that refers to a symbol with an index
that is too large. To trigger it, the inferred size of the dynamic symbol table should go past the end of the object.

This patch adds a size validation + warning.

Differential revision: https://reviews.llvm.org/D86923




More information about the All-commits mailing list