summaryrefslogtreecommitdiff
path: root/libc/bionic/malloc_common_dynamic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/bionic/malloc_common_dynamic.cpp')
-rw-r--r--libc/bionic/malloc_common_dynamic.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/bionic/malloc_common_dynamic.cpp b/libc/bionic/malloc_common_dynamic.cpp
index da87c332e..6a82ae3a5 100644
--- a/libc/bionic/malloc_common_dynamic.cpp
+++ b/libc/bionic/malloc_common_dynamic.cpp
@@ -366,6 +366,9 @@ static bool InstallHooks(libc_globals* globals, const char* options, const char*
return true;
}
+extern "C" const char* __scudo_get_stack_depot_addr();
+extern "C" const char* __scudo_get_region_info_addr();
+
// Initializes memory allocation framework once per process.
static void MallocInitImpl(libc_globals* globals) {
char prop[PROP_VALUE_MAX];
@@ -373,6 +376,11 @@ static void MallocInitImpl(libc_globals* globals) {
MaybeInitGwpAsanFromLibc(globals);
+#if defined(USE_SCUDO)
+ __libc_shared_globals()->scudo_stack_depot = __scudo_get_stack_depot_addr();
+ __libc_shared_globals()->scudo_region_info = __scudo_get_region_info_addr();
+#endif
+
// Prefer malloc debug since it existed first and is a more complete
// malloc interceptor than the hooks.
bool hook_installed = false;