Commit graph

31398 commits

Author SHA1 Message Date
Treehugger Robot
b274746dd3 Merge "Remove return after GTEST_SKIP." 2020-03-04 18:29:33 +00:00
Automerger Merge Worker
60d00d39a2 Merge "Update the scudo wrapper for bionic changes." am: 93517d1a27 am: 205790270a
Change-Id: Ic7af313f1f90a6e213f45a750e02c51c40601efd
2020-03-03 19:32:30 +00:00
Automerger Merge Worker
205790270a Merge "Update the scudo wrapper for bionic changes." am: 93517d1a27
Change-Id: I60f8ee282dbe8bb42ef0e87a00f5f31d1d0e58b3
2020-03-03 19:21:16 +00:00
Christopher Ferris
93517d1a27 Merge "Update the scudo wrapper for bionic changes." 2020-03-03 18:52:00 +00:00
Elliott Hughes
edaf03ea18 Remove return after GTEST_SKIP.
Test: treehugger
Change-Id: I5efc31f82a979fcd8d3051c72ed8e6201b3b0d1b
2020-02-28 18:27:09 -08:00
Automerger Merge Worker
b1550b6c03 Merge "[GWP-ASan] [heapprofd] Fix infinite recursion between malloc-racing threads." am: 0d303b42b5 am: 8bd2ab6a26
Change-Id: I630df05295f8780c77984f69f18a2888c73ff24d
2020-02-28 23:55:46 +00:00
Automerger Merge Worker
8bd2ab6a26 Merge "[GWP-ASan] [heapprofd] Fix infinite recursion between malloc-racing threads." am: 0d303b42b5
Change-Id: I99b2dcb85dd7798f38319af16eefb7a31ae1bc39
2020-02-28 23:39:27 +00:00
Mitch Phillips
0d303b42b5 Merge "[GWP-ASan] [heapprofd] Fix infinite recursion between malloc-racing threads." 2020-02-28 23:18:14 +00:00
Christopher Ferris
2c447b0586 Update the scudo wrapper for bionic changes.
Bug: 137795072

Test: Built using jemalloc, and verified that the two processes that
Test: use libc_scudo do not crash.
Change-Id: Icf773b656d7e2bcdf41b4979e9b6cd980b02d34d
2020-02-28 14:34:13 -08:00
Automerger Merge Worker
7d908042aa Merge "[GWP-ASan] Don't intercept calloc." am: 95c772f734 am: c61f25f47f
Change-Id: Ib3cf44809a15eefcdf8ca6bb3c17f3d517903e94
2020-02-28 21:38:45 +00:00
Automerger Merge Worker
ca95aae509 Merge "Switch to the arm-optimized-routines string routines on aarch64 where possible." am: ddedd9828b am: 85cf71fa3d
Change-Id: I6b6802c6e0f9b935b1ead7f1ff8ce2af598608dd
2020-02-28 21:38:32 +00:00
Automerger Merge Worker
c61f25f47f Merge "[GWP-ASan] Don't intercept calloc." am: 95c772f734
Change-Id: Ifa001a6bcd53cdd9aa7491b2f9951ba387a1fdf0
2020-02-28 21:27:29 +00:00
Automerger Merge Worker
85cf71fa3d Merge "Switch to the arm-optimized-routines string routines on aarch64 where possible." am: ddedd9828b
Change-Id: I262dff78db57ccff995bc7fe8ca3d12206afb246
2020-02-28 21:27:20 +00:00
Treehugger Robot
95c772f734 Merge "[GWP-ASan] Don't intercept calloc." 2020-02-28 21:19:51 +00:00
Peter Collingbourne
ddedd9828b Merge "Switch to the arm-optimized-routines string routines on aarch64 where possible." 2020-02-28 21:15:24 +00:00
Automerger Merge Worker
1a94111c80 Merge "Update bionic to the v2 MTE patch set." am: 2dd382d9b6 am: d53f4f847d
Change-Id: I38a6f6a9b5c5e7a991ce458b98b1628990c89155
2020-02-28 17:09:52 +00:00
Mitch Phillips
5c65e87579 [GWP-ASan] Don't intercept calloc.
See linked bug for more information.

Bug: 150456936
Test: N/A
Change-Id: Ibdd4331d005cf488e24c238e67e46cee13198334
2020-02-28 16:58:23 +00:00
Automerger Merge Worker
d53f4f847d Merge "Update bionic to the v2 MTE patch set." am: 2dd382d9b6
Change-Id: I834d141534b9facc306e9f2f2a05b8c9a644e140
2020-02-28 16:54:25 +00:00
Peter Collingbourne
2dd382d9b6 Merge "Update bionic to the v2 MTE patch set." 2020-02-28 16:43:22 +00:00
Mitch Phillips
449c26a47d [GWP-ASan] [heapprofd] Fix infinite recursion between malloc-racing threads.
When the heapprofd lazy-initialization dispatch table is installed, two
threads can call malloc() at the same time. One will do the
lazy-initialization, the other will fail the atomic_exchange of
gHeapprofdInitHookInstalled and go to system malloc. The system malloc
still contains the lazy-init malloc, and will recurse.

Fix it so the second thread goes directly to the previous dispatch
table, or to the system allocator directly (instead of through libc
malloc()).

Bug: 150085813
Test: atest perfetto_integrationtests
Test: TracedPerfCtsTest.SystemWideDebuggableApp on cuttlefish x86.
Change-Id: Ia85ad619a0d5e3f558136d84c34dbada4e8b845d
2020-02-28 08:33:27 -08:00
Automerger Merge Worker
4bef89592b Merge "Cleans up logging and comments in ifaddrs." am: 188f87a1b6 am: 0b5e9257b3
Change-Id: I322a61cd6f31ebd95740e9258283a005e5be40dd
2020-02-28 09:34:50 +00:00
Automerger Merge Worker
0b5e9257b3 Merge "Cleans up logging and comments in ifaddrs." am: 188f87a1b6
Change-Id: I111451f607c95e57bc106b6314f2b1c1a29bc6bb
2020-02-28 09:22:41 +00:00
Bram Bonné
188f87a1b6 Merge "Cleans up logging and comments in ifaddrs." 2020-02-28 09:07:20 +00:00
Automerger Merge Worker
fc6bbdc14f Merge "Handle the alternate signal stack correctly in android_unsafe_frame_pointer_chase." am: c00691aa9e am: 1622ac9a76
Change-Id: Idb0f3fec2b8764aa700bdc8ac97817b4bd3355bc
2020-02-28 02:01:34 +00:00
Peter Collingbourne
80af1b0a2c Update bionic to the v2 MTE patch set.
The values of some constants have changed, and the tag mask has changed from
being an exclusion mask to an inclusion mask.

Bug: 135772972
Change-Id: I322fceae7003bee6b391e7187194ed4c0cb28c58
2020-02-28 01:55:20 +00:00
Automerger Merge Worker
1622ac9a76 Merge "Handle the alternate signal stack correctly in android_unsafe_frame_pointer_chase." am: c00691aa9e
Change-Id: I698fa42731d09b15cda7e8100200ef3b2486692f
2020-02-28 01:41:06 +00:00
Peter Collingbourne
c00691aa9e Merge "Handle the alternate signal stack correctly in android_unsafe_frame_pointer_chase." 2020-02-28 01:28:37 +00:00
Automerger Merge Worker
87f77cb93b Merge "[unit tests] Add '-mbranch-protection=standard' flag to arm64" am: 0dd87c37d4 am: 7ebbfd329a
Change-Id: Id5551c5ced67a837b5f2d6a9b0f513af33ad284b
2020-02-27 22:37:03 +00:00
Automerger Merge Worker
7ebbfd329a Merge "[unit tests] Add '-mbranch-protection=standard' flag to arm64" am: 0dd87c37d4
Change-Id: Ie21ac0f0824be809d3793018ee73d74628d2a504
2020-02-27 22:26:28 +00:00
Treehugger Robot
0dd87c37d4 Merge "[unit tests] Add '-mbranch-protection=standard' flag to arm64" 2020-02-27 22:11:19 +00:00
Peter Collingbourne
b8d1348788 Handle the alternate signal stack correctly in android_unsafe_frame_pointer_chase.
If an alternate signal stack is set and the frame record is in bounds of
that stack, we need to use the top of the alternate signal stack for bounds
checking rather than the normal stack.

Bug: 150215618
Change-Id: I78b760d61b27da44f8e0cfee3fe94a791011fe58
2020-02-27 10:44:15 -08:00
Automerger Merge Worker
f93b804198 Merge "[GWP-ASan] [heapprofd] Nullptr deref in dispatch." am: c4f9c9d171 am: c5725110ed
Change-Id: Idc0426fdfafdcbb42d052edd8b09e9ca007bf456
2020-02-27 18:29:05 +00:00
Automerger Merge Worker
c5725110ed Merge "[GWP-ASan] [heapprofd] Nullptr deref in dispatch." am: c4f9c9d171
Change-Id: Iab3a808f494146de5840b4ac67db1122c67c8615
2020-02-27 18:18:29 +00:00
Mitch Phillips
c4f9c9d171 Merge "[GWP-ASan] [heapprofd] Nullptr deref in dispatch." 2020-02-27 18:04:08 +00:00
Bram Bonné
918bd72225 Cleans up logging and comments in ifaddrs.
To prevent unnecessary SELinux denials, the check referred to by the
comment is kept in place. This allows us to keep auditing the
SELinux denial in order to catch apps that intentionally send
RTM_GETLINK messages.

Fix: 141455849
Test: atest bionic-unit-tests-static
Test: atest NetworkInterfaceTest
Change-Id: I41e5ad6f071c820a8246177a0c629b3be788a942
2020-02-27 16:02:30 +01:00
Tamas Petz
d901ec6964 [unit tests] Add '-mbranch-protection=standard' flag to arm64
This change adds standard branch protection to bionic unit tests
for arm64 targets. For more information see
https://developer.arm.com/search#q=branch-protection

Both Armv8.3-A Pointer Authentication (using the A-key) hint-space
instructions and Armv8.5-A Branch Target Identification hint-space
landing pads are added to the generated code.

Test: 1. Tested on flame
      2. Tested on FVP

Change-Id: Ice991c538a9101448dea64c357f3f6bfb93877eb
2020-02-27 12:58:13 +01:00
Jooyung Han
26ddc4dccf Add 29 to stubs.versions of libc/libdl/libm
Stubs of version 29 should be provided to those APEX modules targeting
previous SDK release.

Bug: 145796956
Test: m
Change-Id: I9454fbf81377aba25e75a6fdfc77cbb070eaadde
2020-02-27 09:57:50 +00:00
Mitch Phillips
5f91bf42e3 [GWP-ASan] [heapprofd] Nullptr deref in dispatch.
Heapprofd uses an ephemeral dispatch table to ensure that GWP-ASan can
be called during heapprofd initialization. Previously, we grabbed the
backup dispatch table from the globals, which is wrong if GWP-ASan isn't
installed (as the malloc_dispatch_table is linker-initialised and not
set to a known good value if a malloc hooker isn't used).

Instead, grab the correct ephemeral dispatch table. When GWP-ASan is
installed, use a copy of its table as the dispatch. When nothing is
installed, fall back to using the native allocator dispatch.

Bug: 135634846
Bug: 150085813
Test: atest perfetto_integrationtests
Test: TracedPerfCtsTest.SystemWideDebuggableApp on cuttlefish x86.

Change-Id: I4beaf9192acadbe00adc02de2e0b0aab6f7a2190
2020-02-26 16:50:58 -08:00
Automerger Merge Worker
e062ea21f6 Merge "Override SIGSYS during profiling signal handler" am: 6cf75230d9 am: ebfaa8ba20
Change-Id: I03272a14f02fde676fb4c2ea280794aa6f7c9847
2020-02-26 16:40:54 +00:00
Automerger Merge Worker
ebfaa8ba20 Merge "Override SIGSYS during profiling signal handler" am: 6cf75230d9
Change-Id: Ib2475be582e656b08326032fac55a061aa344372
2020-02-26 16:28:19 +00:00
Treehugger Robot
6cf75230d9 Merge "Override SIGSYS during profiling signal handler" 2020-02-26 14:53:26 +00:00
Peter Collingbourne
337a5b3f9a Switch to the arm-optimized-routines string routines on aarch64 where possible.
This includes optimized strrchr and strchrnul routines, and an MTE-compatible
strlen routine.

Bug: 135772972
Change-Id: I48499f757cdc6d3e77e5649123d45b17dfa3c6b0
2020-02-25 13:11:55 -08:00
Ryan Savitski
1dc4122a1d Override SIGSYS during profiling signal handler
This is a best-effort mitigation for potential crashes when the
profiling signal handler is triggered within certain secomp'd processes.
In particular, we're working around cases where the seccomp policy
doesn't allow some of the handler syscalls, and has a crashing
disposition towards violations via SECCOMP_RET_TRAP, plus a crashing
SIGSYS handler. While not general, this covers the configurations seen
in practice on Android (which are all using minijail in the same way).

By overriding the SIGSYS handling for the duration of the profiling
handler, we can instead receive such SIGSYS signals, and instead recover
from them in a non-crashing manner (the handler is responsible for
filling the syscall return register, since the syscall itself was
skipped).

For simplicity, we're swallowing all SIGSYS signals during this window,
without trying to figure out whether they're something that could be
caused by the profiling signal handler. I've quite convinced myself that
-ENOSYS seems to be safe to return to all of bionic's syscall wrappers
across the four architectures (looking at gensyscalls + the
special-cases like vfork and clone). It is theoretically possible for
all kinds of conflicting (ab)uses of SIGSYS to exist, but I'm assuming
it's not a realistic concern until proven otherwise.

Tested: manually sigqueue'd configstore on crosshatch, confirmed that
        the SIGSYS override log was printed, and the process did not
        crash (as it does on master).
Bug: 149328505
Change-Id: Iab8f09e51169807c9d3e1e0bcfd042f09f7df6a4
2020-02-25 19:00:18 +00:00
Automerger Merge Worker
53a0f4c30b Merge "Add a libc wrapper for statx(2)." am: 33318f5197 am: ed9ebe001c
Change-Id: Id377e893e4aa382ebe48d62b16f1f6f1c9b47a8f
2020-02-25 17:02:13 +00:00
Automerger Merge Worker
661d220889 Merge "Make the HWCAP/HWCAP2 constants available from <sys/auxv.h>." am: 521dab3b36 am: 846cef8625
Change-Id: I03c17e204923e6b36b51a761d38bf2ec412739dd
2020-02-25 17:02:02 +00:00
Automerger Merge Worker
ed9ebe001c Merge "Add a libc wrapper for statx(2)." am: 33318f5197
Change-Id: I176a13f96ebd11cd2e5d9a4bfccf6d7bb41d8ead
2020-02-25 16:46:12 +00:00
Automerger Merge Worker
846cef8625 Merge "Make the HWCAP/HWCAP2 constants available from <sys/auxv.h>." am: 521dab3b36
Change-Id: I12a6cbf8b0207596956cf485394188fff305c8d8
2020-02-25 16:45:53 +00:00
Elliott Hughes
33318f5197 Merge "Add a libc wrapper for statx(2)." 2020-02-25 16:37:09 +00:00
Elliott Hughes
521dab3b36 Merge "Make the HWCAP/HWCAP2 constants available from <sys/auxv.h>." 2020-02-25 16:36:26 +00:00
Automerger Merge Worker
5f660e586c Merge "Try to resolve interface names before removing nameless interfaces." am: 9f8e1d52cb am: cea478eca2
Change-Id: Ie995f010d568f614dc056463dae9297d375eb1a1
2020-02-25 09:18:00 +00:00