[all-commits] [llvm/llvm-project] 4ab03e: [llvm-readobj] - Do not crash when an invalid .eh_...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Wed May 27 06:50:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ab03e62fd040efdbde4b6c310e5abbda5363abd
      https://github.com/llvm/llvm-project/commit/4ab03e62fd040efdbde4b6c310e5abbda5363abd
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-05-27 (Wed, 27 May 2020)

  Changed paths:
    M llvm/include/llvm/Object/ELF.h
    M llvm/test/tools/llvm-readobj/ELF/unwind.test
    M llvm/tools/llvm-readobj/DwarfCFIEHPrinter.h

  Log Message:
  -----------
  [llvm-readobj] - Do not crash when an invalid .eh_frame_hdr is dumped using --unwind.

When the p_offset/p_filesz of the PT_GNU_EH_FRAME is invalid
(e.g larger than the file size) then llvm-readobj might crash.

This patch fixes the issue. I've introduced `ELFFile<ELFT>::getSegmentContent`
method, which is very similar to `ELFFile<ELFT>::getSectionContentsAsArray` one.

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




More information about the All-commits mailing list