This is an archive of the discontinued LLVM Phabricator instance.

[HWASAN] Fix HwasanReallocate in aliasing mode
ClosedPublic

Authored by vitalybuka on Apr 26 2023, 2:04 PM.

Details

Summary

HWASAN_ALIASING_MODE needs to untag only
primary allocator pointers.

Diff Detail

Event Timeline

vitalybuka created this revision.Apr 26 2023, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 2:04 PM
vitalybuka requested review of this revision.Apr 26 2023, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 2:04 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka edited the summary of this revision. (Show Details)
kstoimenov accepted this revision.Apr 26 2023, 2:12 PM
This revision is now accepted and ready to land.Apr 26 2023, 2:12 PM
thurston added inline comments.Apr 26 2023, 2:28 PM
compiler-rt/lib/hwasan/hwasan_allocator.cpp
387–393

This "Untag pointer iff it is in a taggable region" idiom is used often enough (e.g., also in AllocationSize and AllocationBegin of https://reviews.llvm.org/D149238) that it might be worth having a helper function.

vitalybuka marked an inline comment as done.Apr 26 2023, 4:32 PM
vitalybuka added inline comments.
compiler-rt/lib/hwasan/hwasan_allocator.cpp
387–393

Addressing in followup patches

vitalybuka marked an inline comment as done.Apr 26 2023, 4:33 PM
vitalybuka added inline comments.
compiler-rt/lib/hwasan/hwasan_allocator.cpp
387–393
This revision was automatically updated to reflect the committed changes.