Commit graph

31523 commits

Author SHA1 Message Date
Lev Rumyantsev
41127dca3d Narrow native bridge to clone_for_fork
We are removing native bridge copy of fork.cpp, but need to
replace call to clone() when it's done for bionic's fork.

The code here will run all pre-/post-clone routines for *guest*,
while native bridge implementation will need to run the
corresponding *host* routines.

Bug: 145028007
Test: bionic-unit-tests
Change-Id: Ic5524e743caa287d7aaa8dc7e5d34acd1c7e1170
2020-06-03 17:00:41 -07:00
Jooyung Han
f78faebccd Merge "Make .whitelisted property "append"-able" am: cd95c53bab
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1322515

Change-Id: I93a23cf07d6c0969de45178a7a43b2bf1bf64f6f
2020-06-03 01:32:07 +00:00
Jooyung Han
cd95c53bab Merge "Make .whitelisted property "append"-able" 2020-06-03 01:16:30 +00:00
Treehugger Robot
755aaa1ef6 Merge "fdtrack: increase backtrace depth." am: 55ae06ac07
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1322904

Change-Id: I72acebe73447ab9b7e3afce8f6264a44c9e22e69
2020-06-03 00:25:32 +00:00
Treehugger Robot
55ae06ac07 Merge "fdtrack: increase backtrace depth." 2020-06-03 00:13:14 +00:00
Christopher Ferris
765968f82f Merge "Update to v5.7 kernel headers." am: 4cc4c6c43f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1322217

Change-Id: Ic45cd0ba70361ff030f7ec6abe16cfe9242f4fae
2020-06-02 23:24:14 +00:00
Christopher Ferris
4cc4c6c43f Merge "Update to v5.7 kernel headers." 2020-06-02 23:11:54 +00:00
Josh Gao
55b91af828 fdtrack: increase backtrace depth.
Bug: http://b/155136951
Bug: http://b/157789860
Test: treehugger
Change-Id: I1e575fdef7d520f5a896130844eefb1a1ba46694
2020-06-02 16:06:55 -07:00
Christopher Ferris
af09c709d5 Update to v5.7 kernel headers.
Kernel headers coming from:

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

Update the generate_uapi_headers.sh where the types.h file is now in
the right place, but kvm.h is not.

Test: Booted cuttlefish/bonito.
Test: Ran bionic-unit-tests on cuttlefish/bonito.
Change-Id: Ice9ce370a658e320b80f564b34a4431927fcf100
2020-06-02 10:58:28 -07:00
Jooyung Han
61a9a4016c Make .whitelisted property "append"-able
.whitelisted is a list of sonames seperated by ":" just like
.shared_libs and .paths properties. It makes sense to make it appendable
using += as well ass .shared_libs and .paths.

Bug: n/a
Test: atest linker-unit-tests
Change-Id: If61cc553c8080e8a58de8a3a6051c1853f7bfe5f
2020-06-02 16:05:01 +09:00
Treehugger Robot
6d7dd4f08f Merge "Add newline at end of error message" am: 6a642f7760
Change-Id: Id8baf5f3c1d879e8d21c01233f536327b668fe65
2020-06-01 19:00:22 +00:00
Treehugger Robot
6a642f7760 Merge "Add newline at end of error message" 2020-06-01 18:43:33 +00:00
Pirama Arumuga Nainar
cb4a7c81e0 Add newline at end of error message
So the message gets flushed before the following abort.

Test: bionic-unit-tests without bionic-loader-test-libs at the expected
      relative path shows the error message.
Change-Id: I53bb27a88b73c9d8f4bb76560752f99a104d71ca
2020-05-30 16:46:20 -07:00
Treehugger Robot
b300aea97b Merge "clock: buff our coverage numbers slightly." am: 72a955bf0f
Change-Id: Icd2139d60d16e0cb55052f9f35677a7b92b122e6
2020-05-30 00:30:17 +00:00
Treehugger Robot
72a955bf0f Merge "clock: buff our coverage numbers slightly." 2020-05-30 00:15:57 +00:00
Elliott Hughes
09e394f92a clock: buff our coverage numbers slightly.
clock_gettime() with known arguments can't fail (and we ignore its
return value in most other places already).

Test: treehugger
Change-Id: I2374ae5ba1598a01d4c4f689b9c75c4e7dc926b6
2020-05-29 15:36:16 -07:00
Christopher Ferris
b3b6ddcf12 Merge "Ignore SCUDO_OPTIONS across a security boundary." am: 700f753c50
Change-Id: I9aa28632e74b94dd3b0a6154b0993dad126982fd
2020-05-27 00:12:59 +00:00
Christopher Ferris
700f753c50 Merge "Ignore SCUDO_OPTIONS across a security boundary." 2020-05-26 23:57:42 +00:00
Christopher Ferris
ad3be7e649 Ignore SCUDO_OPTIONS across a security boundary.
Add SCUDO_OPTIONS to the list of the environment variables that should
not be preserved across a security boundary.

Bug: 157484128

Test: Builds and boots.
Change-Id: Id8644608114ad2fd49baedbdbbe1c899768bd54d
2020-05-26 15:12:06 -07:00
Peter Collingbourne
5f62ab63e9 Merge "Define mte_supported() on non-aarch64." am: 642b374e64
Change-Id: I182443467c958f5cbee71674330a1f116d8212c6
2020-05-21 21:03:02 +00:00
Peter Collingbourne
642b374e64 Merge "Define mte_supported() on non-aarch64." 2020-05-21 20:49:11 +00:00
Christopher Ferris
5b5c56003a Merge "Fix deadlock/timeout in thread unwinding." am: 3c9cd8a29d
Change-Id: I9069f1da5f71f69361a3273242d0d698aa37b2ab
2020-05-21 16:26:58 +00:00
Christopher Ferris
3c9cd8a29d Merge "Fix deadlock/timeout in thread unwinding." 2020-05-21 16:13:37 +00:00
Christopher Ferris
9bf7817dd2 Fix deadlock/timeout in thread unwinding.
When malloc debug is enabled, using libbacktrace to unwind can
result in a deadlock. This happens when an unwind of a thread
is occuring which triggers a signal to be sent to that thread. If
that thread is interrupted while a malloc debug function is
executing and owns a lock, that thread is then stuck in the signal
handler. Then the original unwinding thread attempts to do an
allocation and gets stuck waiting for the same malloc debug lock.

This is not a complete deadlock since the unwinder has timeouts,
but it results in truncated unwinds that take at least five
seconds to complete.

Only the backtrace signals needs to be blocked because it is the only
known signal that will result in a thread being paused in a signal
handler.

Also, added a named signal in the reserved signal list for the
special bionic backtrace signal.

Bug: 150833265

Test: New unit tests pass with fix, fail without fix.
Change-Id: If3e41f092ebd40ce62a59ef51d636a91bc31ed80
2020-05-20 18:18:54 -07:00
Josh Gao
cd73d27768 Merge "sigaction: don't call interposable symbol." am: 867b46a2ca
Change-Id: I62f38373c60e2c281a5d1d0e8c4fcf4054ea2b15
2020-05-20 21:51:00 +00:00
Josh Gao
867b46a2ca Merge "sigaction: don't call interposable symbol." 2020-05-20 21:36:49 +00:00
vichang
ae5d43caa9 Merge "Revert "Disable dlfcn#dlopen_system_libicuuc_ tests due to test failures on cuttlefish"" am: cacda52a0a
Change-Id: Ida8a33d89e6fd935770afa8d15348bd4e87814c3
2020-05-20 16:21:52 +00:00
vichang
cacda52a0a Merge "Revert "Disable dlfcn#dlopen_system_libicuuc_ tests due to test failures on cuttlefish"" 2020-05-20 16:01:53 +00:00
Josh Gao
11623dd60d sigaction: don't call interposable symbol.
Ensure we don't call sigchain's sigaction64 from bionic's sigaction by
extracting sigaction64 to a static function.

Test: treehugger
Change-Id: I16226c6ac580ece7000c335beb1d3b76429d2a06
2020-05-19 18:40:50 -07:00
Treehugger Robot
2737246d29 Merge "Expand a little on the time_t situation." am: 071d071646
Change-Id: Ie8ad22c1ba0d0cd406d083894ad9f1a4ef620ccf
2020-05-20 00:45:45 +00:00
Treehugger Robot
071d071646 Merge "Expand a little on the time_t situation." 2020-05-20 00:26:52 +00:00
Elliott Hughes
1cd4d4227a Expand a little on the time_t situation.
Since we last touched this file, the Linux kernel has added the missing
API, but time has also moved on enough to make the cost/benefit
unconvincing for Android.

Bug: http://b/156317457
Test: treehugger
Change-Id: I07fa678458ef10d15540b36ab65e0898d2fdadc6
2020-05-19 12:41:25 -07:00
Victor Khimenko
95077fdfe4 Merge "Refactor translateSystemPathToApexPath" am: ba198d5084
Change-Id: I530abbb026b5f96dc3c4d83833f0a8b7c4fda18a
2020-05-19 10:03:15 +00:00
Victor Khimenko
ba198d5084 Merge "Refactor translateSystemPathToApexPath" 2020-05-19 09:48:43 +00:00
Bram Bonné
be4ba01ce1 Merge "Speed up seccomp with priority list." am: 4c093efdff
Change-Id: I7e6d7be2b1ff59ac4f83441ec6919c5007b90557
2020-05-19 08:13:38 +00:00
Bram Bonné
4c093efdff Merge "Speed up seccomp with priority list." 2020-05-19 07:38:07 +00:00
Victor Khimenko
9b3e026c8f Refactor translateSystemPathToApexPath
This is more efficient and easier to read.

Test: bionic-unit-tests --gtest_filter=*icu*

Change-Id: Iddeed7cd4a1d48d8968f97951a9af004ccce52e8
2020-05-19 02:32:07 +02:00
Treehugger Robot
fd9af3fc35 Merge "Revert "Temporarily disable FdsanTest.vfork."" am: 0b2dc97fa6
Change-Id: I20a3ce7e0e2dfdea13944549ead39203b2e10d47
2020-05-18 21:36:19 +00:00
Treehugger Robot
0b2dc97fa6 Merge "Revert "Temporarily disable FdsanTest.vfork."" 2020-05-18 21:22:38 +00:00
Josh Gao
54e502e66a Revert "Temporarily disable FdsanTest.vfork."
This reverts commit b4cbff351f.

Bug: http://b/156400255
Test: none
Change-Id: I3a936542ccff8989b4671f3e03dd9d1d5559d6ff
2020-05-18 12:59:38 -07:00
Bram Bonné
acadd09c66 Speed up seccomp with priority list.
Allow to provide a list of prioritized syscalls (e.g., syscalls that we
know occur often) which are checked before other syscalls in seccomp.

When constructing the bpf seccomp filter, traverse prioritized syscalls
in a linear list before checking all other syscalls in a binary tree.

Bug: 156732794
Test: make, inspect generated *_system_policy.cpp files
Test: simpleperf on futex/ioctl-heavy app seems to show 5-10% less time
spent in seccomp call

Change-Id: I509343bcd32ada90c0591785ab5cb12d2a38c31e
(cherry picked from commit ce84677733)
2020-05-18 11:20:30 +02:00
Victor Khimenko
2befdf2f1e Merge "Allow native_bridge linker to use different APEX from native one" am: 57a1c3908f
Change-Id: I28c0d5e38896038fd92239fe67102cde80d08f3d
2020-05-16 01:24:14 +00:00
Victor Khimenko
57a1c3908f Merge "Allow native_bridge linker to use different APEX from native one" 2020-05-16 01:05:55 +00:00
vichang
b8cd7e7f58 Revert "Disable dlfcn#dlopen_system_libicuuc_ tests due to test failures on cuttlefish"
This reverts commit 01fb8d7120.

Reason for revert: Re-land the test after fixing b/156397945

Bug: 156397945
Change-Id: Ie9ec5fef7a308e28d512c6438c5c06758bdbcf06
2020-05-15 22:01:00 +00:00
Victor Khimenko
01790fdc69 Allow native_bridge linker to use different APEX from native one
Bug: http://b/156397945

Test: dlfcn.dlopen_system_libicuuc_android_api_level_28 with native_bridge

Change-Id: I3ecd929a0c31dda8cd424795f21f6ef472776557
2020-05-15 20:56:22 +00:00
Christopher Ferris
e58aca31fd Merge "Remove reference to deprecated option." am: 3d238a895c
Change-Id: Ic0afc4e392a15b4c00b785848768e3fa37aabf45
2020-05-15 15:42:32 +00:00
Christopher Ferris
3d238a895c Merge "Remove reference to deprecated option." 2020-05-15 15:28:43 +00:00
Victor Khimenko
7eff269314 Merge "Copy translateSystemPathToApexPath to linker_translate_path.cpp" am: e145aae949
Change-Id: Icdff2f370cbbcb9e319a3013f3d5c84dd8414b07
2020-05-15 13:46:51 +00:00
Victor Khimenko
e145aae949 Merge "Copy translateSystemPathToApexPath to linker_translate_path.cpp" 2020-05-15 13:30:22 +00:00
Treehugger Robot
e0a4495a26 Merge "Add Bionic module SDK." am: 6972d40571
Change-Id: I8816aa227f000ba1cfc420bc55a231fdbb09c94b
2020-05-15 12:31:40 +00:00