This is an archive of the discontinued LLVM Phabricator instance.

[hwasan] fix false positive when hwasan-match-all-tag flag is enabled and short granules are used
ClosedPublic

Authored by Enna1 on Apr 26 2023, 5:11 AM.

Details

Summary

When hwasan-match-all-tag flag is enabled and short granules are used, at the point checking if this is a short tag case, the tag from pointer is stored in X16 register,
which breaks the assumption that tag from shadow memory is stored in X16 register, this will cause a false positive.

Diff Detail

Event Timeline

Enna1 created this revision.Apr 26 2023, 5:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 5:11 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Enna1 edited the summary of this revision. (Show Details)Apr 26 2023, 5:32 AM
Enna1 added reviewers: vitalybuka, eugenis, pcc.
Enna1 added a subscriber: MTC.
Enna1 published this revision for review.Apr 26 2023, 5:36 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 26 2023, 5:36 AM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
vitalybuka added inline comments.Apr 26 2023, 7:26 PM
compiler-rt/test/hwasan/TestCases/short-granule-and-match-all-tag.cpp
1–18

exit 0 is enough for this test

llvm/test/CodeGen/AArch64/hwasan-check-memaccess.ll
115

can you please precommit this test with the current state of HWASAN, so we can see a difference here

Enna1 updated this revision to Diff 517442.Apr 26 2023, 8:41 PM
  • only test

UNSUPPORTED: HWAddressSanitizer-x86_64 :: TestCases/short-granule-and-match-all-tag.cpp (19669 of 70430)

Pre-merge checks buildbot does not support HWASAN test, so we can not see this test failure in premerge checks .
Do you mean I create another differential only containing this testcase, commit it to llvm trunk and check if sanitizer-aarch64-linux-bootstrap-hwasan(https://lab.llvm.org/buildbot/#/builders/236) will fail?

UNSUPPORTED: HWAddressSanitizer-x86_64 :: TestCases/short-granule-and-match-all-tag.cpp (19669 of 70430)

Pre-merge checks buildbot does not support HWASAN test, so we can not see this test failure in premerge checks .
Do you mean I create another differential only containing this testcase, commit it to llvm trunk and check if sanitizer-aarch64-linux-bootstrap-hwasan(https://lab.llvm.org/buildbot/#/builders/236) will fail?

Sorry, I was asking to precommit hwasan-check-accessible with checks generated for that current state of LLVM
short-granule-and-match-all-tag.cpp should stay in the main patch

vitalybuka accepted this revision.Apr 27 2023, 10:20 PM
This revision is now accepted and ready to land.Apr 27 2023, 10:20 PM