Commit graph

20194 commits

Author SHA1 Message Date
Christopher Ferris
5f41ce25c6 Merge "Update to kernel headers v4.10." 2017-02-27 20:09:54 +00:00
Paul Lawrence
c712aedb0c Merge "Revert "Move seccomp policy to bionic"" 2017-02-27 16:39:12 +00:00
Paul Lawrence
98a53b7c74 Revert "Move seccomp policy to bionic"
This reverts commit 06a32206c5.

Reverting build-breaking change

Change-Id: Ib3698bca8f905033a9c7f22bc2fa9f7e7bf75873
2017-02-27 16:36:18 +00:00
Paul Lawrence
d0ceac6441 Merge "Move seccomp policy to bionic" 2017-02-27 16:09:39 +00:00
Treehugger Robot
78e6c4ec7c Merge "Add tests for <endian.h>." 2017-02-25 03:10:19 +00:00
Treehugger Robot
0b87362f53 Merge "loader: set PT_INTERP to itself" 2017-02-25 02:24:28 +00:00
Treehugger Robot
3246b9d8ae Merge "libc: __system_property_set uses writev to write atomically" 2017-02-25 02:06:19 +00:00
Treehugger Robot
bf04e3c00d Merge "Move __system_property_*_serial back to LIBC" 2017-02-25 02:02:02 +00:00
Dimitry Ivanov
2a6955e040 loader: set PT_INTERP to itself
Some versions of kernel set AT_BASE to 0
if dynamic loader does not have PT_INTERP
set.

Bug: http://b/30739481
Test: run /system/bin/linker64 and /system/bin/linker
Change-Id: I1b67777166fe917d3ee1a97277045ca6f5db0084
2017-02-24 16:56:38 -08:00
Elliott Hughes
ba267f45d6 Add tests for <endian.h>.
Also, for the stuff that's also in <netinet/in.h> as real functions,
check that they're there too (and as functions rather than macros,
since that was historically not true).

Bug: http://b/28432448
Test: ran tests
Change-Id: I7e4ae926f7e02de3b6dd38d1953e5b3b43d44f74
2017-02-24 16:19:53 -08:00
Dimitry Ivanov
b876babd04 Move __system_property_*_serial back to LIBC
Bug: http://b/35764972
Bug: http://b/34114501
Test: make
Change-Id: Ibbda0107d07c432110a0633de03259e39480fde4
2017-02-24 16:11:14 -08:00
Dimitry Ivanov
6391e1a44d libc: __system_property_set uses writev to write atomically
__system_property_set sometimes produces broken_pipe error
when trying to write a property.

This change improves error messages and uses writev() instead
of sequence of send() calls.

Bug: http://b/35381074
Test: bionic-unit-tests --gtest_filter=prop*
Change-Id: I7a5b169c015db4e6b720370e58662de8206d1086
2017-02-24 14:00:04 -08:00
Paul Lawrence
06a32206c5 Move seccomp policy to bionic
Test: Built and checked booted

Change-Id: If777eed75d5280c7a390399261e97125c04767b2
2017-02-24 12:52:19 -08:00
Dimitry Ivanov
5927b04ce7 Merge "Hide internal __system_property_* functions" 2017-02-24 19:11:13 +00:00
Hans Boehm
5d0c1fcc8b Merge "Replace cxa_guard fences with acquire loads" 2017-02-24 18:50:35 +00:00
Elliott Hughes
77463d81e6 Merge "Use <linux/eventpoll.h> to implement <sys/epoll.h>." 2017-02-24 16:55:25 +00:00
Pavel Labath
3678078440 Merge "Silence a compiler warning due to unused variable on mips" 2017-02-24 10:22:41 +00:00
Pavel Labath
fb5a6396dc Silence a compiler warning due to unused variable on mips
oops, I did it again.

Test: lunch mips && cd bionic && mma
Change-Id: I1fe2cb847d0698b34766869f9626398dbcf81960
2017-02-24 10:20:54 +00:00
Pavel Labath
a936199ce0 Merge "Add "imprecise" watchpoint ptrace test" 2017-02-24 09:16:20 +00:00
Pavel Labath
3dad8d5d07 Add "imprecise" watchpoint ptrace test
This tests for the presence of a kernel bug that meant that the kernel
would sometimes fail to report the watchpoint hit if the hardware
reported a address which did not exactly match the address range being
watched (which it is allowed to do per ARM spec if the instruction
accesses a larger block of memory than the region being watched). This
bug was fixed in linux kernel 4.9, and has been backported to older
android kernels.

Bug: 30802222
Bug: 30919905
Test: bionic-unit-tests --gtest_filter="sys_ptrace.*"
Change-Id: I80c35b29eaf28e2dbacb9e8ee5317fdea653fc87
2017-02-24 09:16:06 +00:00
Elliott Hughes
893fd97cdc Use <linux/eventpoll.h> to implement <sys/epoll.h>.
Bug: https://github.com/android-ndk/ndk/issues/302
Test: builds
Change-Id: Ia3074326a128c38f2488e342c028cc030801cfd9
2017-02-23 17:26:24 -08:00
Treehugger Robot
9eba112c3c Merge "Expand whitelist" 2017-02-23 23:54:34 +00:00
Treehugger Robot
46c8a34a95 Merge "versioner: fix darwin build." 2017-02-23 23:51:15 +00:00
Dimitry Ivanov
41a3a6f3cf Hide internal __system_property_* functions
Bug: http://b/34114501
Test: bionic-unit-tests --gtest_filter=prop*
Change-Id: I1fc57b4ced6aaf841aad64e12e7696d25c2e027b
2017-02-23 14:20:13 -08:00
Treehugger Robot
9dbfd8ad7f Merge "Add legacy inlines for more termios stuff." 2017-02-23 22:01:10 +00:00
Josh Gao
b8a3ae4bcb versioner: fix darwin build.
Use struct stat::st_mtime instead of the underlying st_mtim, which is
called something different on Darwin.

Test: mma on linux, darwin
Change-Id: I2695a6c83ebb7d08ec56b1355e0f4bc0993a0acb
2017-02-23 13:52:49 -08:00
Dan Albert
7f24a4f556 Merge "Revert "Run the versioner as part of the build."" 2017-02-23 21:36:49 +00:00
Dan Albert
69c7562f59 Revert "Run the versioner as part of the build."
This reverts commit 45715b2a88.

Reason for revert: Darwin sucks

Change-Id: I004dd7fa5e14a43ffe04ace2f5a06341df61b8cd
2017-02-23 21:30:35 +00:00
Dan Albert
bd15a909b5 Merge "Run the versioner as part of the build." 2017-02-23 21:06:47 +00:00
Paul Lawrence
0b2486a324 Expand whitelist
Bug: 35217603
Test: App no longer triggers seccomp exceptions when launched
Change-Id: I8ea904640a2f14c67a075e593067327407766220
2017-02-23 13:04:39 -08:00
Treehugger Robot
b2a74cda90 Merge "Autogenerate single policy from syscalls and whitelist" 2017-02-23 20:27:45 +00:00
Hans Boehm
963daed780 Replace cxa_guard fences with acquire loads
This seemed to be the only place in bionic where a fence on a
performance-critical path could be easily replaced by a stronger
load/store order constraint. Do so.

On x86 this should generate the same code either way. Based on
microbenchmarks of the relevant ARM instructions, this is currently
performance-neutral in this kind of context. But in the future, the
newly generated acquire loads should give us a performance benefit.

Test: Booted AOSP
Change-Id: I7823e11d6ae4fd58e0425244c293262e2320fd81
2017-02-23 11:50:58 -08:00
Dan Albert
4473e34acb Add legacy inlines for more termios stuff.
Test: make checkbuild # with my versioner-in-build patches
Bug: https://github.com/android-ndk/ndk/issues/302
Change-Id: Ib00b5dadf23592d101486b4f2188285ec03c9e2a
2017-02-23 11:09:32 -08:00
Dan Albert
45715b2a88 Run the versioner as part of the build.
Running this periodically and checking in the results is not working
out, since the result is just that I'm having to spend a lot of time
cleaning up the headers every time I need to update them in the NDK.

Run the versioner as part of the build instead. This way bionic
header changes behave like the rest of the NDK headers and will
affect NDK builds in the platform *immediately*.

Remove the preupload hook for the versioner since it's part of the
normal build now.

The versioner's dependencies directory needs to be moved because
soong won't let us try to do things outside our module's directory
(in this case libc).

Unfortunately this means we need to build the versioner for Darwin,
because we now need it to perform a platform build.

Test: make checkbuild
Bug: None
Change-Id: Icdab8a962354d9e945072dc3f806baea376c8db4
2017-02-23 11:07:04 -08:00
Paul Lawrence
7ea4090c65 Autogenerate single policy from syscalls and whitelist
Bug: 35392119
Bug: 34465958
Test: Check boots and same syscalls are blocked as before

Change-Id: I9efa97032c59aebbbfd32e6f0d2d491f6254f0a2
2017-02-23 10:46:56 -08:00
Dimitry Ivanov
3f76dadf15 Merge "Add test for a greylisted library" 2017-02-23 17:11:19 +00:00
Dimitry Ivanov
1862314dd4 Add test for a greylisted library
Test: bionic-unit-tests --gtest_filter=dlext.ns*
Bug: http://b/35338922
Change-Id: I2f4895cb1ec458c2f565a7e4d06f7a1f6200e7aa
2017-02-23 00:03:42 -08:00
Treehugger Robot
c84e8a507c Merge "Cope with argv[0] being null in the dynamic linker." 2017-02-23 03:29:43 +00:00
Josh Gao
7009f40e52 Merge "Allocate thread local buffers in __init_tls." 2017-02-23 03:24:45 +00:00
Elliott Hughes
30a36273ab Cope with argv[0] being null in the dynamic linker.
Somewhat unsurprisingly, very few commands are happy to be run like this,
in particular multiplexed commands like toybox. But that's no reason for
the linker to get in the way too.

Bug: http://b/33276926
Test: new test
Change-Id: I6dd71ea0183f4da83571039c2198ebb6ed38520e
2017-02-22 17:37:52 -08:00
Josh Gao
5e2285d3cc Allocate thread local buffers in __init_tls.
Thread local buffers were using pthread_setspecific for storage with
lazy initialization. pthread_setspecific shares TLS slots between the
linker and libc.so, so thread local buffers being initialized in a
different order between libc.so and the linker meant that bad things
would happen (manifesting as snprintf not working because the
locale was mangled)

Bug: http://b/20464031
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests
      everything passes
Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests
      thread_local tests are failing both before and after (KUSER_HELPERS?)
Test: /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static
      no additional failures
Change-Id: I9f445a77c6e86979f3fa49c4a5feecf6ec2b0c3f
2017-02-22 16:05:03 -08:00
Treehugger Robot
c9a840ac76 Merge "Add timeout support to __system_property_wait." 2017-02-22 01:43:31 +00:00
Treehugger Robot
2cb4fb033f Merge "Downgrade the special case of pthread_t(0) to a warning." 2017-02-22 00:37:08 +00:00
Christopher Ferris
48af7cb2e2 Update to kernel headers v4.10.
Test: Built angler, booted on angler, ran bionic unit tests.
Change-Id: Ia24511e74106116ea84b44ab724865ec492de8f9
2017-02-21 14:42:34 -08:00
Elliott Hughes
40c885a4d1 Add timeout support to __system_property_wait.
Bug: http://b/35201172
Test: ran tests
Change-Id: I3a78813bf3cd50d1b308ecb3c742f923606c0cc4
2017-02-21 14:36:24 -08:00
Elliott Hughes
6ce686c48b Downgrade the special case of pthread_t(0) to a warning.
So far this is the only issue we've hit in vendor code, and we've hit
it several times already. Rather than try to fix bullhead (the current
problem), let's just admit that the special case of 0 is a lot less
worrying.

Also fix the test expectations to correspond to the new abort message.

Bug: http://b/35455349 (crashes on 0)
Bug: http://b/35622944 (tests)
Test: ran tests
Change-Id: Iec57011fa699a954ebeaec151db2193e36d1ef35
2017-02-21 14:21:43 -08:00
Treehugger Robot
4085423525 Merge "Fix a comment in the pthread_cond_t implementation." 2017-02-19 05:19:56 +00:00
Elliott Hughes
b66a0038ca Fix a comment in the pthread_cond_t implementation.
Bug: http://b/34592766
Test: N/A
Change-Id: I341f837dca52865ae5f8fe9ff50ba8999e297179
2017-02-18 16:35:36 -08:00
Treehugger Robot
bc645ef068 Merge "Fix debug.ld for apps with long names and services" 2017-02-18 00:50:47 +00:00
Treehugger Robot
ff3197bcc2 Merge "Revert "Revert "Make libc.so global""" 2017-02-18 00:18:26 +00:00