Commit graph

31095 commits

Author SHA1 Message Date
Elliott Hughes
293ce2aa61 Merge "Clean up syscall stub/seccomp filter generation." 2020-02-14 00:53:56 +00:00
Elliott Hughes
14798930ec Remove unused mips/mips64 code from the linker.
Test: treehugger
Change-Id: I42f1e4c492ac644cf78e7c1196ba9b3518f9c8f8
2020-02-13 15:58:48 -08:00
Elliott Hughes
2b499046f1 Clean up syscall stub/seccomp filter generation.
Test: treehugger
Change-Id: Iceb1c22d82b4d402166c3712b5b8b48a30937c6d
2020-02-13 14:21:55 -08:00
Elliott Hughes
d5b1005c4a Merge "Remove mips test workarounds." am: 7482e240cf
Change-Id: I649c384f24c0522a350883cce64876d965d810fa
2020-02-13 22:12:29 +00:00
Elliott Hughes
7482e240cf Merge "Remove mips test workarounds." 2020-02-13 21:58:55 +00:00
George Burgess IV
d02e7b131e fortify: simplify strlen for LLVM's new optimization
LLVM now knows how to fold __strlen_chk, so we can make this function a
one-liner.

Also fix strlcat to not double-return while I'm in the area.

Bug: 148189733
Test: TreeHugger
Change-Id: I71ee308defbefe96f3fe6e357a2127309d2f0942
2020-02-13 11:44:20 -08:00
Ivan Lozano
3e928edc77 Remove XOM properties.
XOM is no longer supported by the build system, so remove these
properties.

Bug: 123034666
Bug: 147300048
Test: Build succeeds.
Change-Id: I77efc98241f45b1a78b1cca5560f64eef5ef22f4
2020-02-13 14:20:44 -05:00
Elliott Hughes
6a65ccdf52 Remove mips test workarounds.
The mips/mips64 targets were never able to pass these tests, and the
supported architectures don't need any of these workarounds.

Test: treehugger
Change-Id: I640a8b7a98ae13d9d9cdb09b0fbef61d31d4c79a
2020-02-13 09:48:14 -08:00
Automerger Merge Worker
7a5602dc10 Merge "Update malloc_info test for scudo." am: 97d053283f
Change-Id: Ie70075d9d0c5811757a0e1bd0046f81a9c0778d2
2020-02-13 15:57:44 +00:00
Christopher Ferris
97d053283f Merge "Update malloc_info test for scudo." 2020-02-13 15:40:28 +00:00
Automerger Merge Worker
7f83747187 Merge "Adjust the documentation of get_ld_config_file_apex_path." am: 38d115c7f0
Change-Id: Ibd335d5de2bc4f525afb85d98ec9c79f3daa0c62
2020-02-13 12:54:06 +00:00
Roland Levillain
38d115c7f0 Merge "Adjust the documentation of get_ld_config_file_apex_path." 2020-02-13 12:40:03 +00:00
Christopher Ferris
cce88c0a03 Update malloc_info test for scudo.
Scudo implemented malloc_info for the primary allocator, so add some
small amount of validation.

Test: Ran the malloc_info tests and verified they pass.
Change-Id: Ib7c609e46cc1ed73fa5c042df92fa9b568880f21
2020-02-12 17:41:01 -08:00
Roland Levillain
57e6b8612a Adjust the documentation of get_ld_config_file_apex_path.
Test: n/a
Bug: 147987608
Change-Id: I479a63a2fa7e0975db80fcfdda78d2ee154c53cb
2020-02-12 17:34:20 +00:00
Automerger Merge Worker
5d1759bb08 Merge "Enable scudo for non-svelte configs." am: 06ea3cf883
Change-Id: I0be8e962cc75617da2762fdabd118d1581323f57
2020-02-12 16:00:36 +00:00
Christopher Ferris
06ea3cf883 Merge "Enable scudo for non-svelte configs." 2020-02-12 15:44:46 +00:00
Automerger Merge Worker
6888c72ee0 Merge "[GWP-ASan] Fix non-reentrant libc_globals init behaviour." am: 260fa1e838
Change-Id: Ib56a913ee8ace3fac562df42c3c49adfeb870529
2020-02-12 04:25:08 +00:00
Treehugger Robot
260fa1e838 Merge "[GWP-ASan] Fix non-reentrant libc_globals init behaviour." 2020-02-12 04:10:33 +00:00
Automerger Merge Worker
85ff79fa9b Merge "[malloc dispatch] Install dispatch over the top of GWP-ASan." am: 18b2891cd2
Change-Id: Idd0e9707448292dc98890220abdf2b92295cc1e2
2020-02-12 03:36:48 +00:00
Treehugger Robot
18b2891cd2 Merge "[malloc dispatch] Install dispatch over the top of GWP-ASan." 2020-02-12 03:23:21 +00:00
Automerger Merge Worker
740ed23141 Merge "[GWP-ASan] [malloc-tests] Scan GWP-ASan regions in maps." am: 549a60aa7d
Change-Id: I8461be7476fd65726241cada466bf4bc0b4b2d15
2020-02-12 03:12:55 +00:00
Treehugger Robot
549a60aa7d Merge "[GWP-ASan] [malloc-tests] Scan GWP-ASan regions in maps." 2020-02-12 02:58:43 +00:00
Automerger Merge Worker
a4d44d1f3c Merge "Clean up the math headers." am: 419ffcd827
Change-Id: I1a337039851b03553c4c3cc8da100a6722709ca4
2020-02-12 01:09:56 +00:00
Elliott Hughes
419ffcd827 Merge "Clean up the math headers." 2020-02-12 00:56:48 +00:00
Mitch Phillips
242387d0cf [GWP-ASan] [malloc-tests] Scan GWP-ASan regions in maps.
GWP-ASan is part of the native allocator, and may allocate some memory.
When GWP-ASan is enabled, the malloc tests need to look inside of
GWP-ASan regions as well for native allocations.

Bug: 135634846
Test: atest bionic-unit-tests
Change-Id: Ibb78f9c9e7e96a437cffce013facd18708799b0e
2020-02-11 16:08:17 -08:00
Mitch Phillips
3083cc9479 [malloc dispatch] Install dispatch over the top of GWP-ASan.
When enabled, GWP-ASan sets the current dispatch table. Then, when a
shim layer (malloc_debug, malloc_hooks, heapprofd) comes along, they
should (by design) overwrite the current dispatch table.

Currently, these shim layers check to see whether malloc_limit is
installed by checking the current dispatch table against nullptr.
Because GWP-ASan owns the current dispatch table, the shim thinks that
malloc_limit is installed and falls back to only use the default
dispatch, thinking that malloc_limit will call them. This is not the
case, and they should take over the current dispatch pointer.

Bug: 135634846
Test: atest bionic

Change-Id: Ifb6f8864a15af9ac7f20d9364c40f73c5dd9d870
2020-02-11 15:29:21 -08:00
Mitch Phillips
bba80dcd80 [GWP-ASan] Fix non-reentrant libc_globals init behaviour.
The WriteProtected mutator for __libc_globals isn't reentrant.
Previously we were calling __libc_globals.mutate() inside of GWP-ASan's
libc initialisation, which is called inside the __libc_globals.mutate().
This causes problems with malloc_debug and other malloc shims, as they
fail to install when GWP-ASan is sampling their processes.

Bug: 135634846
Test: atest bionic
Change-Id: Iae51faa8d78677eeab6204b6ab4f3ae1b7517ba5
2020-02-11 14:52:17 -08:00
Automerger Merge Worker
780ff608e7 Merge "Use "com.android.runtime" for its link namespace" am: 65cbad1ffa
Change-Id: I7f357d9332b24a42f3c76b6aff805978830b0f9b
2020-02-11 19:16:38 +00:00
Christopher Ferris
062eba2dd1 Enable scudo for non-svelte configs.
Scudo still isn't quite at the same RSS as jemalloc for the svelte config
so only enable this for normal config.

Bug: 137795072

Test: Built svelte config and verified it is still jemalloc.
Test: Ran performance tests on normal config (bionic benchmarks).
Test: Ran trace tests (system/extras/memory_replay).
Test: Ran scudo unit tests.
Test: Ran bionic unit tests.
Test: Ran libmemunreachable tests.
Test: Ran atest CtsRsBlasTestCases on cuttlefish.
Test: Ran atest AslrMallocTest.
Test: Ran atest CtsHiddenApiKillswitchWildcardTestCases and verified it has
Test: the same runtime as the jemalloc.
Change-Id: I241165feb8fe9ea814b7b166e3aaa6563d18524a
2020-02-11 11:13:02 -08:00
Treehugger Robot
65cbad1ffa Merge "Use "com.android.runtime" for its link namespace" 2020-02-11 19:00:40 +00:00
Elliott Hughes
44c01c77d3 Clean up the math headers.
I had hoped that this would then let us remove more of the "introduced
in" annotations, but it looks like that's not really going to happen
until the NDK's minimum supported API is 21.

Also remove a .c file that wasn't referenced anywhere.

Test: treehugger
Change-Id: I8b4a61c082293f8445195a4fa5ee30595d70444e
2020-02-11 08:46:29 -08:00
Automerger Merge Worker
0422a2900c Merge "[GWP-ASan] Integrate GWP-ASan into bionc's malloc() (using hooks)." am: d129786e12
Change-Id: I111c814306fc73e775c111459b8b4bdaae16f5ec
2020-02-10 23:44:28 +00:00
Automerger Merge Worker
454abda2fa Merge "[Elf TLS] [GWP-ASan] Update ELF TLS test." am: 21192ad26f
Change-Id: Ic81011a03dc4f6bf8583b7c1634086e0affa5f63
2020-02-10 23:44:25 +00:00
Mitch Phillips
d129786e12 Merge "[GWP-ASan] Integrate GWP-ASan into bionc's malloc() (using hooks)." 2020-02-10 23:35:26 +00:00
Mitch Phillips
21192ad26f Merge "[Elf TLS] [GWP-ASan] Update ELF TLS test." 2020-02-10 23:35:26 +00:00
Automerger Merge Worker
07b226ff58 Merge "Update a few comments." am: 20b45958c3
Change-Id: Ib1ed0eb338e2a7d7119ea9d7e88c3742e5ee077b
2020-02-10 20:14:56 +00:00
Treehugger Robot
20b45958c3 Merge "Update a few comments." 2020-02-10 20:00:45 +00:00
Mitch Phillips
f3968e89cb [GWP-ASan] Integrate GWP-ASan into bionc's malloc() (using hooks).
This patch introduces GWP-ASan - a sampled allocator framework that
finds use-after-free and heap-buffer-overflow bugs in production
environments.

GWP-ASan is being introduced in an always-disabled mode. This means that
GWP-ASan will be permanently disabled until a further patch turns on
support. As such, there should be no visible functional change for the
time being.

GWP-ASan requires -fno-emulated-tls wherever it's linked from. We
intentionally link GWP-ASan into libc so that it's part of the initial
set of libraries, and thus has static TLS storage (so we can use
Initial-Exec TLS instead of Global-Dynamic). As a benefit, this reduces
overhead for a sampled process.

GWP-ASan is always initialised via. a call to
mallopt(M_INITIALIZE_GWP_ASAN, which must be done before a process is
multithreaded).

More information about GWP-ASan can be found in the upstream
documentation: http://llvm.org/docs/GwpAsan.html

Bug: 135634846
Test: atest bionic
Change-Id: Ib9bd33337d17dab39ac32f4536bff71bd23498b0
2020-02-10 10:51:23 -08:00
Elliott Hughes
f9930b765c Update a few comments.
Test: N/A
Change-Id: Id5e21eaff9bc43256b8f54e708dfc862ee7e763a
2020-02-10 10:30:38 -08:00
Automerger Merge Worker
657cfdd14b Merge "bionic: Check /sys/kernel/tracing for tracefs" am: 4537cf868b
Change-Id: I9e6c830c330d1e023d1969a8158d84e42b3d473e
2020-02-10 16:56:08 +00:00
Treehugger Robot
4537cf868b Merge "bionic: Check /sys/kernel/tracing for tracefs" 2020-02-10 16:40:50 +00:00
Automerger Merge Worker
de4c31a22a Merge "Update to v5.5 kernel headers." am: 6ab6025981
Change-Id: I55f1d5592b23a9ee70045f17b2e10235366184bd
2020-02-07 22:18:13 +00:00
Christopher Ferris
6ab6025981 Merge "Update to v5.5 kernel headers." 2020-02-07 22:04:23 +00:00
Christopher Ferris
d32ca14ea3 Update to v5.5 kernel headers.
Kernel headers coming from:

Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-5.5

Test: Boots on walleye.
Test: Ran bionic-unit-tests on walleye.
Test: Boots on cuttlefish.
Test: Ran bionic-unit-tests on cuttlefish.
Change-Id: I57387d3c31e0ba5ad125ffe291cecf365c7b374e
Merged-In: I57387d3c31e0ba5ad125ffe291cecf365c7b374e
2020-02-07 20:14:42 +00:00
Hridya Valsaraju
ad5f772dba bionic: Check /sys/kernel/tracing for tracefs
tracefs will be mounted at /sys/kernel/tracing when debugfs
is not mounted.

Bug: 134669095
Test: atest bionic-unit-tests-static
Change-Id: Ic224cf13500efc570da8b6a27ce925bbcf068fdd
2020-02-07 11:54:28 -08:00
Jooyung Han
d55689bb99 Use "com.android.runtime" for its link namespace
For consistency, linker namespace for apex modules use its apex name
instead of hard-coded short name.

Bug: 148826508
Test: m / boot
Change-Id: I4bf565cd528d744fc42841fd2d9f8bf652d4d346
2020-02-08 03:49:22 +09:00
Automerger Merge Worker
cb1d238dd8 Merge "Use generated linker config for APEX binaries" am: a399ede44e
Change-Id: Ifb9fbfe8f6fb831aaa9c1118aaaa94ac70660f2d
2020-02-07 03:47:15 +00:00
Kiyoung Kim
a399ede44e Merge "Use generated linker config for APEX binaries" 2020-02-07 03:25:42 +00:00
Mitch Phillips
892d0286c4 [Elf TLS] [GWP-ASan] Update ELF TLS test.
GWP-ASan introduces two Initial-Exec thread-local variables into
libc.so. This causes the ELF TLS test to understandably fail, and needs
to be patched up.

Bug: 148606979
Test: atest bionic-unit-test
Change-Id: I77500a00edb55cb7bcd3cd3faffb76d2339ab42c
2020-02-07 01:40:05 +00:00
Automerger Merge Worker
88e638fc59 Merge "docs/status.md: link to github." am: 6fa2f4f2ff
Change-Id: Id0dd89c810729b68334fbce1a0cb3787a98d978b
2020-02-06 21:18:59 +00:00