Commit graph

21219 commits

Author SHA1 Message Date
Christopher Ferris
07807a10a2 Merge "Add kryo support." 2017-04-04 21:10:55 +00:00
Treehugger Robot
defecea27b Merge "libc: use __bos instead of __bos0 for strchr." 2017-04-04 20:01:38 +00:00
George Burgess IV
bce9a7d518 libc: use __bos instead of __bos0 for strchr.
I dunno why I used __bos0 in the first place; clang's strrchr (and
GCC's strchr+strrchr) both use __bos.

Bug: 34747525
Test: m. Device still boots. cts -m BionicUnitTests shows no new
failures.
Change-Id: Ifec0e05a6a1144fa3e3ac70562af3ec57c09c194
2017-04-04 11:12:18 -07:00
Josh Gao
12021ce9cf Merge "Break android_set_abort_message out of libc_logging."
am: 1c864b630f

Change-Id: I7d8ab343a09a0e2166d0462a3b378257cb837f67
2017-04-04 00:49:24 +00:00
Josh Gao
1c864b630f Merge "Break android_set_abort_message out of libc_logging." 2017-04-04 00:40:40 +00:00
Josh Gao
5ac8755ffe Merge changes I70edafb7,I96cba65e,I5142a335
am: 1400acc159

Change-Id: I8a336aac72ba8fa173ef2ea3364a55d7d84fc4f5
2017-04-03 23:26:49 +00:00
Treehugger Robot
1400acc159 Merge changes I70edafb7,I96cba65e,I5142a335
* changes:
  versioner: remove useless log message.
  versioner: fix indentation in usage.
  versioner: guard preprocessing messages with -v.
2017-04-03 23:17:59 +00:00
Josh Gao
10ec9286ae Break android_set_abort_message out of libc_logging.
libc_logging is getting statically linked into the crash handler
library, resulting in two copies of the abort message code existing in
processes, one in the linker, and one in the crash handler.

Move android_set_abort_message to its own file to solve this.

Bug: http://b/36862204
Test: /data/nativetest/debuggerd_test/debuggerd_test32
Change-Id: Ie198c5a3bb07645aa43296915c9a6752693f14a9
2017-04-03 16:00:10 -07:00
Josh Gao
d89b0f130c Merge changes I826756d9,I00e2edb2
am: 6367f5ee55

Change-Id: I0585784475e8288fc06e5ca1089ff227f87001bd
2017-04-03 20:41:38 +00:00
Josh Gao
6367f5ee55 Merge changes I826756d9,I00e2edb2
* changes:
  libc_logging: mention that they're async signal safe.
  linker: update dependencies.
2017-04-03 20:33:18 +00:00
Josh Gao
acc7921580 versioner: remove useless log message.
Test: tools/versioner/run_tests.py
Change-Id: I70edafb7ad6a6274e7daa508903520dbb4b399c8
2017-04-03 12:41:35 -07:00
Josh Gao
d744a9bcd5 versioner: fix indentation in usage.
Test: versioner -h
Change-Id: I96cba65e53c564c8f47714c74d300e8f3dee7e82
2017-04-03 12:41:35 -07:00
Josh Gao
3fcf747f1d versioner: guard preprocessing messages with -v.
Bug: http://b/36751878
Test: tools/versioner/run_tests.py
Change-Id: I5142a33519b101548ccaec8a3bc498e446a648a7
2017-04-03 12:41:35 -07:00
Christopher Ferris
950a95836d Add kryo support.
Currently, using kryo is the same as using krait, but there are specialized
routines that are pending that will be used after this commit.

Bug: 36728278

Test: Built and booted a sailfish using kryo.
Change-Id: Id7510640673c31f7536367041212db6d96a564f0
2017-04-03 10:30:55 -07:00
Nick Kralevich
1df65daf9a Merge "Cleanup ANDROID_DNS_MODE and BIONIC_DNSCACHE"
am: 4df5ca1e02

Change-Id: I899ca838e59469348cd9bd25296ab9ac8e298291
2017-04-03 17:26:26 +00:00
Treehugger Robot
4df5ca1e02 Merge "Cleanup ANDROID_DNS_MODE and BIONIC_DNSCACHE" 2017-04-03 17:21:54 +00:00
Nick Kralevich
62c03a4ff4 Cleanup ANDROID_DNS_MODE and BIONIC_DNSCACHE
For security reasons, when a binary is executed which causes a security
transition (eg, a setuid binary, setgid binary, filesystem capabilities,
or SELinux domain transition), the AT_SECURE flag is set. This causes
certain blacklisted environment variables to be stripped before the
process is executed. The list of blacklisted environment variables is
stored in UNSAFE_VARIABLE_NAMES. Generally speaking, most environment
variables used internally by libc show up in this list.

Add ANDROID_DNS_MODE to the list of unsafe variables.
Similar to RESOLV_HOST_CONF and RES_OPTIONS (which are already
blacklisted), this variable controls how name resolution requests are
handled. Allowing ANDROID_DNS_MODE to be set across a security
boundary could induce resolution failures or otherwise impact
name resolution.

Remove BIONIC_DNSCACHE. This does not appear to be used, and setting
this variable across a security boundary could cause name resolution
problems.

Test: Android compiles and runs with no obvious problems.
Change-Id: I835a7b42d6afbc9c67866594c7951cfd9b355d81
2017-04-03 08:44:38 -07:00
Dimitry Ivanov
e3f66625e3 Merge "Fix lookup logic for linked namespaces"
am: 6a2c7f5a68

Change-Id: I6af8cccc6ca6a18ced2f4843621563319fdc29f5
2017-04-02 02:20:13 +00:00
Treehugger Robot
6a2c7f5a68 Merge "Fix lookup logic for linked namespaces" 2017-04-02 02:14:47 +00:00
Elliott Hughes
134912df4b Merge "Only use environment variables on the host."
am: 5d8b8310aa

Change-Id: I4439714a733487a76221e789805b50ce958829f4
2017-04-01 07:41:13 +00:00
Treehugger Robot
5d8b8310aa Merge "Only use environment variables on the host." 2017-04-01 07:35:15 +00:00
Elliott Hughes
14eb5abc20 Only use environment variables on the host.
It's faster and safer to skip them on the device, where we know where
everything is anyway.

(cherrypick of cf6365690cc68bdd7e16648fb7881ba0b5cae93d.)

Bug: http://b/36807787
Test: ran tests
Change-Id: I0bb7879cc46f194152c67ddaf072cbebb424f789
2017-03-31 23:23:29 -07:00
Paul Lawrence
5d20373be9 Merge "Expand whitelist"
am: 7cf467bd23

Change-Id: Id4baef4988302e5178d5e7bf850f3e9a028b3162
2017-04-01 00:15:45 +00:00
Treehugger Robot
7cf467bd23 Merge "Expand whitelist" 2017-04-01 00:07:12 +00:00
Vishwath Mohan
ec3cc94eb3 Merge "Refactor sanitized library on-disk layout - bionic."
am: 2a41bf4190

Change-Id: I4f62c79e7f5e93c42e3f168609557e9f48a83a5b
2017-03-31 16:41:24 +00:00
Treehugger Robot
2a41bf4190 Merge "Refactor sanitized library on-disk layout - bionic." 2017-03-31 16:35:53 +00:00
Paul Lawrence
8b7a3559c1 Expand whitelist
Bug: 36726183
Test: Builds, call 90 added to policy

(cherry picked from commit 3ba8223b9a)

Change-Id: Ib8db1b764ce22aadf8050031d40040dd6c0e669e
2017-03-31 16:01:32 +00:00
Neil Fuller
108279e9e5 Addition of a new system file for time zone data
This file is to replace the time_zones_by_country.xml
file from frameworks/base/core/res/res/xml/

This new file is intended to be updated outside of
an OTA, unlike time_zones_by_country.xml.

The tzlookup.xml file is read by code in libcore, not
frameworks/base.

The format of the file is slightly different from
time_zones_by_country.xml but the information is the
same as the current version. It was generated using
a sed transform and manual coallescing of the
<country> elements / comments:

sed 's/<timezones>$/<timezones>\n  <countryzones>/' frameworks/base/core/res/res/xml/time_zones_by_country.xml \
    | sed 's/<\/timezones>/  <\/countryzones>\n<\/timezones>/' \
    | sed 's/<timezone\( code=\"..\">\)/<country\1\n      <id>/g' \
    | sed 's/<\/timezone>/<\/id>\n    <\/country>/g'

The time_zones_by_country.xml file will be deleted
in a follow up change when the new code is wired into
the code that uses this data.

Test: See associated libcore change that will ensure the file
      is kept in sync with tzdata when applying IANA rules
      changes.
Bug: 25338903
Change-Id: I8912307bf6a41750ac06ffce9143e8055ea4e7c5
2017-03-31 15:35:14 +01:00
Vishwath Mohan
4113def4fa Refactor sanitized library on-disk layout - bionic.
This CL changes the linker to point to the newly refactored location
of ASAN-ified libraries on disk.

This supports changes made by the following CLs -
https://android-review.googlesource.com/#/c/359087/
https://android-review.googlesource.com/#/c/359389/

Which refactor the on-disk location as follows:
/data/lib* --> /data/asan/system/lib*
/data/vendor/* --> /data/asan/vendor/*

There are a couple of advantages to this, including better isolation
from other components, and more transparent linker renaming and
SELinux policies.

Bug: 36574794
Bug: 36674745
Test: m -j40 && SANITIZE_TARGET="address" m -j40 and the device
boots. All sanitized libraries are correctly located in /data/asan/*.

Change-Id: Iad8b298a66c38eb0f6327f6b51027f0728aa7a40
2017-03-30 20:07:50 -07:00
Dan Albert
f1cbcfe9aa Merge "Revert "isnan and isinf aren't functions.""
am: 6d225bdf7c

Change-Id: I57dedc84133b553f84a3eea4cd654a3ebe45aba4
2017-03-31 02:32:27 +00:00
Treehugger Robot
6d225bdf7c Merge "Revert "isnan and isinf aren't functions."" 2017-03-31 02:27:14 +00:00
Dan Albert
284c8f1baf Revert "isnan and isinf aren't functions."
While this change is correct, GNU libstdc++ 4.9 isn't able to handle a
standard compliant C library. Its <cmath> will `#undef isnan` from
math.h and only adds the function overloads to the std namespace,
making it impossible to use both <cmath> (which gets included by a
lot of other standard headers) and ::isnan.

We're going to have to revert this until we can start turning down
support for gnustl.

This reverts commit e76ee993ff.

Bug: https://code.google.com/p/android/issues/detail?id=271629
Test: make checkbuild
Change-Id: I394f50271430e78ab801d85c3ee4e87019eda6af
2017-03-30 17:18:31 -07:00
Josh Gao
bcf3b3d868 Merge "Add more ptrace process resumption tests."
am: ccec0f4c11

Change-Id: Ia951508d38a146fb879e3a7aa34e3b1bc4d6169f
2017-03-30 01:40:54 +00:00
Josh Gao
ccec0f4c11 Merge "Add more ptrace process resumption tests." 2017-03-30 01:33:58 +00:00
Elliott Hughes
5b35e2b9c2 Merge "Fix x86 system calls made from ELF preinit."
am: 12a07044db

Change-Id: I6377f5bcc5edfc725c923b596490aa74e55ea224
2017-03-29 23:14:56 +00:00
Elliott Hughes
12a07044db Merge "Fix x86 system calls made from ELF preinit." 2017-03-29 23:08:18 +00:00
Dimitry Ivanov
d3e7d08845 Fix lookup logic for linked namespaces
When looking for already loaded libraries include
linked namespaces to the search, but check if
the library is accessible from the main namespace.

Bug: http://b/36008422
Bug: http://b/35417197
Bug: http://b/34052337
Bug: http://b/36660652
Bug: https://issuetracker.google.com/36636090
Test: run bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: Ic7c1d48114da3ca5dc6512ef03f595dd17b6ed17
2017-03-29 15:36:40 -07:00
Josh Gao
bc055cae45 Add more ptrace process resumption tests.
Add tests to verify that ptrace unlink happens immediately for unreaped
processes.

Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests --gtest_filter="Ptrace*"
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter="Ptrace*"
Change-Id: I9803ee5be2a0686c21556598ecf17348df09f601
2017-03-29 15:02:18 -07:00
Elliott Hughes
eb04ed506f Fix x86 system calls made from ELF preinit.
Used by CFI, so broke cfi_test#early_init@x86, but I've added a specific
test for this (and a similar test for getauxval from preinit, which this
patch does not fix).

Bug: http://b/35885875
Test: ran tests
Change-Id: I43885bedfb88c0a26b4474bd3c27a87dec7bbc97
2017-03-29 13:48:02 -07:00
Dan Albert
028a29faee Merge changes from topic 'no-bionic-prebuilts'
am: aa0b5054c5

Change-Id: I3a9d7e295163da53babfe5d539d04166eed3224a
2017-03-29 18:05:14 +00:00
Treehugger Robot
aa0b5054c5 Merge changes from topic 'no-bionic-prebuilts'
* changes:
  Build the versioner even on unbundled branches.
  Revert "Revert "Run the versioner as part of the build.""
2017-03-29 17:59:27 +00:00
Dimitry Ivanov
79c33a1b5b Merge "linker: log only real dlerrors"
am: df3b922fcf

Change-Id: I4608d63d8be71adaad664fbe685d0ec51ec19a27
2017-03-28 20:48:35 +00:00
Dimitry Ivanov
df3b922fcf Merge "linker: log only real dlerrors" 2017-03-28 20:40:45 +00:00
Dimitry Ivanov
11968b80af linker: log only real dlerrors
Currently linker reports all potential dlerrors
for example if library was not found in 'this'
namespace - it initializes linker error buffer
with not found message but when consequent
search in linked namespace succeeds this message
is droped because dlopen was successful.

This commit avoids logging false positive error
messages when debug.ld.* set to dlerror.

Test: manual
Change-Id: I480694a1b1bbacd6bd1d8505cd2ee491710964cc
2017-03-28 11:15:47 -07:00
Paul Lawrence
448e702fd3 Merge "Expose seccomp table"
am: 4b43140142

Change-Id: If4a0e4194e2b15bd2ce3bdc81c078074e462b1f9
2017-03-28 01:58:29 +00:00
Treehugger Robot
4b43140142 Merge "Expose seccomp table" 2017-03-28 01:54:13 +00:00
Christopher Ferris
08bfbd18f8 Merge "bionic: arm64: generic: strcmp: align to 64B cache line"
am: f785a6cbff

Change-Id: I3b5b76a6c9a0881c9f82012161254dbd480d062b
2017-03-28 01:34:28 +00:00
Christopher Ferris
f785a6cbff Merge "bionic: arm64: generic: strcmp: align to 64B cache line" 2017-03-28 01:27:18 +00:00
Dimitry Ivanov
e16a6463d9 Merge "Make anonymous namespace isoalted."
am: 6b0f17e588

Change-Id: Ibecb1efa6b81242ffc1ffc6d5f60a13785fc8578
2017-03-28 01:09:57 +00:00
Dimitry Ivanov
6b0f17e588 Merge "Make anonymous namespace isoalted." 2017-03-28 00:59:09 +00:00