Commit graph

34729 commits

Author SHA1 Message Date
Elliott Hughes
fe50a0cbeb Add tests for the untested <wchar.h> functions.
Test: treehugger
Change-Id: Id3d8852fd195a7238d1fdc70cb1a92b921372717
2021-04-09 09:11:23 -07:00
Elliott Hughes
715bef7603 Merge "Use GTEST_SKIP() rather than GTEST_LOG_() when skipping." am: b74ddc301e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1670435

Change-Id: If155fd396fc6c8a9ebc717b82de1db723585aedb
2021-04-09 16:01:45 +00:00
Treehugger Robot
90944019ba Merge "Improve tgamma(3) coverage." am: 3741fca9f3
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1670434

Change-Id: I62cacfd030bcad882e56c4b6406f92ecffef7ce2
2021-04-09 16:01:27 +00:00
Elliott Hughes
b74ddc301e Merge "Use GTEST_SKIP() rather than GTEST_LOG_() when skipping." 2021-04-09 15:22:34 +00:00
Treehugger Robot
3741fca9f3 Merge "Improve tgamma(3) coverage." 2021-04-09 15:22:18 +00:00
Giuliano Procida
13a2d3b2a3 Merge "Deflake time.clock_gettime test" am: 84ccc05258 am: 47a2144628
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1668449

Change-Id: I7e9c9592f5201323740da8e173f0d671583007b5
2021-04-09 12:25:35 +00:00
Giuliano Procida
47a2144628 Merge "Deflake time.clock_gettime test" am: 84ccc05258
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1668449

Change-Id: I49211da5fd17b3b6f24c637ba58173410862edd7
2021-04-09 11:43:20 +00:00
Giuliano Procida
84ccc05258 Merge "Deflake time.clock_gettime test" 2021-04-09 10:58:43 +00:00
Bram Bonné
44ac51cbcf Merge "Revert "Reland: Soft-enable MAC address restrictions with allowlist."" am: f2bb4e6cec am: 97344f834e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1668447

Change-Id: Ie4a868b2f2c2361c19f4e5382e1662aa542482d3
2021-04-09 09:38:26 +00:00
Bram Bonné
97344f834e Merge "Revert "Reland: Soft-enable MAC address restrictions with allowlist."" am: f2bb4e6cec
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1668447

Change-Id: I3ac440bea3d5ff75f07fe687e5ea989d3c877496
2021-04-09 08:52:38 +00:00
Bram Bonné
f2bb4e6cec Merge "Revert "Reland: Soft-enable MAC address restrictions with allowlist."" 2021-04-09 07:56:36 +00:00
Elliott Hughes
14ab353e19 Use GTEST_SKIP() rather than GTEST_LOG_() when skipping.
Test: treehugger
Change-Id: I74dca1882c002a51c9758fe7282b10c4413ecb03
2021-04-08 20:59:50 -07:00
Elliott Hughes
8843066f29 Improve tgamma(3) coverage.
Test: treehugger
Change-Id: I645288d51f8238433335b42befd6a6e8b625a673
2021-04-08 20:59:07 -07:00
Josh Gao
2b2b1b286a Merge "Disable fdtrack post-fork." am: 44ec9c3252 am: 8ac2bda853
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1522024

Change-Id: Ic7adf4f27caef08c13057b5a73ec843f27922dc1
2021-04-09 02:28:53 +00:00
Josh Gao
8ac2bda853 Merge "Disable fdtrack post-fork." am: 44ec9c3252
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1522024

Change-Id: I563fd9bd482b81299a510e787e76503e8c333726
2021-04-09 01:46:11 +00:00
Josh Gao
44ec9c3252 Merge "Disable fdtrack post-fork." 2021-04-09 01:08:52 +00:00
Elliott Hughes
d0bbfa8327 Make res_init() work again.
Change 75830fb836 to fix _nres
initialization to be thread safe accidentally introduced a behavior
change whereby res_init() became a no-op. It also failed to remove all
direct accesses to _nres.

Move the file over to C++ so we can let RAII ensure we're always holding
a lock while using the global state, make all callers access the global
state via this class, and restore the previous behavior of res_init().

Test: atest DnsResolverTest
Bug: 166235340
Change-Id: Ib390a7eac063bc0ff5eeba755e8c74ef1383004e
2021-04-08 12:04:05 -07:00
Giuliano Procida
096f5954e4 Deflake time.clock_gettime test
The test aims to check that the time obtained the VDSO is the "same"
as that obtained via the system call. Unfortunately, time progresses.
Any check involving some fixed tolerance will have some non-zero
probability of failure.

We can instead check that a VDSO time value lies between two system
call times.

Bug: 184819133
Change-Id: Idb9c17b9f612613f6e18a56ee0f256971ddbdf1f
Signed-off-by: Giuliano Procida <gprocida@google.com>
2021-04-08 10:58:57 +01:00
Giuliano Procida
073fd7065a Merge "Use mean CPU time in an attempt to reduce test flakiness" am: 7d06b37270 am: b6b8fd1c65
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1665750

Change-Id: Id360f1cef8ef64101acfbdec6974a7bd4778ad66
2021-04-08 09:47:03 +00:00
Bram Bonné
bca8a4474b Revert "Reland: Soft-enable MAC address restrictions with allowlist."
Revert "Updates CTS tests for MAC address restrictions."

Revert submission 1528409-mac-softrestrict

Reason for revert: App compatibility
Reverted Changes:
I74a50b990:Return anonymized MAC for apps targeting SDK < 30
I8738f7912:Reland: Soft-enable MAC address restrictions with ...
Id13670747:Updates CTS tests for MAC address restrictions.

Change-Id: I64e17cb04acf2862bc657e60694067a456b4f936
2021-04-08 11:39:33 +02:00
Giuliano Procida
b6b8fd1c65 Merge "Use mean CPU time in an attempt to reduce test flakiness" am: 7d06b37270
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1665750

Change-Id: I403bec9c0632e3f81b0310fa67730a75411a38cb
2021-04-08 09:06:44 +00:00
Giuliano Procida
7d06b37270 Merge "Use mean CPU time in an attempt to reduce test flakiness" 2021-04-08 08:32:14 +00:00
Luke Huang
f152c43d06 Merge "Initialize _nres only once" am: 24e0b57429 am: 5ffb5a6882
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1534576

Change-Id: I17ae65cf42eddd4e9f8d22061fd0344a98c51c59
2021-04-08 03:42:59 +00:00
Luke Huang
5ffb5a6882 Merge "Initialize _nres only once" am: 24e0b57429
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1534576

Change-Id: I0137e7cb16b94c2dc7644614eedbcbf2ca0754d1
2021-04-08 03:20:26 +00:00
Luke Huang
24e0b57429 Merge "Initialize _nres only once" 2021-04-08 02:35:46 +00:00
Josh Gao
dcc97c0887 Disable fdtrack post-fork.
Also delete some fdsan code that attempts to check for the post-fork
state, but never will, because we update the cached pid upon fork.

Bug: http://b/174542867
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests
Test: treehugger
Change-Id: I9b748dac9de9b4c741897d93e64d31737e52bf8e
2021-04-07 19:00:45 -07:00
Giuliano Procida
ebc88d26a5 Use mean CPU time in an attempt to reduce test flakiness
The sleep(3) / clock(3) test is sensitive to outliers in the
distribution of CPU consumed by the sleep system call.

This changes the measured quantity to be the mean over 5 samples and
sets the threshold to 10ms.

Bug: 184727758
Change-Id: I20df3b620a5fbf4e58a3ca67306370351ac01d0c
Test: treehugger
Signed-off-by: Giuliano Procida <gprocida@google.com>
2021-04-07 15:14:38 +01:00
Treehugger Robot
16f0b5ba29 Merge "Fix return type of process_madvise()." am: 99d11ebe83 am: ddfde66d65
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1666519

Change-Id: I3f77f2ef95717169f3c96c9a20a2b9c9473022dc
2021-04-07 03:56:43 +00:00
Treehugger Robot
ddfde66d65 Merge "Fix return type of process_madvise()." am: 99d11ebe83
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1666519

Change-Id: I7fc2ad42c5f5fec3612d398c005175f511499099
2021-04-07 03:07:15 +00:00
Treehugger Robot
99d11ebe83 Merge "Fix return type of process_madvise()." 2021-04-07 02:16:26 +00:00
Peter Collingbourne
e9123a9d8e Merge "Reset PAC keys on thread creation instead of on zygote fork." am: 2b9719e361 am: d8b7066e65
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1652994

Change-Id: I4b0f083e8e9116d316c0331656dc769746c8964e
2021-04-07 00:11:34 +00:00
Elliott Hughes
39899f592b Fix return type of process_madvise().
Noticed this from
https://man7.org/linux/man-pages/man2/process_madvise.2.html but
independently confirmed by checking the kernel source.

Also fix the documentation.

Test: treehugger
Change-Id: I6beeeeb2178a58a22a36532e634917b3ae8767ee
2021-04-06 16:38:37 -07:00
Peter Collingbourne
d8b7066e65 Merge "Reset PAC keys on thread creation instead of on zygote fork." am: 2b9719e361
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1652994

Change-Id: I21f9909d64753b2316c39c9ecb8518b1c118fab7
2021-04-06 23:28:06 +00:00
Peter Collingbourne
2b9719e361 Merge "Reset PAC keys on thread creation instead of on zygote fork." 2021-04-06 23:02:29 +00:00
Luke Huang
75830fb836 Initialize _nres only once
Currently, the initialization of _nres is not thread-saferes_mkquery is not thread-safe,
which might cause memory double free problem if caller ran under multithread.

To fix it, only initialize _nres once.
Also remove the redundant code.

Test: atest DnsResolverTest
Bug: 166235340
Change-Id: I9caa6eab37cb530fc60dae9bcca9650973a4536a
2021-04-07 02:05:50 +08:00
Elliott Hughes
56f93fa5c1 Merge "setjmp/longjmp: avoid invalid values in the stack pointer." am: e71143e8c0 am: 0a8e61bcb0
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1663232

Change-Id: I288904abfd061a53411286a212b2ebc1dcdec24a
2021-04-06 17:10:10 +00:00
Elliott Hughes
0a8e61bcb0 Merge "setjmp/longjmp: avoid invalid values in the stack pointer." am: e71143e8c0
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1663232

Change-Id: I199739a9b012a66c7a89add8ef8f68738ebb3676
2021-04-06 16:27:50 +00:00
Elliott Hughes
e71143e8c0 Merge "setjmp/longjmp: avoid invalid values in the stack pointer." 2021-04-06 15:43:23 +00:00
Elliott Hughes
c0d41db92e setjmp/longjmp: avoid invalid values in the stack pointer.
arm64 was already being careful, but x86/x86-64 and 32-bit ARM could be
caught by a signal in a state where the stack pointer was mangled.

For 32-bit ARM I've taken care with the link register too, to avoid
potential issues with unwinding.

Bug: http://b/152210274
Test: treehugger
Change-Id: I1ce285b017a633c732dbe04743368f4cae27af85
2021-04-05 17:43:36 -07:00
Tom Cherry
10a7bd7599 Merge "Match 'Access denied finding property' log severity to SELinux" am: 87a205eefa am: 17d017b676
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1662899

Change-Id: I8cb90f3e0420da91952ba6ab156b9fec6793ce7f
2021-04-02 18:57:30 +00:00
Tom Cherry
17d017b676 Merge "Match 'Access denied finding property' log severity to SELinux" am: 87a205eefa
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1662899

Change-Id: Icc3be003904678482aa487b818071c5c413c0d99
2021-04-02 18:20:54 +00:00
Tom Cherry
87a205eefa Merge "Match 'Access denied finding property' log severity to SELinux" 2021-04-02 16:21:40 +00:00
Tom Cherry
8f11c5f789 Match 'Access denied finding property' log severity to SELinux
This log message exists to provide more context (the property name) to
SELinux denials for the same access check.  The SELinux log severity
is 'W' since SELinux denials do not necessarily point to user-visible
errors, therefore this message should be 'W' as well.

Bug: 181269159
Test: build
Change-Id: Ie25091d96214a175b7ca39d5615f9a09b789d1e3
2021-04-01 16:42:03 -07:00
George Burgess IV
cdd36b3674 Merge "fortify: mark all always_inline functions with no_stack_protector" am: 0ffd09ad0c am: 3a7ea1fb0e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1651694

Change-Id: I3293b270134921d9cdbc3407bd9a7bc7f0b98566
2021-03-30 20:49:57 +00:00
George Burgess IV
3a7ea1fb0e Merge "fortify: mark all always_inline functions with no_stack_protector" am: 0ffd09ad0c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1651694

Change-Id: I34200097c71071e97d618881ab79daf05de9dcdc
2021-03-30 20:08:10 +00:00
George Burgess IV
0ffd09ad0c Merge "fortify: mark all always_inline functions with no_stack_protector" 2021-03-30 19:25:20 +00:00
George Burgess IV
a1112fd880 fortify: mark all always_inline functions with no_stack_protector
FORTIFY'ed functions try to be as close to possible as 'invisible';
having stack protectors detracts from that.

Don't apply this to functions which clang has no chance of inlining
anyway (like variadic functions)

Bug: 182948263
Test: TreeHugger
Change-Id: I08cfec25464b8ea1e070942e3dc76fc84da73dd0
2021-03-29 15:39:50 -07:00
Peter Collingbourne
811d180e89 Reset PAC keys on thread creation instead of on zygote fork.
Resetting PAC keys on fork appears to lead to a number of problems. One
problem is that we are constrained in where we can run C++ code after
forking, and with ART those places are implementation-defined. For
example, in app zygotes, ART turns out to insert "interpreter frames"
in the stack trace. Returning into these interpreter frames may lead
to crashes due to failing the ROP protection check on return.

It seems better to reset keys on thread creation instead. We only need
to reset IA because only this key needs to be reset for reverse-edge
PAC, and resetting the other keys may be incompatible with future ABIs.

Chrome (and potentially other applications) has a sandbox that prevents
the use of the prctl, so we restrict its use to applications targeting
S and above.

Bug: 183024045
Change-Id: I1e6502a7d7df319d424e2b0f653aad9a343ae71b
2021-03-25 14:07:33 -07:00
Jingwen Chen
f7534889a4 Merge "bp2build: remove some bp2build_available props, use package_allowlist instead." am: c551fc7e7a am: ee0e30196b
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1625839

Change-Id: I831173bcc9e9ccf188139a4aae6df80ff2a3289f
2021-03-24 23:10:14 +00:00
Jingwen Chen
ee0e30196b Merge "bp2build: remove some bp2build_available props, use package_allowlist instead." am: c551fc7e7a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1625839

Change-Id: I818652ae41ae7493c549b814cb13fbfb4c46b3b6
2021-03-24 22:33:25 +00:00