Conversation

This Tweet was deleted by the Tweet author. Learn more
It's also unfortunate that it requires an extra system call. Bionic removed a bunch of the labels due to the cost added to thread spawning. They're almost always set on the whole memory region after an mmap or mprotect call. Requiring extra system calls deters using the feature.
1
This Tweet was deleted by the Tweet author. Learn more
It would help a bit to be able to set more than one at a time but it would still be worse than being able to set them with mmap / mprotect. So, for example, hardened_malloc uses mappings directly for sizes above either 128k (default) or 16k (extended size classes disabled).
1
Other case that matters is adding back labels for free slabs pushed out of the empty slab cache which are purged with mmap MAP_FIXED back to a fresh PROT_NONE mapping. Similarly don't do multiple of those at once. Only do a bunch during initialization and it's not important.
1
1