This is an archive of the discontinued LLVM Phabricator instance.

[HWASan] Refactor in preparation for x86 aliasing mode. NFC
ClosedPublic

Authored by morehouse on Mar 10 2021, 2:42 PM.

Diff Detail

Event Timeline

morehouse created this revision.Mar 10 2021, 2:42 PM
morehouse requested review of this revision.Mar 10 2021, 2:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2021, 2:42 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
morehouse planned changes to this revision.Mar 10 2021, 3:36 PM

Talked with @eugenis offline. I'm going to look into getting rid of "base tags" by only storing the changeable bits in shadow.

  • Avoid base tag complexities by only storing changeable bits in shadow.
  • Remove unused includes.
morehouse retitled this revision from [HWASan] Refactor in preparation for x86 aliasing mode. to [HWASan] Refactor in preparation for x86 aliasing mode. NFC.Mar 17 2021, 12:23 PM
morehouse edited the summary of this revision. (Show Details)
vitalybuka accepted this revision.Mar 17 2021, 1:08 PM
vitalybuka added inline comments.
compiler-rt/lib/hwasan/hwasan_allocator.cpp
153

InTaggableRegion should be the first as likely the cheepest of those checks

229

same

This revision is now accepted and ready to land.Mar 17 2021, 1:08 PM
morehouse updated this revision to Diff 331377.Mar 17 2021, 2:25 PM
morehouse marked 2 inline comments as done.
  • Check InTaggableRegion before other checks in malloc/free.
eugenis added inline comments.Mar 17 2021, 2:32 PM
compiler-rt/lib/hwasan/hwasan_linux.cpp
225

Is this still needed if we mask out the higher non-tag bits?

morehouse added inline comments.Mar 17 2021, 2:34 PM
compiler-rt/lib/hwasan/hwasan_linux.cpp
225

Yes, tag bits are in userspace, so non-heap pointers are unlikely to have 0 there.

eugenis accepted this revision.Mar 17 2021, 2:46 PM

LGTM

compiler-rt/lib/hwasan/hwasan_linux.cpp
225

ah, it's not because of the "base tag", it's because some app memory is outside of the aliased / taggable range.
Please adjust the comment.

morehouse updated this revision to Diff 331593.Mar 18 2021, 9:52 AM
morehouse marked 2 inline comments as done.
  • Update comment.