@@ -240,21 +240,21 @@ __LIBC_HIDDEN__ void* __allocate_stack_mte_ringbuffer(size_t n, pthread_internal
240240 return reinterpret_cast <void *>(aligned_allocation | ((1ULL << n) << 56ULL ));
241241}
242242
243- void __pthread_internal_remap_stack_with_mte () {
243+ bool __pthread_internal_remap_stack_with_mte () {
244244#if defined(__aarch64__)
245245 ScopedWriteLock creation_locker (&g_thread_creation_lock);
246246 ScopedReadLock list_locker (&g_thread_list_lock);
247247 // If process already uses memtag-stack ABI, we don't need to do anything.
248- if (__libc_memtag_stack_abi) return ;
248+ if (__libc_memtag_stack_abi) return false ;
249249 __libc_memtag_stack_abi = true ;
250250
251251 for (pthread_internal_t * t = g_thread_list; t != nullptr ; t = t->next ) {
252252 if (t->terminating ) continue ;
253253 t->bionic_tcb ->tls_slot (TLS_SLOT_STACK_MTE) =
254254 __allocate_stack_mte_ringbuffer (0 , t->is_main () ? nullptr : t);
255255 }
256- if (!atomic_load (&__libc_globals->memtag )) return ;
257- if (atomic_exchange (&__libc_memtag_stack, true )) return ;
256+ if (!atomic_load (&__libc_globals->memtag )) return false ;
257+ if (atomic_exchange (&__libc_memtag_stack, true )) return false ;
258258 uintptr_t lo, hi;
259259 __find_main_stack_limits (&lo, &hi);
260260
@@ -269,7 +269,10 @@ void __pthread_internal_remap_stack_with_mte() {
269269 async_safe_fatal (" error: failed to set PROT_MTE on thread: %d" , t->tid );
270270 }
271271 }
272- #endif
272+ return true ;
273+ #else
274+ return false ;
275+ #endif // defined(__aarch64__)
273276}
274277
275278bool android_run_on_all_threads (bool (*func)(void *), void* arg) {
0 commit comments