Merge "generate_notice.py: don't check for strings we don't use any more." into main
diff --git a/tests/libs/Android.bp b/tests/libs/Android.bp
index 51f5ac6..5d143f8 100644
--- a/tests/libs/Android.bp
+++ b/tests/libs/Android.bp
@@ -29,6 +29,7 @@
"-Wl,--rpath,${ORIGIN}",
"-Wl,--enable-new-dtags",
],
+ static_libs: ["libbase"],
relative_install_path: "bionic-loader-test-libs",
gtest: false,
sanitize: {
diff --git a/tests/libs/heap_tagging_helper.cpp b/tests/libs/heap_tagging_helper.cpp
index ed5601a..7aad392 100644
--- a/tests/libs/heap_tagging_helper.cpp
+++ b/tests/libs/heap_tagging_helper.cpp
@@ -16,12 +16,15 @@
#include <signal.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/auxv.h>
#include <sys/cdefs.h>
#include <sys/mman.h>
#include <unistd.h>
#include <memory>
+#include <android-base/stringprintf.h>
+
void action(int signo, siginfo_t* info __unused, void*) {
#ifdef __ANDROID__
if (signo == 11 && info->si_code == SEGV_MTEAERR) {
@@ -89,6 +92,13 @@
}
#endif // __aarch64__
+ // In fact, make sure that there are no tagged mappings at all.
+ auto cmd = android::base::StringPrintf("cat /proc/%d/smaps | grep -E 'VmFlags:.* mt'", getpid());
+ if (system(cmd.c_str()) == 0) {
+ fprintf(stderr, "unexpected PROT_MTE mappings found\n");
+ return 1;
+ }
+
fprintf(stderr, "normal exit\n");
return 0;
}