Commit graph

7914 commits

Author SHA1 Message Date
Josh Gao
415daa8cca Increase signal stack size on 32-bit to 16kB.
snprintf to a buffer of length PATH_MAX consumes about 7kB of stack.

Bug: http://b/35858739
Test: bionic-unit-tests --gtest_filter="*big_enough*"
Change-Id: I34a7f42c1fd2582ca0d0a9b7e7a5290bc1cc19b1
2017-03-08 16:43:59 -08:00
Joachim Sauer
e429bf2f69 Merge "Update timezone data to 2017a" 2017-03-08 11:53:22 +00:00
Paul Lawrence
34ddaaf256 Expand whitelist
Bug: 35879294
Test: Builds, boots. No easy test for reported issues.
Change-Id: Ib68a36f849a8dab14426600cdc6401fa8bb5b914
2017-03-07 15:23:08 -08:00
Joachim Sauer
da2082d012 Update timezone data to 2017a
IANA changes:

   Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia
   discontinues DST.

   Changes to future time stamps

     Mongolia no longer observes DST.  (Thanks to Ganbold Tsagaankhuu.)

     Chile's Region of Magallanes moves from -04/-03 to -03 year-round.
     Its clocks diverge from America/Santiago starting 2017-05-13 at
     23:00, hiving off a new zone America/Punta_Arenas.  Although the
     Chilean government says this change expires in May 2019, for now
     assume it's permanent.  (Thanks to Juan Correa and Deborah
     Goldsmith.)  This also affects Antarctica/Palmer.

   Changes to past time stamps

     Fix many entries for historical time stamps for Europe/Madrid
     before 1979, to agree with tables compiled by Pere Planesas of the
     National Astronomical Observatory of Spain.  As a side effect,
     this changes some time stamps for Africa/Ceuta before 1929, which
     are probably guesswork anyway.  (Thanks to Steve Allen and
     Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for
     correcting the 1901 transition.)

     Ecuador observed DST from 1992-11-28 to 1993-02-05.
     (Thanks to Alois Treindl.)

     Asia/Atyrau and Asia/Oral were at +03 (not +04) before 1930-06-21.
     (Thanks to Stepan Golosunov.)

   Changes to past and future time zone abbreviations

     Switch to numeric time zone abbreviations for South America, as
     part of the ongoing project of removing invented abbreviations.
     This avoids the need to invent an abbreviation for the new Chilean
     new zone.  Similarly, switch from invented to numeric time zone
     abbreviations for Afghanistan, American Samoa, the Azores,
     Bangladesh, Bhutan, the British Indian Ocean Territory, Brunei,
     Cape Verde, Chatham Is, Christmas I, Cocos (Keeling) Is, Cook Is,
     Dubai, East Timor, Eucla, Fiji, French Polynesia, Greenland,
     Indochina, Iran, Iraq, Kiribati, Lord Howe, Macquarie, Malaysia,
     the Maldives, Marshall Is, Mauritius, Micronesia, Mongolia,
     Myanmar, Nauru, Nepal, New Caledonia, Niue, Norfolk I, Palau,
     Papua New Guinea, the Philippines, Pitcairn, Qatar, Réunion, St
     Pierre & Miquelon, Samoa, Saudi Arabia, Seychelles, Singapore,
     Solomon Is, Tokelau, Tuvalu, Wake, Vanuatu, Wallis & Futuna, and
     Xinjiang; for 20-minute daylight saving time in Ghana before 1943;
     for half-hour daylight saving time in Belize before 1944 and in
     the Dominican Republic before 1975; and for Canary Islands before
     1946, for Guinea-Bissau before 1975, for Iceland before 1969, for
     Indian Summer Time before 1942, for Indonesia before around 1964,
     for Kenya before 1960, for Liberia before 1973, for Madeira before
     1967, for Namibia before 1943, for the Netherlands in 1937-9, for
     Pakistan before 1971, for Western Sahara before 1977, and for
     Zaporozhye in 1880-1924.

     For Alaska time from 1900 through 1967, instead of "CAT" use the
     abbreviation "AST", the abbreviation commonly used at the time
     (Atlantic Standard Time had not been standardized yet).  Use "AWT"
     and "APT" instead of the invented abbreviations "CAWT" and "CAPT".

     Use "CST" and "CDT" instead of invented abbreviations for Macau
     before 1999 and Taiwan before 1938, and use "JST" instead of the
     invented abbreviation "JCST" for Japan and Korea before 1938.

Bug: 35861784
Test: CtsLibcoreTestCases / CtsBionicTestCases
Change-Id: I5e6bbdb93cb57f1b465913ba1b99572140400ef8
2017-03-07 13:49:53 +00:00
Elliott Hughes
cdf19c84e8 Merge "Generate both static and shared libseccomp_policy." 2017-03-04 00:20:13 +00:00
Christopher Ferris
b7e8fe5412 Merge "Refactor the kernel update scripts." 2017-03-03 23:40:12 +00:00
Paul Lawrence
e6daf3f34a Expand whitelist
Bug: 35917228
Test: App now runs fine with setenforce 0
Change-Id: I039385e5d0e5105ec337c62dd098dd1662442a2e
2017-03-03 11:19:08 -08:00
Elliott Hughes
926add1593 Generate both static and shared libseccomp_policy.
Also switch to Android.bp

Bug: N/A
Test: builds
Change-Id: I33697a40b30d071f8d07aa33e1fb2b0c6e8a9f6d
2017-03-02 18:57:44 -08:00
Christopher Ferris
15d3fef0da Refactor the kernel update scripts.
The previous versions of the scripts did a lot of redundant changes
and were hard to follow.

I rewrote most of update_all.py so that it's clear about what's going on.

I updated clean_header.py to change the cleanupFile function so that
there is no magic about where the destination file is going to wind up.
Now the caller specifies the final location.

I updated utils.py so that if you are trying to do an update in one
location, but your lunch target is from another location, it causes
an error.

Bug: 35726570

Change-Id: Ic5a44d90c2774a627eecde34c0c403bc925a497c
Test: Ran the updater and verified it works properly.
Test: Verified that doing an update in one tree to another tree
Test: fails.
2017-03-02 15:21:42 -08:00
Paul Lawrence
5faa3166ce Merge "Expand whitelist" 2017-03-02 18:48:47 +00:00
Paul Lawrence
7b4e7c4d55 Expand whitelist
Bug: 35906875
Test: Device boots, app runs further and fails with different error
Change-Id: I8df40ff85f8248504bca9a048510153970b31716
2017-03-02 18:48:13 +00:00
Victor Khimenko
4a92ffd302 Stop using __system_property_area__
Apparently that "backdoor" is no longer needed - the proper way is
to reinitialize properties:
    https://android-review.googlesource.com/#/c/181794/24/tests/system_properties_test.cpp

Also removes mentions of libnativehelper test (it no longer uses
__system_property_area__) and removes useless "extern" declaration
(actual use was removed long ago).

Test: refactoring CL, existsing tests still pass

BUG=21852512
BUG=34114501

Change-Id: I2223cab2fcb671ea180ad4470a7aba5c9cd20bd8
2017-03-01 20:43:42 +01:00
Dimitry Ivanov
ebceea8e85 Merge "Revert "Revert "Revert "Make libc.so global"""" 2017-03-01 00:39:06 +00:00
Dimitry Ivanov
4021909162 Revert "Revert "Revert "Make libc.so global"""
This reverts commit 2a4d892c7f.

Bug: http://b/35417197
Bug: http://b/35338922
Bug: http://b/35700074
Test: manual
Change-Id: Ib99d23d46664f3efa5be70213aa093b505e38775
2017-02-28 21:05:34 +00:00
Treehugger Robot
d9e52fed2a Merge "Move seccomp policy to bionic" 2017-02-28 15:36:08 +00:00
Treehugger Robot
ca1fda834f Merge "Fix pre-L MB_CUR_MAX." 2017-02-27 22:22:27 +00:00
Paul Lawrence
dfe8434a62 Move seccomp policy to bionic
Test: Built and checked booted
Change-Id: Iaec1265fe5a55c4df90ab9e45b010ef36faf6bba
2017-02-27 12:42:39 -08:00
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
3246b9d8ae Merge "libc: __system_property_set uses writev to write atomically" 2017-02-25 02:06:19 +00: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
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
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
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
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
Dan Albert
5c15b8cf43 Fix pre-L MB_CUR_MAX.
The default locale is POSIX, not C.UTF-8. POSIX explicitly states
that MB_CUR_MAX is 1 for the POSIX locale:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdlib.h.html

Test: Made change in the NDK, built libc++ against it, ran NDK libc++
      tests.
Bug: None

Change-Id: Ic2f6f96aa4a7f20d619030f41323831d01002715
2017-02-21 15:56:37 -08: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
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
ff3197bcc2 Merge "Revert "Revert "Make libc.so global""" 2017-02-18 00:18:26 +00:00
Dimitry Ivanov
2a4d892c7f Revert "Revert "Make libc.so global""
This reverts commit 65236d43e8.

Bug: http://b/35417197
Bug: http://b/35338922
Test: vogar --classpath out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/classes.jack  --mode=device --variant=X32 dalvik.system.JniTest#testGetSuperclass
Change-Id: Ibf3bb7396e7d11ebe95e2f9267d0fc4af3fbe8c5
2017-02-17 22:38:22 +00:00