aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2024-04-04 20:07:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-04 20:07:45 +0000
commite5640666968f8cf57ee5f7ece24ae10a4e431a44 (patch)
tree0ec737bb1e021c2bda7716aff47200647cd147f0
parent2931c646d9f1a01cfa55584a1a467e3271e34830 (diff)
parentd8ad152208ab624d7bba9efad7f5100df0d2e1a7 (diff)
downloadbionic-e5640666968f8cf57ee5f7ece24ae10a4e431a44.tar.gz
Merge "Disable USE_SCUDO branches for HWASan" into main
-rw-r--r--libc/bionic/heap_tagging.cpp8
-rw-r--r--libc/bionic/libc_init_common.cpp4
-rw-r--r--libc/bionic/malloc_common_dynamic.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/libc/bionic/heap_tagging.cpp b/libc/bionic/heap_tagging.cpp
index c4347e8a3..4d1981c30 100644
--- a/libc/bionic/heap_tagging.cpp
+++ b/libc/bionic/heap_tagging.cpp
@@ -65,7 +65,7 @@ void SetDefaultHeapTaggingLevel() {
};
});
-#if defined(USE_SCUDO)
+#if defined(USE_SCUDO) && !__has_feature(hwaddress_sanitizer)
switch (heap_tagging_level) {
case M_HEAP_TAGGING_LEVEL_TBI:
case M_HEAP_TAGGING_LEVEL_NONE:
@@ -123,7 +123,7 @@ bool SetHeapTaggingLevel(HeapTaggingLevel tag_level) {
return false;
}
}
-#if defined(USE_SCUDO)
+#if defined(USE_SCUDO) && !__has_feature(hwaddress_sanitizer)
scudo_malloc_disable_memory_tagging();
#endif
break;
@@ -151,12 +151,12 @@ bool SetHeapTaggingLevel(HeapTaggingLevel tag_level) {
if (!set_tcf_on_all_threads(PR_MTE_TCF_ASYNC | PR_MTE_TCF_SYNC)) {
set_tcf_on_all_threads(PR_MTE_TCF_ASYNC);
}
-#if defined(USE_SCUDO)
+#if defined(USE_SCUDO) && !__has_feature(hwaddress_sanitizer)
scudo_malloc_set_track_allocation_stacks(0);
#endif
} else if (tag_level == M_HEAP_TAGGING_LEVEL_SYNC) {
set_tcf_on_all_threads(PR_MTE_TCF_SYNC);
-#if defined(USE_SCUDO)
+#if defined(USE_SCUDO) && !__has_feature(hwaddress_sanitizer)
scudo_malloc_set_track_allocation_stacks(1);
#endif
}
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index 944098f42..c82c52e9d 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -96,7 +96,7 @@ void __libc_init_scudo() {
SetDefaultHeapTaggingLevel();
// TODO(b/158870657) make this unconditional when all devices support SCUDO.
-#if defined(USE_SCUDO)
+#if defined(USE_SCUDO) && !__has_feature(hwaddress_sanitizer)
#if defined(SCUDO_PATTERN_FILL_CONTENTS)
scudo_malloc_set_pattern_fill_contents(1);
#elif defined(SCUDO_ZERO_CONTENTS)
@@ -182,7 +182,7 @@ void __libc_init_fork_handler() {
extern "C" void scudo_malloc_set_add_large_allocation_slack(int add_slack);
__BIONIC_WEAK_FOR_NATIVE_BRIDGE void __libc_set_target_sdk_version(int target __unused) {
-#if defined(USE_SCUDO)
+#if defined(USE_SCUDO) && !__has_feature(hwaddress_sanitizer)
scudo_malloc_set_add_large_allocation_slack(target < __ANDROID_API_S__);
#endif
}
diff --git a/libc/bionic/malloc_common_dynamic.cpp b/libc/bionic/malloc_common_dynamic.cpp
index 88581784a..6db625128 100644
--- a/libc/bionic/malloc_common_dynamic.cpp
+++ b/libc/bionic/malloc_common_dynamic.cpp
@@ -381,7 +381,7 @@ static void MallocInitImpl(libc_globals* globals) {
MaybeInitGwpAsanFromLibc(globals);
-#if defined(USE_SCUDO)
+#if defined(USE_SCUDO) && !__has_feature(hwaddress_sanitizer)
__libc_shared_globals()->scudo_stack_depot = __scudo_get_stack_depot_addr();
__libc_shared_globals()->scudo_region_info = __scudo_get_region_info_addr();
__libc_shared_globals()->scudo_ring_buffer = __scudo_get_ring_buffer_addr();