Commit graph

34404 commits

Author SHA1 Message Date
Christopher Ferris
a2142d2835 Fix last python3 issues.
Includes pointing to the python3 version of the clang bindings.

Also, remove stale .gitignore line.

Test: Ran bionic/libc/kernel/tools/update_all.py and verified
Test: the files generated the same exact way.
Change-Id: I4eb9dd7382bca013f70d921b6ef48c7e7478615a
2021-04-20 17:36:07 -07:00
Christopher Ferris
fae6ff2f9e Merge "Update for python3." 2021-04-20 20:49:48 +00:00
Treehugger Robot
8d36be9bb9 Merge "Ignore backup files left by emacs." 2021-04-20 01:24:49 +00:00
Christopher Ferris
ac7ec11473 Update for python3.
This fixes all of the problems with our kernel scripts, but not
the clang python script problems.

I also removed the updateGitFiles function since that code was
just silently failing any way. I replaced all calls with updateFiles.

Test: Ran script using python2 to verify it still works.
Test: Run script in python3 verifying that it starts to run.

Change-Id: I223a31a8324c59e6bc4067f48a6110361b3e26e8
2021-04-19 17:02:38 -07:00
Dan Albert
77d976cd65 Ignore backup files left by emacs.
Test: Added a file like this locally and the upload hook didn't care
Bug: None
Change-Id: I4c33f2517a9a83c7797d3ea9074fffeedf85dcaa
2021-04-19 14:05:59 -07:00
Treehugger Robot
b82fcdaf36 Merge "Say which API level fdsan/fdtrack appeared at." 2021-04-17 00:22:25 +00:00
Elliott Hughes
977867173a Say which API level fdsan/fdtrack appeared at.
Test: N/A
Change-Id: Id29db9a5ec6a039af95ce3cdd421542ac862f339
2021-04-16 13:57:52 -07:00
Elliott Hughes
508c02fa06 Merge "Force everything to use python3 for consistency." 2021-04-16 20:49:38 +00:00
Elliott Hughes
6b586e7709 Force everything to use python3 for consistency.
Rather than "whatever people have installed as 'python' on their machine".

I've removed check-symbols.py because that's been broken for years and
we never even noticed, and I'm not sure it's worth fixing.

Test: treehugger, manual
Change-Id: Ieb996bbdf790a18d4b1fb46a409cc240ba2a2a49
2021-04-15 13:39:08 -07:00
Treehugger Robot
9cf8871dd9 Merge "Make gensyscalls.py compatible with Python 3." 2021-04-15 17:46:36 +00:00
Rupert Shuttleworth
e99df59d1e Make gensyscalls.py compatible with Python 3.
Test: Fixes bp2build; bazel build //bionic/...
Change-Id: I6ab66e99935b962f1ff99e478c0f55188f31b495
2021-04-15 06:14:48 -04:00
Elliott Hughes
166efcb496 Merge "Make the tests that call readelf(1) less sensitive to whitespace." 2021-04-13 00:25:28 +00:00
Elliott Hughes
ec580d3d07 Make the tests that call readelf(1) less sensitive to whitespace.
Bug: http://b/185168726
Test: treehugger
Change-Id: I13dbbf57c7366966d51b8ea771ec9edd52505e72
2021-04-12 15:56:49 -07:00
Elliott Hughes
27cf254193 Merge "Switch to libbase SilentDeathTest." 2021-04-12 18:39:46 +00:00
Elliott Hughes
f20b021903 Merge "Make res_init() work again." 2021-04-12 17:44:50 +00:00
Elliott Hughes
141b917018 Switch to libbase SilentDeathTest.
Bug: http://b/184955378
Test: treehugger
Change-Id: Ie0849224074da92203340a741a86a24a4a3702c2
2021-04-12 10:01:20 -07:00
Elliott Hughes
2b1930afaa Merge "Add tests for inet_nsap_addr()/inet_nsap_ntoa()." 2021-04-12 16:09:23 +00:00
Peter Collingbourne
16b51e62ea Merge "Fix the adb command to push the memory trace files." 2021-04-10 00:12:33 +00:00
Elliott Hughes
c30a1c08ec Add tests for inet_nsap_addr()/inet_nsap_ntoa().
Turns out that "NSAP" is yet another ISO standard that no-one actually
uses: https://en.wikipedia.org/wiki/NSAP_address

Test: treehugger
Change-Id: I73b4d924a8f4d34e3e2f2da00d0d5529db8e97d1
2021-04-09 16:26:40 -07:00
Peter Collingbourne
7bdca8d16f Fix the adb command to push the memory trace files.
Change-Id: If49d084486486c7899d7655175860f7528aac6ce
2021-04-09 15:11:49 -07:00
Treehugger Robot
999d82e51d Merge "Add tests for the untested <wchar.h> functions." 2021-04-09 17:28:31 +00:00
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
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
84ccc05258 Merge "Deflake time.clock_gettime test" 2021-04-09 10:58:43 +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
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
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
7d06b37270 Merge "Use mean CPU time in an attempt to reduce test flakiness" 2021-04-08 08:32:14 +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
99d11ebe83 Merge "Fix return type of process_madvise()." 2021-04-07 02:16:26 +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
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
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
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
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
c551fc7e7a Merge "bp2build: remove some bp2build_available props, use package_allowlist instead." 2021-03-24 21:38:07 +00:00
Jingwen Chen
c57947860d bp2build: remove some bp2build_available props, use package_allowlist instead.
Test: build/bazel/scripts/milestone-2/demo.sh full

Test: bazel query //bionic/...
Change-Id: I737574766be898279d8bf6f3f0adb43dcc40c220
2021-03-19 02:06:27 -04:00
Christopher Ferris
b40eb10acc Merge "Update kernel update documentation." 2021-03-18 20:01:54 +00:00