This is an archive of the discontinued LLVM Phabricator instance.

Bugfix for collecting features from very small DSOs.
ClosedPublic

Authored by aarongreen on Jan 12 2021, 9:20 AM.

Details

Summary

During unit tests, it was observed that crafting an artificially small DSO could cause OOB memory to be accessed. This change fixes that (but again, the affected DSOs are unlikely to ever occur outside unit tests).

Diff Detail

Event Timeline

aarongreen requested review of this revision.Jan 12 2021, 9:20 AM
aarongreen created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2021, 9:20 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
charco accepted this revision.Jan 20 2021, 6:19 PM
This revision is now accepted and ready to land.Jan 20 2021, 6:19 PM
morehouse accepted this revision.Jan 21 2021, 8:24 AM

LGTM, thanks!

This revision was automatically updated to reflect the committed changes.
arichardson added inline comments.
compiler-rt/lib/fuzzer/FuzzerTracePC.h
196

Just saw this while merging from upstream since we have a similar but conflicting diff. Shouldn't it be < rather than <=? I believe end is a one-past-the end pointer but it's been a while since I looked at this code? The loop below also uses <.

I made this change for CHERI a long time ago when porting libfuzzer but forgot to upstream it despite marking at as such: https://github.com/CTSRD-CHERI/llvm-project/commit/a09ee83464be3e287cdf82ff22e67d66f476a6c0