This is an archive of the discontinued LLVM Phabricator instance.

[obj2yaml] - Dump the content of a broken GNU hash table properly.
ClosedPublic

Authored by grimar on Dec 23 2020, 5:25 AM.

Details

Summary

When something is wrong with the GNU hash table header we dump
its context as a raw data.

Currently we have the calculation overflow issue and it is possible to
bypass the validation we have (and crash).

The patch fixes it.

Diff Detail

Event Timeline

grimar created this revision.Dec 23 2020, 5:25 AM
grimar requested review of this revision.Dec 23 2020, 5:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2020, 5:25 AM
grimar edited the summary of this revision. (Show Details)Dec 23 2020, 5:26 AM
MaskRay accepted this revision.Dec 23 2020, 11:43 AM

Looks great!

llvm/test/tools/obj2yaml/ELF/gnu-hash-section.yaml
126

NBuckets = 0xFFFFFFFF is incorrect. The result will cause 32-bit unsigned overflows if we keep intermediate expressions uint32_t.

This revision is now accepted and ready to land.Dec 23 2020, 11:43 AM
This revision was automatically updated to reflect the committed changes.
grimar marked an inline comment as done.