OSDN Git Service
Lev Rumyantsev [Tue, 9 Jun 2020 23:21:36 +0000 (23:21 +0000)]
Move set_cached_pid() to __clone_for_fork() am:
c8c3bc58a1 am:
936dc784c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11800686
Change-Id: Id373e1024fae0aef271b7655413567a31e026781
Lev Rumyantsev [Tue, 9 Jun 2020 23:21:33 +0000 (23:21 +0000)]
Remove WEAK_FOR_NATIVE_BRIDGE for fork am:
8b26ca4164 am:
a4c0e31906
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11800685
Change-Id: I29ac82e06198fd2ef4e2e354a00624c6cf2ed802
Lev Rumyantsev [Tue, 9 Jun 2020 23:05:28 +0000 (23:05 +0000)]
Move set_cached_pid() to __clone_for_fork() am:
c8c3bc58a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11800686
Change-Id: Id7c4ee7687e98340fb99c1974e6c3872594aed55
Lev Rumyantsev [Tue, 9 Jun 2020 23:05:26 +0000 (23:05 +0000)]
Remove WEAK_FOR_NATIVE_BRIDGE for fork am:
8b26ca4164
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11800685
Change-Id: Iaa834bc6dfef109de45960757d37b005bfecf942
Lev Rumyantsev [Tue, 2 Jun 2020 01:43:55 +0000 (18:43 -0700)]
Move set_cached_pid() to __clone_for_fork()
Bug:
145028007
Test: bionic-unit-tests
Merged-In: I3c697924f2a3ef1804a688dd1fe9669f6b7a71bf
Change-Id: I3c697924f2a3ef1804a688dd1fe9669f6b7a71bf
(cherry picked from commit
3a4c2ffff80402f6c250f1491302aa7d65411349)
Lev Rumyantsev [Tue, 2 Jun 2020 01:43:55 +0000 (18:43 -0700)]
Remove WEAK_FOR_NATIVE_BRIDGE for fork
Bug:
145028007
Test: bionic-unit-tests
Merged-In: I0b019cd08c9d7426a953bd199f2ecd6dd42db00e
Change-Id: I0b019cd08c9d7426a953bd199f2ecd6dd42db00e
(cherry picked from commit
520398ffe90a45e2f2a85f56230055f9f2f6bf02)
Lev Rumyantsev [Tue, 9 Jun 2020 21:11:03 +0000 (21:11 +0000)]
Narrow native bridge to clone_for_fork am:
018f4a1310 am:
589927296b
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11800684
Change-Id: I81c54a1a5b693b107c639579772510a857418de9
Lev Rumyantsev [Tue, 9 Jun 2020 21:00:24 +0000 (21:00 +0000)]
Narrow native bridge to clone_for_fork am:
018f4a1310
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11800684
Change-Id: I5074c3f3cfea929c7c4f6c592cfae01b3ecf4361
Lev Rumyantsev [Tue, 2 Jun 2020 01:43:55 +0000 (18:43 -0700)]
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
Merged-In: Ic5524e743caa287d7aaa8dc7e5d34acd1c7e1170
Change-Id: Ic5524e743caa287d7aaa8dc7e5d34acd1c7e1170
(cherry picked from commit
41127dca3d08e5eb350b678ee03eae30ab779921)
Evgenii Stepanov [Mon, 8 Jun 2020 20:09:57 +0000 (20:09 +0000)]
Use PROT_NONE on the unused parts of CFI shadow. am:
c3b3e869ce am:
bca71db10d
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11760912
Change-Id: I4cb258a190f0e70d57ac36646800f74665e27855
Evgenii Stepanov [Mon, 8 Jun 2020 19:58:00 +0000 (19:58 +0000)]
Use PROT_NONE on the unused parts of CFI shadow. am:
c3b3e869ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11760912
Change-Id: I53474581958ab2de4beea417c59d60ef891f5c7c
Evgenii Stepanov [Fri, 5 Jun 2020 23:50:10 +0000 (16:50 -0700)]
Use PROT_NONE on the unused parts of CFI shadow.
This replaces a single 2Gb readable memory region with a bunch of tiny
regions, and leaves the bulk of 2Gb mapped but unaccessible. This makes
it harder to defeat ASLR by probing for the CFI shadow region.
Sample CFI shadow mapping with this change:
7165151000-
716541f000 ---p
00000000 00:00 0 [anon:cfi shadow]
716541f000-
7165420000 r--p
00000000 00:00 0 [anon:cfi shadow]
7165420000-
71654db000 ---p
00000000 00:00 0 [anon:cfi shadow]
71654db000-
71654dc000 r--p
00000000 00:00 0 [anon:cfi shadow]
71654dc000-
71654dd000 r--p
00000000 00:00 0 [anon:cfi shadow]
71654dd000-
71654f0000 ---p
00000000 00:00 0 [anon:cfi shadow]
71654f0000-
71654f1000 r--p
00000000 00:00 0 [anon:cfi shadow]
71654f1000-
71e5151000 ---p
00000000 00:00 0 [anon:cfi shadow]
This change degrades CFI diagnostics for wild jumps and casts (i.e. when
the target of a CFI check is outside of any known library bounds). This
is acceptable, because CFI does not have much to tell about those cases
anyway. Such bugs will show up as SEGV_ACCERR crashes inside
__cfi_slowpath in libdl.so from now on.
Bug:
158113540
Test: bionic-unit-tests/cfi_test.*
Test: adb shell cat /proc/$PID/maps | grep cfi
Change-Id: I57cbd0d3f87eb1610ad99b48d98ffd497ba214b4
Peter Collingbourne [Wed, 3 Jun 2020 19:03:13 +0000 (19:03 +0000)]
Handle the alternate signal stack correctly in android_unsafe_frame_pointer_chase. am:
91740684c2 am:
5c5aef1c0b
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11720548
Change-Id: Ifc50f48fef92bed91998cf59f43b5657e2c0d26a
Peter Collingbourne [Wed, 3 Jun 2020 18:39:38 +0000 (18:39 +0000)]
Handle the alternate signal stack correctly in android_unsafe_frame_pointer_chase. am:
91740684c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/
11720548
Change-Id: I46c15e323c1f5a14c8491e628c8be3167c3073f3
Peter Collingbourne [Thu, 27 Feb 2020 03:01:13 +0000 (19:01 -0800)]
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
Merged-In: I78b760d61b27da44f8e0cfee3fe94a791011fe58
Victor Khimenko [Mon, 1 Jun 2020 18:24:06 +0000 (18:24 +0000)]
Copy translateSystemPathToApexPath to linker_translate_path.cpp am:
eb6c7abdf9 am:
4f143b9f3d
Change-Id: If176bdccfdda0f435fe79d7ac1066b10429ea6ac
Victor Khimenko [Mon, 1 Jun 2020 18:24:02 +0000 (18:24 +0000)]
Allow native_bridge linker to use different APEX from native one am:
ccf160244c am:
396f91543d
Change-Id: Ifc531f05f5310536cfbb048bd1f36c3b35dae2b1
Victor Khimenko [Mon, 1 Jun 2020 17:55:50 +0000 (17:55 +0000)]
Copy translateSystemPathToApexPath to linker_translate_path.cpp am:
eb6c7abdf9
Change-Id: Ifd4a6e0f9442708a9f0d33808818b005c4ff4819
Victor Khimenko [Mon, 1 Jun 2020 17:55:48 +0000 (17:55 +0000)]
Allow native_bridge linker to use different APEX from native one am:
ccf160244c
Change-Id: Ie10e352cebd6466dc69a126924440ef8ffc8ccfe
Victor Khimenko [Thu, 14 May 2020 20:14:45 +0000 (22:14 +0200)]
Copy translateSystemPathToApexPath to linker_translate_path.cpp
Bug: http://b/
156397945
Test: m
Merged-In: I33f11b8a6a41475b6cdd65e1ff49b2084c33b197
Change-Id: I33f11b8a6a41475b6cdd65e1ff49b2084c33b197
(cherry picked from commit
d15229df76e78337532c19d42c01b2c51db8f2f1)
Victor Khimenko [Tue, 12 May 2020 20:59:04 +0000 (22:59 +0200)]
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
Merged-In: I3ecd929a0c31dda8cd424795f21f6ef472776557
Change-Id: I3ecd929a0c31dda8cd424795f21f6ef472776557
(cherry picked from commit
01790fdc6928a34125f092bbf98e9217a2251fa5)
Christopher Ferris [Wed, 27 May 2020 03:45:20 +0000 (03:45 +0000)]
Ignore SCUDO_OPTIONS across a security boundary. am:
2082446f8a am:
07de2f8f09
Change-Id: I4466a0b40bd70c8f6856b3382af86d2a4cfe7bfd
Christopher Ferris [Wed, 27 May 2020 03:31:22 +0000 (03:31 +0000)]
Ignore SCUDO_OPTIONS across a security boundary. am:
2082446f8a
Change-Id: Ie38e25c059189b0a14d7e502493645f76009013b
Christopher Ferris [Tue, 26 May 2020 18:14:17 +0000 (11:14 -0700)]
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
(cherry picked from commit
ad3be7e649e755c0895dbae378a5c88ae3bddb90)
Christopher Ferris [Thu, 21 May 2020 21:45:25 +0000 (21:45 +0000)]
Fix deadlock/timeout in thread unwinding. am:
73ca781f43 am:
1fddcc5c18
Change-Id: I93cfa420a1ee8995bb18fbf4d46c56254b4ce55b
Christopher Ferris [Thu, 21 May 2020 21:22:51 +0000 (21:22 +0000)]
Fix deadlock/timeout in thread unwinding. am:
73ca781f43
Change-Id: I3fb995a7cf99bba28c8fc4e6ad43f50db01ca2c7
Christopher Ferris [Wed, 20 May 2020 22:37:30 +0000 (15:37 -0700)]
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
(cherry picked from commit
9bf7817dd29d15ea49c88436db4067d87fc7e6c4)
TreeHugger Robot [Mon, 18 May 2020 17:26:16 +0000 (17:26 +0000)]
Merge "Revert "[GWP-ASan] Don't intercept calloc."" into rvc-d1-dev am:
8749470524
Change-Id: I52349980c528046d513a0fc09c7fc745901930a1
TreeHugger Robot [Mon, 18 May 2020 17:12:06 +0000 (17:12 +0000)]
Merge "Revert "[GWP-ASan] Don't intercept calloc."" into rvc-d1-dev
Mitch Phillips [Mon, 18 May 2020 15:22:48 +0000 (15:22 +0000)]
Revert "[GWP-ASan] Don't intercept calloc."
This reverts commit
76ce32657d0917244845a51af2075cf124015da9.
Bug:
154618758
Change-Id: Ie638560454495bd3d0b26376def9930bde0e33c2
Bram Bonné [Mon, 18 May 2020 09:45:30 +0000 (09:45 +0000)]
Merge "Speed up seccomp with priority list." into rvc-dev am:
53a9db72cc am:
9dd5086d6f
Change-Id: Ic69ca669e8bfdd95e04fae013226f6bda2cb9e26
Bram Bonné [Mon, 18 May 2020 09:34:30 +0000 (09:34 +0000)]
Merge "Speed up seccomp with priority list." into rvc-dev am:
53a9db72cc
Change-Id: I4b779e7f832d456c82f76c9ace23ff2431a9e200
Bram Bonné [Mon, 18 May 2020 09:22:19 +0000 (09:22 +0000)]
Merge "Speed up seccomp with priority list." into rvc-dev
Bram Bonné [Wed, 6 May 2020 11:49:55 +0000 (13:49 +0200)]
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
Jooyung Han [Wed, 13 May 2020 09:14:26 +0000 (09:14 +0000)]
Set min_sdk_version for mainline dependencies am:
01e19d2be8 am:
5dabdece6a
Change-Id: I83c686630a5e3067c5c5a9be6024d396d87ce93d
Jooyung Han [Wed, 13 May 2020 09:02:25 +0000 (09:02 +0000)]
Set min_sdk_version for mainline dependencies am:
01e19d2be8
Change-Id: I70ff03d07223b36d268417057706b88f7e8143ea
Jooyung Han [Thu, 16 Apr 2020 09:26:45 +0000 (18:26 +0900)]
Set min_sdk_version for mainline dependencies
To enforce all modules included in mainline modules(apex/apk),
modules should set min_sdk_version which is the minimum sdk versions
that compiled artifacts run against.
Setting this doesn't change build output.
(While cherry-picking s/29/apex_inherit)
Bug:
145796956
Test: m
Merged-In: Ibbe3771592677d729c81343fe00859c0afa81918
Change-Id: Ibbe3771592677d729c81343fe00859c0afa81918
(cherry picked from commit
15c32a8e1aa0f7754b5b25bb6c160b5d8b8b49c3)
Josh Gao [Tue, 12 May 2020 16:48:02 +0000 (16:48 +0000)]
fdtrack: don't do anything while vforked. am:
7501c6de1a am:
44c738fde5
Change-Id: I2adcc7e7d232431b054b1754b6ff11c8d22b70bb
Josh Gao [Tue, 12 May 2020 16:48:00 +0000 (16:48 +0000)]
fdsan: don't do anything when vforked. am:
1bf410b5f9 am:
41aeeefa3d
Change-Id: Ibec75065b0e423176d4d4f4d9cc7e2a258c3db66
Josh Gao [Tue, 12 May 2020 16:47:59 +0000 (16:47 +0000)]
Track whether a thread is currently vforked. am:
5378351432 am:
5d09f1c9ba
Change-Id: Ie5c4c61af44344de8682f796923fd518876928ec
Josh Gao [Tue, 12 May 2020 16:36:16 +0000 (16:36 +0000)]
fdtrack: don't do anything while vforked. am:
7501c6de1a
Change-Id: I90fbeee6c17a54ac398c3b15b7d997cbd82efa37
Josh Gao [Tue, 12 May 2020 16:36:14 +0000 (16:36 +0000)]
fdsan: don't do anything when vforked. am:
1bf410b5f9
Change-Id: Ibc0c7042c3485d96f4075cd2f5d0ba8021db90b2
Josh Gao [Tue, 12 May 2020 16:36:12 +0000 (16:36 +0000)]
Track whether a thread is currently vforked. am:
5378351432
Change-Id: I70d09823175a35cee7136594061d6c05c66cead9
Josh Gao [Fri, 8 May 2020 02:43:38 +0000 (19:43 -0700)]
fdtrack: don't do anything while vforked.
Bug: http://b/
153926671
Test: 32/64-bit bionic-unit-tests on blueline, x86_64 emulator
Change-Id: If42905f3d6a76ed70a45e5b9edd029ffd7789045
(cherry picked from commit
41291131284471eed7cb6c22cac8b442fd3d1c52)
Josh Gao [Fri, 8 May 2020 02:40:14 +0000 (19:40 -0700)]
fdsan: don't do anything when vforked.
Bug: http://b/
153926671
Test: 32/64-bit bionic-unit-tests on blueline, x86_64 emulator
Change-Id: Id351a993e396774b68239edfef83d9e81205290b
(cherry picked from commit
65fb2a7f0304fda4463771ae40f8b83728e74a62)
Josh Gao [Fri, 8 May 2020 00:02:19 +0000 (17:02 -0700)]
Track whether a thread is currently vforked.
Our various fd debugging facilities get extremely confused by a vforked
process closing file descriptors in preparation to exec: fdsan can
abort, and fdtrack will delete backtraces for any file descriptors that
get closed. Keep track of whether we're in a vforked child in order to
be able to detect this.
Bug: http://b/
153926671
Test: 32/64-bit bionic-unit-tests on blueline, x86_64 emulator
Change-Id: I8a082fd06bfdfef0e2a88dbce350b6f667f7df9f
(cherry picked from commit
230328374018c7ca4e82a47ff4eb91dd2f79a5c3)
Roman Kiryanov [Fri, 8 May 2020 04:02:47 +0000 (04:02 +0000)]
Add goldfish-opengl to use bionic_libc_platform_headers am:
b47eeab232 am:
2a8fc8baee
Change-Id: Ia2ac43a3b7a813cd5b8c3ee24392682d818a3f67
Roman Kiryanov [Fri, 8 May 2020 03:43:28 +0000 (03:43 +0000)]
Add goldfish-opengl to use bionic_libc_platform_headers am:
b47eeab232
Change-Id: I964130895606efe1208a1fd5d129e71182f20fdd
Roman Kiryanov [Thu, 7 May 2020 21:58:30 +0000 (14:58 -0700)]
Add goldfish-opengl to use bionic_libc_platform_headers
We need __get_tls and TLS_SLOT_OPENGL for our
OpenGL implementation. We currently use .mk files
and this restriction does not apply, since we are
migrating to .bp we need to address restriction.
Bug:
154151802
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Merged-In: I007664d919204cd4f6a623f9695a56e94bab7ae6
Change-Id: I6616331b03649eb19ceeb8121d56e55a9270548a
Jiyong Park [Wed, 6 May 2020 12:50:54 +0000 (12:50 +0000)]
Merge "Set apex_available property" into rvc-dev am:
8ee9132285 am:
5537c45052
Change-Id: Iba03c8165cad2c91c4a8c7559c7894e2e146108e
Jiyong Park [Wed, 6 May 2020 12:38:39 +0000 (12:38 +0000)]
Merge "Set apex_available property" into rvc-dev am:
8ee9132285
Change-Id: I60634400078dcf09d89568a5e398d1eabb33a52a
Jiyong Park [Wed, 6 May 2020 12:27:09 +0000 (12:27 +0000)]
Merge "Set apex_available property" into rvc-dev
Yabin Cui [Tue, 5 May 2020 21:04:36 +0000 (21:04 +0000)]
Merge "Fix foritfy test for clang update." into rvc-dev am:
7e486eab1f am:
0bb6c63e17
Change-Id: Id3afd7a64df1683041143196d576cec327e22420
Yabin Cui [Tue, 5 May 2020 20:51:20 +0000 (20:51 +0000)]
Merge "Fix foritfy test for clang update." into rvc-dev am:
7e486eab1f
Change-Id: Ie0d8ce799d911c1a8f3f3367b7a77989f76cbd0c
Yabin Cui [Tue, 5 May 2020 20:36:15 +0000 (20:36 +0000)]
Merge "Fix foritfy test for clang update." into rvc-dev
Alistair Delva [Mon, 4 May 2020 11:59:52 +0000 (11:59 +0000)]
Fix argument order in api level test am:
40a86559c3 am:
2aa06ad824
Change-Id: I28ab8621f1699c422ae415d1b1ae36fd739d2f00
Alistair Delva [Mon, 4 May 2020 11:45:40 +0000 (11:45 +0000)]
Fix argument order in api level test am:
40a86559c3
Change-Id: I3c4e0a48c8f9bef95ab4a1184a94a4a3f07b2e59
Alistair Delva [Mon, 4 May 2020 03:08:26 +0000 (20:08 -0700)]
Fix argument order in api level test
Looks like the arguments were unintentionally swapped?
Bug:
155526611
Change-Id: I39d49f94387cfd337c89becb5eb6f85ca638bef1
Merged-In: I39d49f94387cfd337c89becb5eb6f85ca638bef1
Signed-off-by: Alistair Delva <adelva@google.com>
(cherry picked from commit
bed98c0deb429dca7947d6b0190ff62cc92f2608)
Josh Gao [Thu, 30 Apr 2020 21:13:00 +0000 (21:13 +0000)]
Merge changes I8b25accf,I59013f0c,I6c881e5d,I66826f31,I552692ae, ... into rvc-dev am:
524510bc5c am:
33971718b2
Change-Id: Ie63b7eeb557dd24f26d4d7f79e22da95bf41fab8
Yabin Cui [Thu, 16 Apr 2020 22:07:28 +0000 (15:07 -0700)]
Fix foritfy test for clang update.
When doing checkbuild for make_fortify_compile_test.mk:
bionic/tests/clang_fortify_tests.cpp
error: 'error' diagnostics seen but not expected:
Line 171: 'mempcpy' will always overflow; destination buffer has size 8, but size argument is 9
1 error generated.
Bug:
149839606
Test: run checkbuild.
Change-Id: I97371600f6183b5cee8c2a6b976f5bf33e1f781d
(cherry picked from commit
ae1745d37550de264b600b08c13242513116b8ac)
Josh Gao [Thu, 30 Apr 2020 20:54:26 +0000 (20:54 +0000)]
Merge changes I8b25accf,I59013f0c,I6c881e5d,I66826f31,I552692ae, ... into rvc-dev am:
524510bc5c
Change-Id: I1e58eba89806b18b11682142bb2a8281f797a4a5
Josh Gao [Thu, 30 Apr 2020 20:40:39 +0000 (20:40 +0000)]
Merge changes I8b25accf,I59013f0c,I6c881e5d,I66826f31,I552692ae, ... into rvc-dev
* changes:
fdtrack: add wrapper for socketpair.
fdtrack: add wrapper for eventfd.
fdtrack: add wrappers for epoll_create, epoll_create1.
fdtrack: add wrappers for pipe, pipe2.
fdtrack: add tests for individual wrappers.
fdtrack: don't destroy traces.
Josh Gao [Thu, 30 Apr 2020 00:17:56 +0000 (17:17 -0700)]
fdtrack: add wrapper for socketpair.
Bug: https://issuetracker.google.com/
154450436
Test: bionic-unit-tests
Change-Id: I8b25accf00dc01f6fab351f3ba612f6b0ff9d094
(cherry picked from commit
b107eab5ef1d5946bd753cad0e8b178172d362df)
Josh Gao [Thu, 30 Apr 2020 00:08:46 +0000 (17:08 -0700)]
fdtrack: add wrapper for eventfd.
Bug: https://issuetracker.google.com/
154450436
Test: bionic-unit-tests
Change-Id: I59013f0c4da0debbcc50269c64ae9db0cdc4eaa0
(cherry picked from commit
7de412443dd4201c61d7bb17c443bbf2dfd96bad)
Josh Gao [Thu, 30 Apr 2020 00:06:14 +0000 (17:06 -0700)]
fdtrack: add wrappers for epoll_create, epoll_create1.
Bug: https://issuetracker.google.com/
154450436
Test: bionic-unit-tests
Change-Id: I6c881e5d67596c543526536541d5b8086e21d9e9
(cherry picked from commit
a38331d833fb74607e964b0749427415545018fe)
Josh Gao [Thu, 30 Apr 2020 00:00:13 +0000 (17:00 -0700)]
fdtrack: add wrappers for pipe, pipe2.
Bug: https://issuetracker.google.com/
154450436
Test: bionic-unit-tests
Change-Id: I66826f312a65ab9f1bd8193bf684e330baa952dc
(cherry picked from commit
1fad5283a07e87b3ae28f4a2dd6943d600c2926b)
Josh Gao [Wed, 29 Apr 2020 23:34:37 +0000 (16:34 -0700)]
fdtrack: add tests for individual wrappers.
Add tests for all of our existing wrappers (with one commented out,
because it's unexpectedly generating multiple events).
Bug: https://issuetracker.google.com/
154450436
Test: bionic-unit-tests
Change-Id: I552692aef952237c2eee0dabec61b7ea7fd230e3
(cherry picked from commit
9d512402d4a07053f179bf33d78a9beda1424306)
Josh Gao [Wed, 22 Apr 2020 00:05:32 +0000 (17:05 -0700)]
fdtrack: don't destroy traces.
There's a bad interaction with malloc_debug when the libraries are being
destroyed.
Bug: https://issuetracker.google.com/
154439915
Test: treehugger
Change-Id: Ib47c8139c3a88dd52865ea93654b2926bd708729
(cherry picked from commit
38d00b80a072374792bb159e558195eeb8cbd271)
Jiyong Park [Tue, 28 Apr 2020 09:21:08 +0000 (18:21 +0900)]
Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Bug:
150999716
Test: m
Change-Id: If64eff62b9e93af95089e5010c30eb586673b92e
Elliott Hughes [Fri, 24 Apr 2020 17:36:37 +0000 (17:36 +0000)]
Block all signals in ScopedSignalBlocker. am:
95cebe5b11 am:
a160acd83e
Change-Id: Iebd5fcd7d7ef764397faae842bc031a133ec3122
Elliott Hughes [Fri, 24 Apr 2020 17:27:04 +0000 (17:27 +0000)]
Block all signals in ScopedSignalBlocker. am:
95cebe5b11
Change-Id: Idd5b34792082f672cac6c8396bb7285cf022800a
Elliott Hughes [Thu, 23 Apr 2020 22:53:17 +0000 (15:53 -0700)]
Block all signals in ScopedSignalBlocker.
When a thread calls pthread_exit(3), ScopedSignalBlocker blocks all
user-visible signals, but leaves internal-use signals 33/34/36/36/37.
Signal 33 is used to unwind a thread for a backtrace, which can cause us
to access the stack after it's been unmapped. (Avoiding this was the
reason why we have the ScopedSignalBlocker in pthread_exit(3)!)
Fix this (and other potential issues) by changing ScopedSignalBlocker to
call __rt_sigprocmask(2) directly, so we don't mask out the internal-use
signals.
Bug: https://issuetracker.google.com/
153624226
Test: not trivially reproducible
Change-Id: I9b125ed41ddee4c5d33b45920f1d142e52db47cb
Merged-In: I9b125ed41ddee4c5d33b45920f1d142e52db47cb
Ryan Prichard [Thu, 23 Apr 2020 22:19:58 +0000 (22:19 +0000)]
__loader_cfi_fail: acquire g_dl_mutex am:
76eb84a4f4 am:
73a451c90e
Change-Id: Id02454e7ee0ff606c510a1934559ef7acd513df1
Ryan Prichard [Thu, 23 Apr 2020 22:10:24 +0000 (22:10 +0000)]
__loader_cfi_fail: acquire g_dl_mutex am:
76eb84a4f4
Change-Id: Ie7a1f417a649b705e7dc3397ce523ffa23cf6e41
Ryan Prichard [Tue, 21 Apr 2020 01:01:00 +0000 (18:01 -0700)]
__loader_cfi_fail: acquire g_dl_mutex
CfiFail calls find_containing_library, which searches the linker's
internal soinfo list, which could be modified by another thread.
Bug: http://b/
150372650
Test: bionic-unit-tests
Change-Id: I59024a0a47913caa75702f15ec058b0a360727b5
(cherry picked from commit
172611f5cee5ce1351a83ec9f83e13235d04b008)
Ryan Prichard [Wed, 22 Apr 2020 21:56:06 +0000 (21:56 +0000)]
android_get_exported_namespace: acquire g_dl_mutex am:
771da6f500 am:
50cd19415a
Change-Id: I82d57bdf5a610044da748c00b781280e6ae884cb
Ryan Prichard [Wed, 22 Apr 2020 21:40:29 +0000 (21:40 +0000)]
android_get_exported_namespace: acquire g_dl_mutex am:
771da6f500
Change-Id: Idaf1e452c0c8c6f678eee1091dd1765bc472e037
Mitch Phillips [Wed, 22 Apr 2020 19:00:58 +0000 (19:00 +0000)]
Merge "[GWP-ASan] Don't intercept calloc." into rvc-d1-dev am:
e559445b29
Change-Id: I3fd92d1de284972cb2082c04d86294615a27cef7
Mitch Phillips [Wed, 22 Apr 2020 18:53:23 +0000 (18:53 +0000)]
Merge "[GWP-ASan] Don't intercept calloc." into rvc-d1-dev
Mitch Phillips [Fri, 28 Feb 2020 16:50:51 +0000 (08:50 -0800)]
[GWP-ASan] Don't intercept calloc.
Bug:
154618758
Test: N/A
Change-Id: I84aa3b45e013354b8345085fde95aaeae7a7df58
Ryan Prichard [Tue, 21 Apr 2020 00:59:18 +0000 (17:59 -0700)]
android_get_exported_namespace: acquire g_dl_mutex
android_get_exported_namespace searches g_exported_namespaces, which
isn't modified after process initialization, but it does the search
using a new std::string object, and the linker's malloc/free functions
aren't thread-safe. (They're protected by the same lock (g_dl_mutex) as
the rest of the linker's state.)
Bug: http://b/
150372650
Test: bionic-unit-tests
Change-Id: Iafd12e5ab36ae61f0642aad59939f528d31bda16
(cherry picked from commit
c2a93792fc9799d0c2f07f260f52e533e3bd178e)
Christopher Ferris [Tue, 21 Apr 2020 17:57:23 +0000 (17:57 +0000)]
Merge "Fix possible issue with cfi_basic test." into rvc-dev am:
79cd1b6f80 am:
447735203c
Change-Id: I5304d0f63b1e492e597dfc81fbfaa3c40e3a32f0
Christopher Ferris [Tue, 21 Apr 2020 17:43:24 +0000 (17:43 +0000)]
Merge "Fix possible issue with cfi_basic test." into rvc-dev am:
79cd1b6f80
Change-Id: Idd99269fb2f2ee5bacd7e71591b18f51bba1fd2d
Christopher Ferris [Tue, 21 Apr 2020 17:31:50 +0000 (17:31 +0000)]
Merge "Fix possible issue with cfi_basic test." into rvc-dev
Jiyong Park [Tue, 21 Apr 2020 11:30:08 +0000 (11:30 +0000)]
Merge changes from topic "apex_available" into rvc-dev am:
c27404e7ca am:
a1cf3ed371
Change-Id: Ie1eac882697a5ef8d1feeae4c07003adae1bde53
Jiyong Park [Tue, 21 Apr 2020 11:30:00 +0000 (11:30 +0000)]
Set apex_available property am:
494501040d am:
aaee1363d1
Change-Id: I5bcfcde7b6dabc42d9d580002b0854ce71a2882f
Jiyong Park [Tue, 21 Apr 2020 11:29:53 +0000 (11:29 +0000)]
Set apex_available property am:
8481da400f am:
fea618a64c
Change-Id: I083b477c91f2848c919a3ecf7565d8fa91262ab7
Jiyong Park [Tue, 21 Apr 2020 11:20:47 +0000 (11:20 +0000)]
Merge changes from topic "apex_available" into rvc-dev am:
c27404e7ca
Change-Id: Idd8fbff12727252be52655a9662dbd1942536694
Jiyong Park [Tue, 21 Apr 2020 11:20:39 +0000 (11:20 +0000)]
Set apex_available property am:
494501040d
Change-Id: I3655ae209a82148a45bbbb96443889135cb196ec
Jiyong Park [Tue, 21 Apr 2020 11:20:32 +0000 (11:20 +0000)]
Set apex_available property am:
8481da400f
Change-Id: I4fcf4300d3e6012e3efdecfb4f0cd0c16faa3f96
Jiyong Park [Tue, 21 Apr 2020 03:15:40 +0000 (03:15 +0000)]
Merge changes from topic "apex_available" into rvc-dev
* changes:
libc_header is available to any apex but only visible to certain places
Set apex_available property
Set apex_available property
Christopher Ferris [Wed, 1 Apr 2020 23:59:57 +0000 (16:59 -0700)]
Fix possible issue with cfi_basic test.
It's possible for malloc to return a pointer that is not going to
crash with __cfi_slowpath. It's possible to modify the cfi code
to avoid this problem, but I'm not convinced that this will be any
better at catching problems. So I'm just modifying the test so that
it will eventually allocate a pointer that does not overlap.
This previous version of the test failed on jemalloc svelte config,
but there is nothing that would not result in a failure on scudo
leading to a failure every once in a while.
Bug:
142556796
Bug:
140079007
Test: Ran bionic unit tests with jemalloc and scudo.
Change-Id: Iff45bd950d2eb33ff56dc700a2d739b5b578e090
Merged-In: Iff45bd950d2eb33ff56dc700a2d739b5b578e090
(cherry picked from commit
f322483b3f8a6e05db5c3fc7974601032a03ba0a)
Mitch Phillips [Mon, 20 Apr 2020 23:03:58 +0000 (23:03 +0000)]
Set the top bit for tagged pointers. am:
8dceacc296 am:
1b682fc480
Change-Id: I04004e17add39e318af2ad8de2bc4ac1c95fbea7
Mitch Phillips [Mon, 20 Apr 2020 22:41:54 +0000 (22:41 +0000)]
Set the top bit for tagged pointers. am:
8dceacc296
Change-Id: I1c834a4c6a2e052aebd771a9afc41db5202481c3
Mitch Phillips [Fri, 17 Apr 2020 22:00:37 +0000 (15:00 -0700)]
Set the top bit for tagged pointers.
Some applications may incorrectly assume that a "negative" pointer
indicates error. By setting the top bit in TBI mode, we catch these
cases as well. Although they don't directly indicate incompatibility
with MTE (as MTE uses the 2nd-highest nibble) - this ensures we catch
HWASan errors as well as reserve the bits for future MTE expansion.
Bug:
154272452
Test: Boot flame, device boots successfully.
Change-Id: I94a6821a82ce7ead59e6ca2dd113a5a50ee9e56b
Merged-In: I94a6821a82ce7ead59e6ca2dd113a5a50ee9e56b
Jiyong Park [Mon, 30 Mar 2020 09:36:07 +0000 (18:36 +0900)]
libc_header is available to any apex but only visible to certain places
The header library is used by some libraries, such as libunwind_llvm,
which are automatically added as dependencies when stl is set to
libc++_static. Since such dependencies are not specificy to any APEX,
let's mark the header library be available (can be directly or
indirectly be part of an APEX) to any APEX. At the same time, limit the
visibility of the header library so that its uses are strictly limited
to the certain places that we acknowledge. (the places would be reduced
further when we will be successful in dropping the dependency to
libc_headers.)
Exempt-From-Owner-Approval: cherry-pick from AOSP
Bug:
152668052
Test: m
Merged-In: I85ee900947df2c9ce076e2f3aa3145645da77d2b
(cherry picked from commit
ad9946c09acc4d826ff7e22590441b4e1d421d5c)
Change-Id: I85ee900947df2c9ce076e2f3aa3145645da77d2b
Jiyong Park [Wed, 8 Apr 2020 13:52:06 +0000 (22:52 +0900)]
Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.
Exempt-From-Owner-Approval: cherry-pick from AOSP
Bug:
150999716
Test: m
Merged-In: I6ea7fee2a135298085d3965d3578d9ecd53ee405
(cherry picked from commit
2aa19dcb5944f8bebf976128c01c741c79f7c29f)
Change-Id: I6ea7fee2a135298085d3965d3578d9ecd53ee405
Jiyong Park [Sat, 7 Mar 2020 08:35:02 +0000 (17:35 +0900)]
Set apex_available property
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.
Exempt-From-Owner-Approval: cherry-pick AOSP
Bug:
150999716
Test: m
Merged-In: Id5691b02c107ed7b844a186f0a5effa3cb0fe52a
(cherry picked from commit
922a5c7d75ccda09777c04b1eb063e50df707ecb)
Change-Id: Id5691b02c107ed7b844a186f0a5effa3cb0fe52a
TreeHugger Robot [Fri, 10 Apr 2020 02:17:32 +0000 (02:17 +0000)]
Merge "libfdtrack: When dump fdsan fd owner, happen NE" into rvc-dev am:
ede1fd19e2 am:
8ac6fc167e
Change-Id: Idcf0c239a1a5208ed5ec245b4a770ce2cc5c2229
TreeHugger Robot [Fri, 10 Apr 2020 01:57:52 +0000 (01:57 +0000)]
Merge "libfdtrack: When dump fdsan fd owner, happen NE" into rvc-dev am:
ede1fd19e2
Change-Id: If3c5bcf3c214877f22f83f932ac9b1ec2be3880c