[HWASAN][LSAN] Fix false positive memory leak reports on X86_64
authorKirill Stoimenov <kstoimenov@google.com>
Fri, 14 Jul 2023 20:07:29 +0000 (20:07 +0000)
committerKirill Stoimenov <kstoimenov@google.com>
Tue, 18 Jul 2023 19:04:30 +0000 (19:04 +0000)
commit0365ccd2a1b3900491eef30b784f2ea13a4d073c
treee8e8047dd8a4d7a6b7b54b5ff80535066bc3aa37
parenta0ffeccc707679d50cd8d4fba0e6f20a3450d474
[HWASAN][LSAN] Fix false positive memory leak reports on X86_64

Before this patch when running HWASAN on x86_64 with with memory tagging support we got a bunch of false memory leak reports. The reason for that is that the heuristic used to detect if an 8 bytes could be a user pointer was not valid when memory tagging is used as the top byte could contain non-zero information.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D155338
compiler-rt/lib/lsan/lsan_common.cpp
compiler-rt/test/lsan/TestCases/user_pointer.cpp [new file with mode: 0644]