platform_bionic/libc/private
Mitch Phillips a493fe4153 Add the recoverable GWP-ASan feature.
GWP-ASan's recoverable mode was landed upstream in
https://reviews.llvm.org/D140173.

This mode allows for a use-after-free or a buffer-overflow bug to be
detected by GWP-ASan, a crash report dumped, but then GWP-ASan (through
the preCrashReport() and postCrashReportRecoverableOnly() hooks) will
patch up the memory so that the process can continue, in spite of the
memory safety bug.

This is desirable, as it allows us to consider migrating non-system apps
from opt-in GWP-ASan to opt-out GWP-ASan. The major concern was "if we
make it opt-out, then bad apps will start crashing". If we don't crash,
problem solved :). Obviously, we'll need to do this with an amount of
process sampling to mitigate against the 70KiB memory overhead.

The biggest problem is that the debuggerd signal handler isn't the first
signal handler for apps, it's the sigchain handler inside of libart.
Clearly, the sigchain handler needs to ask us whether the crash is
GWP-ASan's fault, and if so, please patch up the allocator. Because of
linker namespace restrictions, libart can't directly ask the linker
(which is where debuggerd lies), so we provide a proxy function in libc.

Test: Build the platform, run sanitizer-status and various test apps
with recoverable gwp-asan. Assert that it doesn't crash, and we get a
debuggerd report.
Bug: 247012630

Change-Id: I86d5e27a9ca5531c8942e62647fd377c3cd36dfd
2023-02-02 15:35:25 -08:00
..
__bionic_get_shell_path.h Fix internal uses of _PATH_BSHELL. 2019-03-25 17:28:22 -07:00
bionic_allocator.h Add a thread-properties API 2020-08-11 16:51:43 +00:00
bionic_arc4random.h Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals 2018-12-04 13:51:56 -08:00
bionic_asm.h riscv64: add "private/bionic_asm.h". 2022-10-11 00:04:34 +00:00
bionic_asm_arm.h Unified sysroot: kill arch-specific include dirs. 2017-10-12 13:19:51 -07:00
bionic_asm_arm64.h Basic support for MTE stack tagging. 2022-05-26 16:18:53 -07:00
bionic_asm_dwarf_exprs.h x86/x86_64: cleanup signal trampolines 2020-09-25 15:58:42 -07:00
bionic_asm_note.h [NFCI] Change Android's NT_TYPE to NT_ANDROID_TYPE. 2022-02-07 13:49:20 -08:00
bionic_asm_riscv64.h riscv64: don't go via the PLT for setjmp. 2022-10-26 19:53:35 +00:00
bionic_asm_x86.h Unified sysroot: kill arch-specific include dirs. 2017-10-12 13:19:51 -07:00
bionic_asm_x86_64.h Unified sysroot: kill arch-specific include dirs. 2017-10-12 13:19:51 -07:00
bionic_auxv.h Changes for #inclusivefixit. 2020-07-21 16:34:58 -07:00
bionic_call_ifunc_resolver.h Adopt GNU calling convention for ifunc resolvers. 2019-10-28 20:20:29 -07:00
bionic_config.h
bionic_constants.h Increase the size of the shadow call stack guard region to 16MB. 2019-01-31 14:37:34 -08:00
bionic_defs.h Make __clone_for_fork pure native bridge mode abstraction 2020-09-28 20:36:39 +02:00
bionic_elf_tls.h riscv64 TLS support. 2022-10-10 20:30:24 +00:00
bionic_fdsan.h libc_shared_globals: add a constexpr ctor 2019-01-03 17:11:27 -08:00
bionic_fdtrack.h Disable fdtrack post-fork. 2021-04-07 19:00:45 -07:00
bionic_fortify.h fortify: remove static 2020-06-09 16:03:42 -07:00
bionic_futex.h Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
bionic_globals.h Add the recoverable GWP-ASan feature. 2023-02-02 15:35:25 -08:00
bionic_ieee.h
bionic_ifuncs.h Disable HWASAN on ifunc resolvers. 2020-08-13 13:01:44 -07:00
bionic_inline_raise.h Inline the raise(SIGABRT) for x86-64 too. 2021-02-18 15:16:39 -08:00
bionic_lock.h Move bionic_macros.h from private to platform. 2020-01-02 14:09:50 -08:00
bionic_malloc_dispatch.h Rename iterate to malloc_iterate internally. 2019-11-08 11:49:14 -08:00
bionic_mbstate.h Optimize the mbs fast path slightly. 2021-11-16 11:03:19 -08:00
bionic_sigdefs.h
bionic_ssp.h Clean up mips references in the headers. 2020-02-13 18:00:16 -08:00
bionic_systrace.h Revert "Adding system property tracing" 2021-07-21 09:15:41 +08:00
bionic_time_conversions.h Always use CLOCK_MONOTONIC for pthreads and semaphores 2017-08-18 09:11:05 -07:00
bionic_tls.h Fix recursive deadlock inside bionic_systrace 2022-01-25 20:50:12 +00:00
bionic_vdso.h Clean up the time(2) implementation. 2018-01-12 15:20:28 -08:00
bsd_sys_param.h Export fts as a static library for use with musl 2021-09-08 15:53:10 -07:00
CachedProperty.h Address a bunch of clang-tidy complaints. 2018-01-19 15:56:12 -08:00
CFIShadow.h Move bionic_macros.h from private to platform. 2020-01-02 14:09:50 -08:00
ErrnoRestorer.h Move bionic_macros.h from private to platform. 2020-01-02 14:09:50 -08:00
FdPath.h Add POSIX fexecve. 2017-10-18 16:26:17 -07:00
get_cpu_count_from_string.h
grp_pwd.h Require vendor users and groups to start with vendor_ 2018-05-15 14:10:21 -07:00
icu.h Implement <iconv.h>. 2017-08-25 08:47:41 -07:00
KernelArgumentBlock.h Move bionic_macros.h from private to platform. 2020-01-02 14:09:50 -08:00
linker_native_bridge.h Reorganize static TLS memory for ELF TLS 2019-01-11 15:34:22 -08:00
MallocXmlElem.h Move bionic_macros.h from private to platform. 2020-01-02 14:09:50 -08:00
NetdClientDispatch.h libnetd_client: support hooking sendto/sendmsg/sendmmsg too. 2019-06-20 08:32:24 -07:00
ScopedFd.h Move bionic_macros.h from private to platform. 2020-01-02 14:09:50 -08:00
ScopedPthreadMutexLocker.h Move bionic_macros.h from private to platform. 2020-01-02 14:09:50 -08:00
ScopedReaddir.h Move bionic_macros.h from private to platform. 2020-01-02 14:09:50 -08:00
ScopedRWLock.h Move bionic_macros.h from private to platform. 2020-01-02 14:09:50 -08:00
ScopedSignalBlocker.h Block all signals in ScopedSignalBlocker. 2020-04-23 15:57:58 -07:00
ScopedSignalHandler.h Fix/suppress bionic google-explicit-constructor warnings 2019-01-02 11:04:05 -08:00
SigSetConverter.h Add sigset64_t and accompanying functions. 2018-01-30 18:47:16 -08:00
thread_private.h Reimplement popen(3)/pclose(3). 2018-07-11 12:15:26 -07:00
WriteProtected.h Factor out error reporting in WriteProtected. 2020-06-08 08:41:27 -07:00