diff options
author | Mitch Phillips <mitchp@google.com> | 2020-11-25 16:48:54 -0800 |
---|---|---|
committer | Mitch Phillips <mitchp@google.com> | 2020-11-30 10:49:03 -0800 |
commit | 2210b8d542113c76e24d6ce99d292f87d337b12d (patch) | |
tree | 409d9ef9dc9c1bf9f4b344534eadc01437860f33 /tests/stdio_test.cpp | |
parent | 50a7621b3fc493ffbb72aa23e29a4f1727dc1f51 (diff) |
[Tagged Pointers] Allow probing the current TP level w/ locking.
aosp/1484976 introduced a breaking change where
DisableMemoryMitigations() now indiscriminately turns tagged pointers
off. When android_mallopt(M_DISABLE_MEMORY_MITIGATIONS) is called, the
correct behaviour is:
- In SYNC/ASYNC MTE mode -> disable all tagged pointers.
- If all tagged pointers are already disabled -> nop.
- If we're in TBI mode -> nop (keep the TBI mode as-is).
In order to do that we have to allow probing of the current heap tagging
mode. In order to prevent TOCTOU between GetHeapTaggingLevel() and
SetHeapTaggingLevel(), we expose a global mutex that should be held when
calling these functions.
Bug: 174263432
Test: atest CtsTaggingHostTestCases on Flame
Change-Id: Ia96f7269d542c9041270458806aee36766d2fbbb
Diffstat (limited to 'tests/stdio_test.cpp')
0 files changed, 0 insertions, 0 deletions