This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Object: Add more error checking for object file reading
ClosedPublic

Authored by sbc100 on May 17 2018, 6:29 PM.

Details

Summary

This should address some the assert failures the fuzzer has been
finding such as:

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6719

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.May 17 2018, 6:29 PM
sbc100 added a reviewer: jfb.May 17 2018, 6:30 PM
jfb accepted this revision.May 17 2018, 9:37 PM

One comment, lgtm otherwise.

lib/Object/WasmObjectFile.cpp
961 ↗(On Diff #147424)

That seems like readvaruint32 went out of valid range, no?

This revision is now accepted and ready to land.May 17 2018, 9:37 PM
sbc100 added inline comments.May 18 2018, 10:11 AM
lib/Object/WasmObjectFile.cpp
961 ↗(On Diff #147424)

This means the reported segment size would make it go off the end of the data section.

The absolute value of Size could still be small.

This revision was automatically updated to reflect the committed changes.