This commit is contained in:
cgzones 2025-04-07 13:51:45 +03:00 committed by GitHub
commit 7673582e23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 0 deletions

View file

@ -1295,7 +1295,12 @@ COLD static void init_slow_path(void) {
atomic_store_explicit(&ro.slab_region_end, slab_region_end, memory_order_release);
#if defined(__ANDROID__) && defined(HAS_ARM_MTE)
/* Do not seal to support disabling memory tagging */
if (unlikely(memory_protect_ro(&ro, sizeof(ro)))) {
#else
if (unlikely(memory_protect_seal(&ro, sizeof(ro)))) {
#endif
fatal_error("failed to protect allocator data");
}
memory_set_name(&ro, sizeof(ro), "malloc read-only after init");