platform_bionic/libc/platform/bionic
Peter Collingbourne 5d3aa86cd1 Add an API for per-process disabling memory initialization.
Introduce an android_mallopt(M_DISABLE_MEMORY_MITIGATIONS) API call
that may be used to disable zero- or pattern-init on non-MTE hardware,
or memory tagging on MTE hardware. The intent is that this function
may be called at any time, including when there are multiple threads
running.

Disabling zero- or pattern-init is quite trivial, we just need to set
a global variable to 0 via a Scudo API call (although there will be
some separate work required on the Scudo side to make this operation
thread-safe).

It is a bit more tricky to disable MTE across a process, because
the kernel does not provide an API for disabling tag checking in all
threads in a process, only per-thread. We need to send a signal to each
of the process's threads with a handler that issues the required prctl
call, and lock thread creation for the duration of the API call to
avoid races between thread enumeration and calls to pthread_create().

Bug: 135772972
Change-Id: I81ece86ace916eb6b435ab516cd431ec4b48a3bf
2020-10-08 14:02:36 -07:00
..
android_unsafe_frame_pointer_chase.h Add an android_unsafe_frame_pointer_chase function. 2020-02-03 10:30:45 -08:00
fdtrack.h Move fdtrack APIs to LLNDK. 2020-01-30 13:55:10 -08:00
macros.h Clean up untag_address. 2020-03-20 15:35:54 -07:00
malloc.h Add an API for per-process disabling memory initialization. 2020-10-08 14:02:36 -07:00
mte.h Define mte_supported() on non-aarch64. 2020-05-12 16:03:50 -07:00
mte_kernel.h Dump the per-thread TAGGED_ADDR_CTRL value if available. 2020-09-15 21:32:36 -07:00
page.h Make private/bionic_page.h available as platform/bionic/page.h. 2019-12-12 15:26:14 -08:00
reserved_signals.h Add an API for per-process disabling memory initialization. 2020-10-08 14:02:36 -07:00
tls.h Clean up mips references in the headers. 2020-02-13 18:00:16 -08:00
tls_defines.h Fix bugprone-macro-parentheses warnings 2020-03-04 13:22:05 -08:00