Move memtag_stack out of libc_globals
We cannot use a WriteProtected because we are accessing it in a
multithreaded context.
Test: atest memtag_stack_dlopen_test w/ MTE
Test: atest bionic-unit-tests w/ MTE
Test: atest bionic-unit-tests on _fullmte
Bug: 328256432
Change-Id: I39faa75f97fd5b3fb755a46e88346c17c0e9a8e2
diff --git a/libc/bionic/malloc_common_dynamic.cpp b/libc/bionic/malloc_common_dynamic.cpp
index a6bf7a7..8858178 100644
--- a/libc/bionic/malloc_common_dynamic.cpp
+++ b/libc/bionic/malloc_common_dynamic.cpp
@@ -542,7 +542,7 @@
errno = EINVAL;
return false;
}
- *reinterpret_cast<bool*>(arg) = atomic_load(&__libc_globals->memtag_stack);
+ *reinterpret_cast<bool*>(arg) = atomic_load(&__libc_memtag_stack);
return true;
}
if (opcode == M_GET_DECAY_TIME_ENABLED) {