[PATCH] D38512: Added phdr upper bound checks to ElfObject

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 13:17:06 PDT 2017


davide added a comment.

Almost there. Do you have commit access or you want me to commit on your behalf?



================
Comment at: include/llvm/Object/ELF.h:147
       return createError("invalid e_phentsize");
+    if (getHeader()->e_phoff + (getHeader()->e_phnum * getHeader()->e_phentsize) > getBufSize())
+      return createError("program headers longer than binary");
----------------
is this clang formatted?


================
Comment at: test/Object/elf-invalid-phdr.test:1
+RUN: not llvm-objdump -private-headers %p/Inputs/invalid-phdr.elf
+
----------------
Please add a comment on how to generate the test in case we want to reproduce in future.


https://reviews.llvm.org/D38512





More information about the llvm-commits mailing list