This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Don't crash when given invalid DWARFv5 line table prologue.
ClosedPublic

Authored by JDevlieghere on Dec 28 2017, 8:56 AM.

Details

Summary

This patch replaces an assertion with an explicit check for the validity
of the FORM parameters. The assertion was triggered when the DWARFv5
line table contained a zero address size.

This fixes OSS-Fuzz Issue 4644
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4644

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Dec 28 2017, 8:56 AM

Paul, Adrian, if you guys think there's a better place to check this, please let me know. This solution felt the most generic, but maybe we can warn about this earlier (& with a more informative message). Does it ever make sense for the address size to be zero?

In a real object file it should never be zero. There are a bunch of places in the unittests where I construct one with version and addrsize both zero; those would have to be fixed if we wanted to have a check somewhere other than for a form that actually cares about that stuff.

In a real object file it should never be zero. There are a bunch of places in the unittests where I construct one with version and addrsize both zero; those would have to be fixed if we wanted to have a check somewhere other than for a form that actually cares about that stuff.

Alternatively we can keep this for a check in the verifier.

aprantl accepted this revision.Jan 2 2018, 9:38 AM

SGTM.

This revision is now accepted and ready to land.Jan 2 2018, 9:38 AM
This revision was automatically updated to reflect the committed changes.