diff options
| author | Evgenii Stepanov <eugenis@google.com> | 2020-12-15 13:55:32 -0800 |
|---|---|---|
| committer | Evgenii Stepanov <eugenis@google.com> | 2021-01-06 16:08:18 -0800 |
| commit | 8564b8d9e61580bef3bd5018cf63e37c78e40053 (patch) | |
| tree | 31105008dfcd942690f7143595121c2ab5d2bde8 /libc/bionic/libc_init_common.cpp | |
| parent | dec48bdd9ee090f3b0e3ff22dcac4689a146e8d0 (diff) | |
Use ELF notes to set the desired memory tagging level.
Use a note in executables to specify
(none|sync|async) heap tagging level. To be extended with (heap x stack x
globals) in the future. A missing note disables all tagging.
Bug: b/135772972
Test: bionic-unit-tests (in a future change)
Change-Id: Iab145a922c7abe24cdce17323f9e0c1063cc1321
Diffstat (limited to 'libc/bionic/libc_init_common.cpp')
| -rw-r--r-- | libc/bionic/libc_init_common.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp index 80adbbe8e..f2c3f1c68 100644 --- a/libc/bionic/libc_init_common.cpp +++ b/libc/bionic/libc_init_common.cpp @@ -86,7 +86,7 @@ static void arc4random_fork_handler() { _thread_arc4_lock(); } -static void __libc_init_malloc_fill_contents() { +void __libc_init_scudo() { // TODO(b/158870657) make this unconditional when all devices support SCUDO. #if defined(USE_SCUDO) #if defined(SCUDO_PATTERN_FILL_CONTENTS) @@ -95,6 +95,7 @@ static void __libc_init_malloc_fill_contents() { scudo_malloc_set_zero_contents(1); #endif #endif + SetDefaultHeapTaggingLevel(); } __BIONIC_WEAK_FOR_NATIVE_BRIDGE @@ -119,9 +120,6 @@ void __libc_init_common() { __system_properties_init(); // Requires 'environ'. __libc_init_fdsan(); // Requires system properties (for debug.fdsan). __libc_init_fdtrack(); - - __libc_init_malloc_fill_contents(); - SetDefaultHeapTaggingLevel(); } void __libc_init_fork_handler() { |
