tsan: add kBrokenAliasedMetas condition and test
authorThurston Dang <thurston@google.com>
Wed, 11 Jan 2023 00:42:02 +0000 (00:42 +0000)
committerThurston Dang <thurston@google.com>
Wed, 11 Jan 2023 18:15:04 +0000 (18:15 +0000)
commit682d635aa508860c306deae23766ca5e2575583a
treea0b1ca1f03356d26fdb7e2ce5505a3491c688251
parent12bf8165d5c8522d93d0fc92811f280def87eb17
tsan: add kBrokenAliasedMetas condition and test

This fills in a gap in the tsan_shadow_test coverage:
it is possible that the meta regions are aliased
(e.g., the heap meta region overlaps the high app meta
region). Indeed, the Aarch64_39 mapping has been
silently broken in this way for quite some time.

This CL checks whether the individual meta regions
(for low/mid/high/heap) overlap. Note that
(!kBrokenAliasedMetas && !kBrokenLinearity) implies
that MemToMeta is invertible; we cannot directly
test MetaToMem because that function does not exist.

Differential Revision: https://reviews.llvm.org/D141445
compiler-rt/lib/tsan/rtl/tsan_platform.h
compiler-rt/lib/tsan/tests/unit/tsan_shadow_test.cpp