This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] - Verify the location of program headers better.
ClosedPublic

Authored by grimar on Jul 14 2020, 7:28 AM.

Details

Summary

This improves condition in the ELFFile::program_headers().
Previously if was possible to read the headers from the wrong place when
the value of e_phoff was so large that computation overflowed.

Diff Detail

Event Timeline

grimar created this revision.Jul 14 2020, 7:28 AM
Herald added a project: Restricted Project. · View Herald Transcript
MaskRay accepted this revision.Jul 14 2020, 10:47 AM

Thanks!

This revision is now accepted and ready to land.Jul 14 2020, 10:47 AM
jhenderson accepted this revision.Jul 14 2020, 11:58 PM
jhenderson added inline comments.
llvm/include/llvm/Object/ELF.h
210

Maybe Offset rather than Off (I'd also take PhOff).

llvm/test/tools/llvm-readobj/ELF/gnu-phdrs.test
389

Either "when the program header table ends" or "when the program headers end"

LGTM, with comments.

This revision was automatically updated to reflect the committed changes.