Commit graph

27238 commits

Author SHA1 Message Date
Robert Sesek
9e3e6085a9 Merge "Move pipe, open, and getdents from the APP to COMMON seccomp whitelist."
am: 4d98149096

Change-Id: Ia8b2438f7e7f4518cf5cf190367cb30d490527c1
2018-09-12 15:44:38 -07:00
Treehugger Robot
4d98149096 Merge "Move pipe, open, and getdents from the APP to COMMON seccomp whitelist." 2018-09-12 21:46:14 +00:00
Robert Sesek
74cdb253ba Move pipe, open, and getdents from the APP to COMMON seccomp whitelist.
These system calls are required by Breakpad for crash reporting.
WebViews are spawned from the webview_zygote, which itself is spawned
from the app_process zygote. The webview_zygote gets the SYSTEM seccomp
policy applied because it is not an app, and so the WebView sandboxed
processes inherit that policy.

In Ifd8a85b0de2eb6f2a76a6458570fc03b020a90ab, these system calls were
moved from COMMON to APP, which breaks Breakpad/crash reporting for
WebView sandboxed processes.

Bug: 112572914
Test: `am start com.android.settings/.SettingsLicenseActivity`
Test: Get the pid of the sandboxed_process0 for the license viewer.
Test: Send the process SIGABRT and check logcat for "google-breakpad"
      error messages.

Change-Id: I1cf56ae85b1a67ec91e979bc7e0f941726a9cc0e
2018-09-11 19:20:34 -04:00
Orion Hodson
1a9b28842c Merge "Update probing in membarrier_test"
am: 56deeb7336

Change-Id: I9482ccd337aba002db4edb53701d7f09062a88d4
2018-09-10 23:55:51 -07:00
Orion Hodson
56deeb7336 Merge "Update probing in membarrier_test" 2018-09-11 06:43:10 +00:00
Orion Hodson
0c938550cf Update probing in membarrier_test
Updates HasMembarrier(cmd) to probe rather than execute command to fix
unintended test skipping.

Test: manual on OrangePi Zero running 4.17.4.
Change-Id: I33a6684a3662cae20cbedc52463b26ef299caf71
2018-09-10 10:21:40 +01:00
Christopher Ferris
66584fef49 Merge "Fix membarrier test."
am: 2942b6a2c2

Change-Id: I7e2381d2d4a03a09c693d4b80348692f31311b0f
2018-09-08 09:48:58 -07:00
Christopher Ferris
2942b6a2c2 Merge "Fix membarrier test." 2018-09-08 16:33:47 +00:00
Bernie Innocenti
1de7afafb6 Merge "Improve netd detection"
am: 59c08dd67b

Change-Id: I2ae5860f184e2236cbf25b92f6e6f3bef3d8a024
2018-09-07 19:15:12 -07:00
Bernie Innocenti
59c08dd67b Merge "Improve netd detection" 2018-09-08 01:58:34 +00:00
Christopher Ferris
795034cab8 Fix membarrier test.
Some older kernels do not support all membarrier commands. For example,
the 4.9.x kernel only supports MEMBARRIER_CMD_QUERY and MEMBARRIER_CMD_SHARED.

Test: Ran unit tests on hikey.
Change-Id: I5d4b93df6aa5f443c4700e8f7d33f46953f74e87
2018-09-07 14:11:28 -07:00
Bernie Innocenti
fb4eaa019e Improve netd detection
The alleged improvement consists in making the detection actually work
when netd is spawned by init, which of course uses the full path.
I had tested the previous logic by running netd from the shell, which
worked because argv[0] was just set to "netd". My bad -_-

Test: flash, boot and grep logcat for "Skipping libnetd_client init"
Change-Id: Ie5f11436dfa2a9347721147dc2b980144452404a
2018-09-07 10:29:18 -07:00
Elliott Hughes
4743e2f3a0 Merge "Add android_get_device_api_level."
am: 431d2ff141

Change-Id: I9c6a8bd66e2cec78fa62613c3d591e52e29e933e
2018-09-07 08:49:49 -07:00
Elliott Hughes
431d2ff141 Merge "Add android_get_device_api_level." 2018-09-07 15:40:45 +00:00
Orion Hodson
3a1bae5cd8 Merge "libc: Add membarrier to common seccomp allowed list"
am: dca7d3fae5

Change-Id: I47dac5624f4a36ff74ffdaa5f467e337c89e5126
2018-09-07 03:08:15 -07:00
Orion Hodson
dca7d3fae5 Merge "libc: Add membarrier to common seccomp allowed list" 2018-09-07 09:46:08 +00:00
Josh Gao
44c5ea8f64 Merge "Fix mistake in fdsan documentation."
am: 8a8bf193b0

Change-Id: I25c7d1ef57032be9c2cd95e8e2215499b08ee7db
2018-09-06 19:57:28 -07:00
Luis Hector Chavez
72c7c6f7d0 Merge "bionic: Add magic to abort message"
am: dc91d900ae

Change-Id: I0416ac17f643a88835dcdd7fb5f6a722541cb51e
2018-09-06 19:55:52 -07:00
Treehugger Robot
8a8bf193b0 Merge "Fix mistake in fdsan documentation." 2018-09-07 01:33:58 +00:00
Treehugger Robot
dc91d900ae Merge "bionic: Add magic to abort message" 2018-09-07 01:32:14 +00:00
Elliott Hughes
cddd0a6d57 Merge "Use strerror_r(3) for the printf family %m."
am: e15e93a247

Change-Id: I5d404fee9a32b8178a2fc62c3ae4f62a6764fd1e
2018-09-06 17:21:42 -07:00
Josh Gao
41a3233977 Merge "fdsan: add documentation."
am: 0326f063b5

Change-Id: I7bb1a6d612519cf9fef5a8736195088b7171af74
2018-09-06 17:19:45 -07:00
Elliott Hughes
e15e93a247 Merge "Use strerror_r(3) for the printf family %m." 2018-09-06 23:45:18 +00:00
Evgenii Stepanov
250ec79d61 Merge "Annotate siglongjmp for HWASan."
am: a2a114ba26

Change-Id: Ib3617e601f17f0581f299e9873f39864de24ea13
2018-09-06 16:27:38 -07:00
Josh Gao
01416ba112 Fix mistake in fdsan documentation.
File descriptors are POSIX, not C.

Test: none
Change-Id: Idc3c32c60f9c61e8e68aabbc4589a6c68e156e4b
2018-09-06 16:23:38 -07:00
Josh Gao
0326f063b5 Merge "fdsan: add documentation." 2018-09-06 23:17:50 +00:00
Luis Hector Chavez
6d93c60778 bionic: Add magic to abort message
This change adds a 128-bit magic value just before the abort message
(and its length). This allows Chrome OS crash collector (which cannot
reliably correlate a crash with its corresponding tombstone) to extract
the abort message from the core dump.

Bug: 62387553
Test: /data/nativetest{,64}/debuggerd_test/*
Test: /data/nativetest{,64}/bionic-unit-tests{,-static}/*

Change-Id: I69ff021d773b3a10081ab16ddf6f23233320fb02
2018-09-06 15:18:21 -07:00
Josh Gao
b64196a9bb fdsan: add documentation.
Test: none
Change-Id: I7dabd8f5420c757b6504254a6414da8e877d475e
2018-09-06 14:55:12 -07:00
Treehugger Robot
a2a114ba26 Merge "Annotate siglongjmp for HWASan." 2018-09-06 21:35:09 +00:00
Elliott Hughes
ce934e3d9b Add android_get_device_api_level.
Bug: http://b/113615412
Test: ran tests
Change-Id: I0a7ae336c96c9ed6543b6935cbc242d14d4a4a67
2018-09-06 14:19:46 -07:00
Elliott Hughes
f340a56d1c Use strerror_r(3) for the printf family %m.
There's TLS space used for unknown errno values, and a call to printf
shouldn't clobber that. No-one will ever hit this in real life, but
since it's easily fixed...

Bug: http://b/112776560
Test: ran tests
Change-Id: I8c2437f2e5214e652119791d4e162a197b049d5b
2018-09-06 10:42:40 -07:00
Orion Hodson
6ba6694ec2 libc: Add membarrier to common seccomp allowed list
Allows ART JIT use membarrier to invalidate instruction
pipelines.

Bug: 66095511
Test: bionic-unit-tests
Change-Id: I8cf83929f00baf5a3c440a899d2667a992bda8e2
2018-09-06 16:36:09 +01:00
Elliott Hughes
8c4952563b Merge "Revert "arm64: Use builtin for nearbyintf/nearbyint""
am: 1e4a4134fb

Change-Id: Ice0e19fd296da1b67f03ad585c6603dcbf954088
2018-09-05 20:42:19 -07:00
Treehugger Robot
1e4a4134fb Merge "Revert "arm64: Use builtin for nearbyintf/nearbyint"" 2018-09-06 00:47:32 +00:00
Elliott Hughes
b75cc027ff Revert "arm64: Use builtin for nearbyintf/nearbyint"
This reverts commit 35d8ba303b.

Reason for revert: caused test failures...

[  FAILED  ] math_h_force_long_double.nearbyint (15 ms)
bionic/tests/math_test.cpp:(1080) Failure in test math_h_force_long_double.nearbyint
Value of: (fetestexcept(FE_ALL_EXCEPT) & FE_INEXACT) == 0
  Actual: false
Expected: true
math_h_force_long_double.nearbyint exited with exitcode 1.

Change-Id: If8e3a3dfbd0e7ee071e5187f96749b6acbb5fc05
2018-09-05 22:29:28 +00:00
Evgenii Stepanov
b16e9ce7b8 Annotate siglongjmp for HWASan.
HWASan needs to re-tag the newly unallocated stack space to match SP.

Bug: 112438058
Test: SANITIZE_TARGET=hwaddress

Change-Id: I4dddef542d802d63bdea59e32a03425a2c4f870b
2018-09-05 13:37:14 -07:00
Elliott Hughes
cd52478362 Merge "Document various post-P bionic changes."
am: e57399d4a1

Change-Id: I3285aa56a46e46004f37ae055d3aa41bd746a1c0
2018-09-05 13:30:08 -07:00
Treehugger Robot
e57399d4a1 Merge "Document various post-P bionic changes." 2018-09-05 20:15:05 +00:00
Elliott Hughes
2e10cd5529 Merge "Add the %m GNU extension to printf/wprintf."
am: 74934aaf10

Change-Id: Ib5e103f3186315c4a72e2e711e48adcf44fa62aa
2018-09-05 12:31:30 -07:00
Elliott Hughes
86bce192e9 Document various post-P bionic changes.
Historically we haven't documented many behavioral changes, but it's
probably useful to record that information before it's lost (even if,
long term, it might be more useful in the man pages or the doc comments).

Bug: N/A
Test: N/A
Change-Id: Iaa4f651fd6576298d848894b61285ef95879deb9
2018-09-05 12:01:15 -07:00
Elliott Hughes
74934aaf10 Merge "Add the %m GNU extension to printf/wprintf." 2018-09-05 18:47:44 +00:00
Elliott Hughes
7c75e8c554 Merge "arm64: Use builtin for nearbyintf/nearbyint"
am: 6c7c06712e

Change-Id: I60df229e13c1d8e292f1953ace995271967b883c
2018-09-05 09:08:51 -07:00
Elliott Hughes
6c7c06712e Merge "arm64: Use builtin for nearbyintf/nearbyint" 2018-09-05 15:56:27 +00:00
Bernie Innocenti
4990176148 Merge "Prevent netd from using the libnetd_client wrappers"
am: 198fb7b6df

Change-Id: I28bea908be65bb7f6bbfb78e196d55a3d39c8bcc
2018-09-05 08:38:52 -07:00
Treehugger Robot
198fb7b6df Merge "Prevent netd from using the libnetd_client wrappers" 2018-09-05 15:22:59 +00:00
Bernie Innocenti
1b2ecee5da Prevent netd from using the libnetd_client wrappers
Netd looping connections to itself via the libnetd_client connect()
wrapper has always unintended, although it worked until now. Once we
move the resolver into netd, the frequency of connect() calls will
increase, which makes it less acceptable.

There are several ways to detect if the calling process is netd.
Checking both uid == 0 and the argv[0] == netd makes it hard for
non-system components to spoof as netd.

Test: flash a device and check that netd logs the "Skipping..." message
Test: atest netd_integration_test
Change-Id: I9506facb4aa3094b16a98a913a1e2394056ce91a
2018-09-05 17:43:42 +09:00
Elliott Hughes
c26741db2b Merge "Explain up-front what bionic actually _is_."
am: 04432c328f

Change-Id: I28b4208ffa46fc8fe577c3c8d2725bb689cd7815
2018-09-04 23:00:42 -07:00
Elliott Hughes
04432c328f Merge "Explain up-front what bionic actually _is_." 2018-09-05 05:52:45 +00:00
Josh Gao
dd4f5d389b Merge "Generalize abort's inline_tgkill, use it in fdsan."
am: c69757a2d5

Change-Id: I44ac80f8256d66c0f85711e011f39327d973da13
2018-09-04 15:12:14 -07:00
Treehugger Robot
c69757a2d5 Merge "Generalize abort's inline_tgkill, use it in fdsan." 2018-09-04 21:59:54 +00:00