OSDN Git Service

android-x86/bionic.git
7 years agoMove mallopt to correct section.
Christopher Ferris [Wed, 31 May 2017 18:00:18 +0000 (11:00 -0700)]
Move mallopt to correct section.

Bug: 62202823

Test: Built and built unit tests.
(cherry picked from commit 488eb8b7d2fb7a51c90664ae0baea75b7280cddd)

Change-Id: Iae82f77ed84a42f3859d861b533fd7945e2d40d9

7 years agoMerge "linker: disable ld.config.txt in ASAN mode" into oc-dev
TreeHugger Robot [Sat, 27 May 2017 01:45:31 +0000 (01:45 +0000)]
Merge "linker: disable ld.config.txt in ASAN mode" into oc-dev

7 years agolinker: disable ld.config.txt in ASAN mode
Jiyong Park [Fri, 26 May 2017 06:14:52 +0000 (15:14 +0900)]
linker: disable ld.config.txt in ASAN mode

Currently, multiple namespaces does not support ASAN mode where some
symbols should be intercepted via LD_PRELOAD; LD_PRELOADed libs are not
preloaded into the linked namespaces other than the default namespace.
Until we fix the problem, we temporarily disable ld.config.txt in ASAN
mode.

Bug: 38114603
Test: 1. ./external/compiler-rt/lib/asan/scripts/asan_device_setup --lib
prebuilts/clang/host/linux-x86/clang-stable/lib64/clang/3.8/lib/linux
2. enable talkback shortcut
3. in the home screen, hold vol-up/down together
4. device does not reboots and talkback shortcut is toggled
Test: bionic-unit-tests and linker-unit-tests successful

Change-Id: I091874dd36b36f56dff2ad899d76ff86931909ed

7 years agoExpand whitelist
Paul Lawrence [Thu, 25 May 2017 21:15:23 +0000 (14:15 -0700)]
Expand whitelist

Bug: 37769298
Test: Boots. Cannot test app behavior without account
Change-Id: Iebb7616f100368bf2e702ec51f637df1f3727885

7 years agoFix missing function export.
Christopher Ferris [Fri, 19 May 2017 20:47:16 +0000 (13:47 -0700)]
Fix missing function export.

Bug: 36401135

Test: Actually enable debug malloc and verify it loads properly.
Test: Ran unit tests.
(cherry picked from commit 2b0f2a48557ab2dd1171aa3ae79359ba44143a01)

Change-Id: I1e349554a8420fb763bf25ccebcb55d84a19eb0e

7 years agoAdd support for modifying decay timer.
Christopher Ferris [Mon, 15 May 2017 22:50:19 +0000 (15:50 -0700)]
Add support for modifying decay timer.

Add the mallopt function, and only a single option so far.

Bug: 36401135

Test: Built and booted bullhead.
Test: Ran jemalloc unit tests.
Test: Ran bionic unit tests.
Test: Ran a test that allocated and free'd a large piece of memory,
Test: and verified that after changing the parameter, the PSS
Test: sticks around (decay timer set to 1), the PSS is purged (decay
Test: timer set to 0).
(cherry picked from commit a1c0d2fd4ce96e123c4ae6506c9d637d747e1fe2)

Change-Id: Ie8125dc3a5615a859efb66dc91a6feeb0d57b478

7 years agoMerge "libc: ARM64: fix memset for non-standard ZVA sizes" into oc-dev
Christopher Ferris [Fri, 19 May 2017 19:25:23 +0000 (19:25 +0000)]
Merge "libc: ARM64: fix memset for non-standard ZVA sizes" into oc-dev

7 years agoMerge "properties: do not fail in the absence of vendor properties" into oc-dev
TreeHugger Robot [Thu, 18 May 2017 18:50:28 +0000 (18:50 +0000)]
Merge "properties: do not fail in the absence of vendor properties" into oc-dev

7 years agoMerge "Revert "linker: remove link from external library on unload"" into oc-dev
Dimitry Ivanov [Thu, 18 May 2017 16:22:20 +0000 (16:22 +0000)]
Merge "Revert "linker: remove link from external library on unload"" into oc-dev

7 years agoRevert "linker: remove link from external library on unload"
Dimitry Ivanov [Wed, 17 May 2017 18:46:54 +0000 (11:46 -0700)]
Revert "linker: remove link from external library on unload"

This reverts commit b37d10cc8017c102530c096537890b7c6215ad2b.

Was merged from nyc-dev to master and oc-dev by mistake.

Bug: http://b/38384727
Test: bionic-unit-tests
Change-Id: I7cd352baceb3180342abb6ffec1dfa96a217961f

7 years agoproperties: do not fail in the absence of vendor properties
Sandeep Patil [Wed, 17 May 2017 18:33:37 +0000 (11:33 -0700)]
properties: do not fail in the absence of vendor properties

/vendor is not mounted in recovery and so the property initialization
must not fail if the vendor property context is not found.

Bug: 38212419
Test: boot into recovery, mount system and run adb shell getprop

Change-Id: I9f7c2fe2b20da86194eff8e7bf94b2352e50bf27
Signed-off-by: Sandeep Patil <sspatil@google.com>
7 years agoCompare Pss of tested library in VerifyMemorySaving
Zhenhua WANG [Tue, 25 Apr 2017 03:07:19 +0000 (11:07 +0800)]
Compare Pss of tested library in VerifyMemorySaving

DlExtRelroSharingTest.VerifyMemorySaving verifies whether
android_dlopen_ext(ANDROID_DLEXT_USE_RELRO) really saves memory.

This patch compares Pss of the tested library rather than total
Pss of the process, in case different behavior of dlopen() and
android_dlopen_ext() introduces random Pss usage.

Test: DlExtRelroSharingTest.VerifyMemorySaving

(cherry picked from commit 81aad0058cd0961dfd9f3006dd979c1fdd6ca659)

Bug: https://issuetracker.google.com/38226388
Change-Id: I4248628fa951b38818fe2af363fdf78abf09a112

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev am: 8dee813d...
Dimitry Ivanov [Tue, 16 May 2017 23:19:52 +0000 (23:19 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa am: 15db978797 am: 91779f4867 am: 5f7fb9c5c3  -s ours am: 8ac6cf6206  -s ours am: 7c7e2e9289  -s ours am: 35c675c622  -s ours am: c469356635  -s ours
am: c5a7a52110  -s ours

Change-Id: Idbf0bb590a4d77c0102bf90a9f24b158483f0e38

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev am: 8dee813d...
Dimitry Ivanov [Tue, 16 May 2017 23:17:53 +0000 (23:17 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa am: 15db978797 am: 91779f4867 am: 5f7fb9c5c3  -s ours am: 8ac6cf6206  -s ours am: 7c7e2e9289  -s ours am: 35c675c622  -s ours
am: c469356635  -s ours

Change-Id: I14cbcf1e8fed51b19e95be5935263f911a8dc67a

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev am: 8dee813d...
Dimitry Ivanov [Tue, 16 May 2017 23:16:22 +0000 (23:16 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa am: 15db978797 am: 91779f4867 am: 5f7fb9c5c3  -s ours am: 8ac6cf6206  -s ours am: 7c7e2e9289  -s ours
am: 35c675c622  -s ours

Change-Id: Ia43552011fb6d84bf0925f424d6537451a7fa8fe

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev am: 8dee813d...
Dimitry Ivanov [Tue, 16 May 2017 23:14:51 +0000 (23:14 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa am: 15db978797 am: 91779f4867 am: 5f7fb9c5c3  -s ours am: 8ac6cf6206  -s ours
am: 7c7e2e9289  -s ours

Change-Id: Ibba224f7f39097b813b2103eec989763feb2a39a

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev am: 8dee813d...
Dimitry Ivanov [Tue, 16 May 2017 23:12:51 +0000 (23:12 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa am: 15db978797 am: 91779f4867 am: 5f7fb9c5c3  -s ours
am: 8ac6cf6206  -s ours

Change-Id: If6f918223a4470142673bbd76ab0c541af5e12ed

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev am: 8dee813d...
Dimitry Ivanov [Tue, 16 May 2017 23:11:20 +0000 (23:11 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa am: 15db978797 am: 91779f4867
am: 5f7fb9c5c3  -s ours

Change-Id: I227e5d3ce904f8f1f15fe33366bf5736a6dbc8e2

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev am: 8dee813d...
Dimitry Ivanov [Tue, 16 May 2017 23:09:50 +0000 (23:09 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa am: 15db978797
am: 91779f4867

Change-Id: Ifef3f85a01f7deaf7a17c2c562304d3af1361705

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa
Dimitry Ivanov [Tue, 16 May 2017 23:08:20 +0000 (23:08 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa
am: 15db978797

Change-Id: I7998e10917cad017c6a8684c6439c19c149c5928

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev
Dimitry Ivanov [Tue, 16 May 2017 23:06:24 +0000 (23:06 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev
am: 8dee813dfa

Change-Id: Idb826e7c818f12c21bd50a082c8252a996b2bdde

7 years agoMerge "linker: remove link from external library on unload" into mnc-dev
Dimitry Ivanov [Tue, 16 May 2017 23:00:14 +0000 (23:00 +0000)]
Merge "linker: remove link from external library on unload" into mnc-dev

7 years agolinker: remove link from external library on unload am: b37d10cc80 am: 3a644889b2...
Dimitry Ivanov [Tue, 16 May 2017 22:21:23 +0000 (22:21 +0000)]
linker: remove link from external library on unload am: b37d10cc80 am: 3a644889b2 am: cb40eec87c am: 0399816edb
am: 85efd3b591

Change-Id: I115a7adb07feedf81064c0e740cfc617263eb689

7 years agolinker: remove link from external library on unload am: b37d10cc80 am: 3a644889b2...
Dimitry Ivanov [Tue, 16 May 2017 22:17:52 +0000 (22:17 +0000)]
linker: remove link from external library on unload am: b37d10cc80 am: 3a644889b2 am: cb40eec87c
am: 0399816edb

Change-Id: Ic7c3a9f3dc52cca6edf3933b33b04e6a82e77aca

7 years agolinker: remove link from external library on unload am: b37d10cc80 am: 3a644889b2
Dimitry Ivanov [Tue, 16 May 2017 22:15:22 +0000 (22:15 +0000)]
linker: remove link from external library on unload am: b37d10cc80 am: 3a644889b2
am: cb40eec87c

Change-Id: Id0d4a58612a9be52a1f1a0f976bbeeab89547c09

7 years agolinker: remove link from external library on unload am: b37d10cc80
Dimitry Ivanov [Tue, 16 May 2017 22:12:22 +0000 (22:12 +0000)]
linker: remove link from external library on unload am: b37d10cc80
am: 3a644889b2

Change-Id: I7c022194739391c24a736a3a5deb906433fc5649

7 years agolinker: remove link from external library on unload
Dimitry Ivanov [Tue, 16 May 2017 22:08:52 +0000 (22:08 +0000)]
linker: remove link from external library on unload
am: b37d10cc80

Change-Id: I48901a8fbf4bc25fff1462e6086fc23b76ca2ba3

7 years agolinker: remove link from external library on unload
Dimitry Ivanov [Wed, 19 Apr 2017 18:28:16 +0000 (11:28 -0700)]
linker: remove link from external library on unload

When unloading library make sure the soinfo_link to parent
from linked external libraries is removed as well.

Bug: 36104177
Bug: http://b/37433850
Test: manual
Merged-In: I601b54144acecac54744805b38313c46045c54cb
Change-Id: I601b54144acecac54744805b38313c46045c54cb

7 years agolibc: ARM64: fix memset for non-standard ZVA sizes
Kevin Brodsky [Tue, 16 May 2017 10:29:49 +0000 (11:29 +0100)]
libc: ARM64: fix memset for non-standard ZVA sizes

372f19e9e27c ("libc: ARM64: update memset/strlen/memcpy/memmove to
newlib/cortex-strings") introduced a bug in memset, only occurring
on the [set_long + zero + non-standard ZVA size] path, more
specifically when DCZID_EL0 reports a size different to 64 or 128.

On platforms with such sizes reported by DCZID_EL0, various string*
unit tests fail due to memset zeroing memory before and/or after the
area it is supposed to set.

Bug: 38342450

Test: bionic-unit-tests --gtest_filter=string*
Change-Id: Idb80c0269226e40e343645a58608e3f324378468
(cherry picked from commit f19eeb8446de27e6b43c77642b03729e10facb2c)

7 years agolinker: remove link from external library on unload
Dimitry Ivanov [Wed, 19 Apr 2017 18:28:16 +0000 (11:28 -0700)]
linker: remove link from external library on unload

When unloading library make sure the soinfo_link to parent
from linked external libraries is removed as well.

Bug: 36104177
Bug: http://b/37433850
Test: manual
Change-Id: I601b54144acecac54744805b38313c46045c54cb
(cherry picked from commit ee398f820700de30941fd82e38bd917e1513cbc6)

7 years agotest: check unbounded memory leak in pthread detach
Zhenhua WANG [Fri, 12 May 2017 05:53:51 +0000 (13:53 +0800)]
test: check unbounded memory leak in pthread detach

In pthread_leak.detach test, compare the memory usage after two same
scenarios - all children threads have exited. Thus, test emulated by
NativeBridge, which may reserve a memory pool, will pass if it's not
unbounded leak.

Bug: https://issuetracker.google.com/37920774
Test: CtsBionicTestCases

(cherry picked from commit cf17b487ef60aa00ff9b6873cfed50ebde7864c4)

Change-Id: Ib47b26975489b397783e29d65f67fe775b060589

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 18:05:41 +0000 (18:05 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff am: 623d83754a am: 254aec13d0 am: c65740f4a5 am: 59abd613d4 am: 2514cb784d am: f3537c61bf am: be8327ce71 am: 6be47949d6 am: 4852206c8b
am: 24642c2808

Change-Id: I4fc1c7a92f06a60880b9496564bfaac8d6fe7365

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3...
Dimitry Ivanov [Sun, 14 May 2017 18:05:26 +0000 (18:05 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3  -s ours am: dfb42b364d am: de4e1ef729 am: 62110f9538 am: cb3e51d006 am: b2792c701f am: 7ac2da9266 am: f62dc07af3 am: ca97abb2fb
am: 901c064d4d

Change-Id: If20d2edb9f544cb4d55a78a9c278c4dc01842b22

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 18:02:38 +0000 (18:02 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff am: 623d83754a am: 254aec13d0 am: c65740f4a5 am: 59abd613d4 am: 2514cb784d am: f3537c61bf am: be8327ce71 am: 6be47949d6
am: 4852206c8b

Change-Id: I2ffa928ec3f42c062a8dd8ed71ef74ba2012a754

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3...
Dimitry Ivanov [Sun, 14 May 2017 18:02:24 +0000 (18:02 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3  -s ours am: dfb42b364d am: de4e1ef729 am: 62110f9538 am: cb3e51d006 am: b2792c701f am: 7ac2da9266 am: f62dc07af3
am: ca97abb2fb

Change-Id: I1c41aa814ae28c24f2bff84473a4f49508c4541a

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 18:00:07 +0000 (18:00 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff am: 623d83754a am: 254aec13d0 am: c65740f4a5 am: 59abd613d4 am: 2514cb784d am: f3537c61bf am: be8327ce71
am: 6be47949d6

Change-Id: I3f2e5fd302dda1d0ce018cd7074bfd2c1b8727b0

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3...
Dimitry Ivanov [Sun, 14 May 2017 17:59:54 +0000 (17:59 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3  -s ours am: dfb42b364d am: de4e1ef729 am: 62110f9538 am: cb3e51d006 am: b2792c701f am: 7ac2da9266
am: f62dc07af3

Change-Id: If6103a556f58227bc38ea0c19f7e8f7c76b481cd

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 17:57:36 +0000 (17:57 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff am: 623d83754a am: 254aec13d0 am: c65740f4a5 am: 59abd613d4 am: 2514cb784d am: f3537c61bf
am: be8327ce71

Change-Id: Icd38c97287d0f2215bc4677f7c4f971badd9b6fa

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3...
Dimitry Ivanov [Sun, 14 May 2017 17:57:23 +0000 (17:57 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3  -s ours am: dfb42b364d am: de4e1ef729 am: 62110f9538 am: cb3e51d006 am: b2792c701f
am: 7ac2da9266

Change-Id: I00d7ea4507586ceb236e21d78c4da8be380fbf78

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 17:54:35 +0000 (17:54 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff am: 623d83754a am: 254aec13d0 am: c65740f4a5 am: 59abd613d4 am: 2514cb784d
am: f3537c61bf

Change-Id: Ib97ef3be452422f32390457047d64b17c02ac9e0

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3...
Dimitry Ivanov [Sun, 14 May 2017 17:54:23 +0000 (17:54 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3  -s ours am: dfb42b364d am: de4e1ef729 am: 62110f9538 am: cb3e51d006
am: b2792c701f

Change-Id: Id90e8ed17cdd2804d6f6534cfbbb70e1892be0cd

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 17:52:14 +0000 (17:52 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff am: 623d83754a am: 254aec13d0 am: c65740f4a5 am: 59abd613d4
am: 2514cb784d

Change-Id: I333d717351fb970e651260a7ec88d17bc9a1c014

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3...
Dimitry Ivanov [Sun, 14 May 2017 17:51:54 +0000 (17:51 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3  -s ours am: dfb42b364d am: de4e1ef729 am: 62110f9538
am: cb3e51d006

Change-Id: I17db0fafc84cda99bb401efcca497342b9ad4d9a

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 17:49:34 +0000 (17:49 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff am: 623d83754a am: 254aec13d0 am: c65740f4a5
am: 59abd613d4

Change-Id: I1f1fd31090a9a2bc2d3c1472558d2b2dc2993c40

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3...
Dimitry Ivanov [Sun, 14 May 2017 17:49:23 +0000 (17:49 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3  -s ours am: dfb42b364d am: de4e1ef729
am: 62110f9538

Change-Id: I93471ac1d92f3e0908744e1c648df1b367d62e7f

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 17:46:34 +0000 (17:46 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff am: 623d83754a am: 254aec13d0
am: c65740f4a5

Change-Id: I59cea9af44bfa75e1a9f7f4c780396f2d3f606db

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3...
Dimitry Ivanov [Sun, 14 May 2017 17:46:23 +0000 (17:46 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3  -s ours am: dfb42b364d
am: de4e1ef729

Change-Id: If332d0da191a7e1671fffe2e4ee1f02dd3bb5845

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 17:44:04 +0000 (17:44 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff am: 623d83754a
am: 254aec13d0

Change-Id: I3bf9d4ddda2fecb0a1e18b9f7600585118555121

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3...
Dimitry Ivanov [Sun, 14 May 2017 17:43:52 +0000 (17:43 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4 am: 78b10daab3  -s ours
am: dfb42b364d

Change-Id: I000de0ab7f28fab41b846ff8837669e97d048e26

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours am...
Dimitry Ivanov [Sun, 14 May 2017 17:41:34 +0000 (17:41 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours am: 02b94ea8ff
am: 623d83754a

Change-Id: Ieff24664f41ed85ddb65af28a0f44bdbfb76bee2

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4
Dimitry Ivanov [Sun, 14 May 2017 17:41:22 +0000 (17:41 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 772db5e6d4
am: 78b10daab3  -s ours

Change-Id: I6ce0ea6a941043e1271d3a02a1f8dc706716e6c9

7 years agoloader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e -s ours
Dimitry Ivanov [Sun, 14 May 2017 17:33:31 +0000 (17:33 +0000)]
loader: fix leak of child-to-parent links on dlclose() am: 46c3aa2c0e  -s ours
am: 02b94ea8ff

Change-Id: I0b49c8b7b3d3557f98815e29cd902c29a029a02e

7 years agoloader: fix leak of child-to-parent links on dlclose()
Dimitry Ivanov [Sun, 14 May 2017 17:33:21 +0000 (17:33 +0000)]
loader: fix leak of child-to-parent links on dlclose()
am: 772db5e6d4

Change-Id: I538995372384103dcbd1ca6f3ff5fcd4ae80c972

7 years agoloader: fix leak of child-to-parent links on dlclose()
Dimitry Ivanov [Sun, 14 May 2017 17:30:22 +0000 (17:30 +0000)]
loader: fix leak of child-to-parent links on dlclose()
am: 46c3aa2c0e  -s ours

Change-Id: I41138d893d74f59fc0e888c444e314523a8e7a49

7 years agoMake raise/abort work with stale cached pid/tid values.
Josh Gao [Fri, 5 May 2017 20:27:15 +0000 (13:27 -0700)]
Make raise/abort work with stale cached pid/tid values.

Switch raise to using tgkill with direct syscalls of getpid/gettid,
and switch abort to use raise(SIGABRT).

Bug: http://b/37769298
Test: debuggerd_test
Change-Id: If6f9d17fd8ae6177e742dc9f2f44bd78539431ba
(cherry picked from commit bf2af69fb2ff1365f4075d0207d6a895bc2727ed)

7 years agogreylist is no longer enabled by default.
Jiyong Park [Fri, 5 May 2017 13:07:05 +0000 (22:07 +0900)]
greylist is no longer enabled by default.

greylist is needed only for application namepaces. Since we started using
linker-namesapces for vendors and other platform apps linker should not
enable greylist workaround by default.

Bug: http://b/37731053
Bug: https://issuetracker.google.com/38146125
Test: sailfish builds and boots
Test: bionic-unit-tests and linker-unit-tests pass
Change-Id: Iee83db6fb1ae754f5ade18491321d9bca3b5ead4

7 years agoFix pthread_barrier_smoke test (part 2).
Yabin Cui [Tue, 2 May 2017 23:18:13 +0000 (16:18 -0700)]
Fix pthread_barrier_smoke test (part 2).

Bug:http://b/37652807
Test: run bionic-unit-tests.
Change-Id: Iaea553177956c5d08f754210273637f69d888c20
(cherry picked from commit ab4cddc32934678d836483a49992f053347a320d)

7 years agoFix pthread_barrier_smoke test.
Yabin Cui [Tue, 2 May 2017 19:57:39 +0000 (12:57 -0700)]
Fix pthread_barrier_smoke test.

Bug: http://b/37652807
Test: run bionic-unit-tests.
Change-Id: Id7245223bc2a284efed6e710892b58947ef5d555
(cherry picked from commit d5c04c5ebb67e4581d7d861503de111ff84c5b75)

7 years agoShared namespaces inherit parent ns properties
Dimitry Ivanov [Tue, 2 May 2017 00:45:38 +0000 (17:45 -0700)]
Shared namespaces inherit parent ns properties

Make shared namespace inherit namespace links and
search/permitted paths from the parent namespace.

Bug: http://b/37854032
Test: bionic_unit_tests --gtest_filter=dl*:Dl*
Change-Id: I174661d4a1dd0cbe4a378179073719aa955f3592

7 years agowatchpoint_imprecise test: set 4-byte watchpoints on 32-bit arches
Pavel Labath [Thu, 27 Apr 2017 00:48:38 +0000 (00:48 +0000)]
watchpoint_imprecise test: set 4-byte watchpoints on 32-bit arches

8-byte watchpoints are not supported on 32-bit kernels (at least on x86,
probably arm as well). 8-byte watchpoints are not required for this
test, so just decrease the size of watchpoints on these architectures.

Test: bionic-unit-tests-static --gtest_filter=sys_ptrace.*
Bug: 37662849
Change-Id: I450a78fc1d6b8807fe1c776f5fa62d329788969e
(cherry picked from commit 778c048a8fc1a5485a53f670a587f09e4daf6bae)

7 years agoRevert "Revert "loader: enable loading libraries from tmpfs""
Dimitry Ivanov [Mon, 24 Apr 2017 20:35:41 +0000 (13:35 -0700)]
Revert "Revert "loader: enable loading libraries from tmpfs""

This reverts commit 6d59318d78553c32c8f2f43ee48ec3bebace8e86.

Bug: http://b/37245203
Bug: http://b/37590327
Test: bionic-unit-tests on angler and marlin
Test: boot an angler and make sure mediacodec does not crash

7 years agoMerge "Revert "loader: enable loading libraries from tmpfs"" into oc-dev
TreeHugger Robot [Sun, 23 Apr 2017 01:59:16 +0000 (01:59 +0000)]
Merge "Revert "loader: enable loading libraries from tmpfs"" into oc-dev

7 years agoRevert "loader: enable loading libraries from tmpfs"
Yin-Chia Yeh [Sat, 22 Apr 2017 20:49:59 +0000 (20:49 +0000)]
Revert "loader: enable loading libraries from tmpfs"

This reverts commit bb8b22a087db32773f1a9cd3473061f3ad714afc.

http://b/37245203
http://b/37590327
Change-Id: I36f45697f7478b830947d641942e453ed0d5466e

7 years agoloader: fix leak of child-to-parent links on dlclose()
Dimitry Ivanov [Fri, 21 Apr 2017 23:44:48 +0000 (16:44 -0700)]
loader: fix leak of child-to-parent links on dlclose()

Use children instead of parents in is_recursive() - this
allows us to remove code adding links from child to
parent when loading a library.

Bug: 36104177
Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests32 --gtest_filter=dl*
Test: manual - dlopen/dlclose libandroid.so 10 times and see how many blocks are
      used after each dlclose() - make sure they are constant.

Change-Id: I776d47de92101c6ba47f400205ccbfe8844a7cb8

7 years agoloader: fix leak of child-to-parent links on dlclose()
Dimitry Ivanov [Sat, 22 Apr 2017 00:44:25 +0000 (17:44 -0700)]
loader: fix leak of child-to-parent links on dlclose()

Remove the code adding link from child to parent. The link is
not used anywhere in the linker for L release.

Bug: 36104177
Test: manual - dlopen/dlclose libandroid.so 10 times and see how many blocks are
      used after each dlclose() - make sure they are constant.

Change-Id: I57039e934ba233253ad7dce2e071833528460116

7 years agoMerge "loader: enable loading libraries from tmpfs" into oc-dev
TreeHugger Robot [Fri, 21 Apr 2017 23:39:18 +0000 (23:39 +0000)]
Merge "loader: enable loading libraries from tmpfs" into oc-dev

7 years agoloader: enable loading libraries from tmpfs
Dimitry Ivanov [Fri, 21 Apr 2017 20:12:05 +0000 (13:12 -0700)]
loader: enable loading libraries from tmpfs

This change adds two tests for dlopen from temporary files.
1. One Uses memfd_create() can be used to load libraries directly
from memory. This requires relaxing namespace accessibility check
in order to make this work in isolated namespaces.
2. Another checks that open with O_TMPFILE works.

Bug: http://b/37245203
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: I3be1d7198ca17e7f1ba022a0d86c64d59a493506

7 years agoThe future is now.
Josh Gao [Thu, 20 Apr 2017 19:58:31 +0000 (12:58 -0700)]
The future is now.

__INTRODUCED_IN_FUTURE -> __INTRODUCED_IN(26)

Bug: http://b/37437368
Test: treehugger
Change-Id: I601a23da83b65a0cd582cc840ed3856a9031b673

7 years agoAdd syscalls that aren't currently used to the seccomp whitelist.
Josh Gao [Tue, 18 Apr 2017 23:05:39 +0000 (16:05 -0700)]
Add syscalls that aren't currently used to the seccomp whitelist.

Add some useful new syscalls that we currently aren't using in bionic,
but might in the future to the seccomp whitelist.

Bug: http://b/37317198
Test: mma
Change-Id: I6550867da152cea84fb13d0c15a399cdb2acf1aa
(cherry picked from commit de9262e5c5f12b45516e19b66a4e3fc5d6edc5a1)

7 years agolibc: fix typo in __RENAME macro
George Burgess IV [Wed, 19 Apr 2017 01:28:19 +0000 (18:28 -0700)]
libc: fix typo in __RENAME macro

Apparently __strncpy_real redirects to strcpy instead of strncpy for GCC
builds. This is bad, and it confused a project compiled by GCC that uses
strcpy.

I audited all of the FORTIFY-related __RENAMEs both manually and with a
script I hacked together; they all look correct aside from this one.

FWIW, with the cleaned up clang FORTIFY, lots of the `void foo()
__RENAME(foo)` will just become `void foo()` if this last thing I'm
working on gets through review.

Bug: 35329524
Test: Previously broken project now seems to work. Bullhead and Ryu
both build + boot.

(cherry picked from commit 31e5a35f3d403ffa4ffe0215f9664d08fb749ada)

Change-Id: I790a42f2cf2f7b8e003faa4df9135db22a2e20db

7 years agoUn-deprecated __system_property_find_nth.
Elliott Hughes [Mon, 17 Apr 2017 21:53:07 +0000 (14:53 -0700)]
Un-deprecated __system_property_find_nth.

Netflix was using this, and looking the header file, although
__system_property_find_nth has been available since the beginning of time,
__system_property_foreach only appeared in 16. So anyone who wants to run
on pre-JellyBean devices would want to use __system_property_find_nth.

It's pretty much a one-liner in terms of __system_property_foreach anyway,
so it doesn't cost us anything to keep it.

Also restore slightly better tests than we originally removed.

Bug: http://b/36566667
Test: ran tests

(cherry picked from commit 438e01940b90a2b6061a9b9809e08466e1e9faac)

Change-Id: I639f2142ad4ba049b990b13ccccd255be4b4f479

7 years agoAdd seccomp blacklist, and exclude swap functions
Paul Lawrence [Wed, 12 Apr 2017 17:02:54 +0000 (10:02 -0700)]
Add seccomp blacklist, and exclude swap functions

Bug: 37253880
Test: Make sure device boots
      Run pylint on genseccomp.py, test_genseccomp.py
      Run test_genseccomp.py
      Run new CTS test
      cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.SeccompTest

(cherry picked from commit 3dd3d55af2e73e0cda786368e94c65485bcc267b)

Change-Id: I7d4fe78d4fd43e2a5d701d6250c3dd27e4cb128b

7 years agoMerge "Restore __system_property_find_nth version" into oc-dev
TreeHugger Robot [Thu, 13 Apr 2017 03:20:02 +0000 (03:20 +0000)]
Merge "Restore __system_property_find_nth version" into oc-dev

7 years agoRestore __system_property_find_nth version
Dimitry Ivanov [Thu, 13 Apr 2017 01:05:56 +0000 (18:05 -0700)]
Restore __system_property_find_nth version

Moving this to LIBC_DEPRECATED caused compatibility
problems for some apps.

Bug: http://b/36566667
Test: launch app and check that it does not crash
Change-Id: I470f916ef818ff62ff5391b3a0c86dd44c1e8cd0

7 years agoMerge "Don't let missing Treble property context files affect errno." into oc-dev
TreeHugger Robot [Wed, 12 Apr 2017 17:07:35 +0000 (17:07 +0000)]
Merge "Don't let missing Treble property context files affect errno." into oc-dev

7 years agoMerge "The workaround for apps using older version of soinfos" into oc-dev
TreeHugger Robot [Wed, 12 Apr 2017 07:30:43 +0000 (07:30 +0000)]
Merge "The workaround for apps using older version of soinfos" into oc-dev

7 years agoDon't let missing Treble property context files affect errno.
Elliott Hughes [Tue, 11 Apr 2017 20:38:36 +0000 (13:38 -0700)]
Don't let missing Treble property context files affect errno.

User code on a non-treble device was starting with errno == ENOENT rather
than 0 because of this treble support:

  openat(AT_FDCWD, "/property_contexts", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
  faccessat(AT_FDCWD, "/system/etc/selinux/plat_property_contexts", R_OK) = -1 ENOENT (No such file or directory)

This caused us to fail some toybox tests by reporting bogus errno values
where errno should have been left unset:

  PASS: date -d @0
  FAIL: date -d @0x123
  echo -ne '' | TZ=UTC date -d @0x123 2>&1
  --- expected
  +++ actual
  @@ -1 +1 @@
  -date: bad date '@0x123'
  +date: bad date '@0x123': No such file or directory
  PASS: date -d 06021234
  PASS: date -d 060212341982
  FAIL: date -d 123
  echo -ne '' | TZ=UTC date -d 123 2>&1
  --- expected
  +++ actual
  @@ -1 +1 @@
  -date: bad date '123'
  +date: bad date '123': No such file or directory
  PASS: date -d 1110143115.30
  PASS: date -d 111014312015.30
  PASS: date Unix time missing @

Bug: http://b/37248982
Test: ran tests

(cherry picked from commit 7ade61cae297c112e7288f173fb529673010926a)

Change-Id: I4c680da14f3df16dc5a9884071e48f3221ad3b3b

7 years agoThe workaround for apps using older version of soinfos
Dimitry Ivanov [Tue, 11 Apr 2017 22:22:49 +0000 (15:22 -0700)]
The workaround for apps using older version of soinfos

Skip the check for accessibility in the case soinfo
does not have primary/secondary namespaces associated
with them.

Bug: http://b/37191433
Test: start an app from http://b/37191433 make sure it does not crash on lunch
Change-Id: Id4c0bdab4dfc6bc8a33fc275d71e325518e0759f

7 years agoMark CRT objects as vendor available
Dan Willemsen [Fri, 7 Apr 2017 21:09:05 +0000 (14:09 -0700)]
Mark CRT objects as vendor available

This will build separate copies of the CRT for vendor vs system when
BOARD_VNDK_VERSION is set. We'll be able to change crtbrand / etc as
needed with #ifdef __ANDROID_VNDK__ and similar.

Bug: 36426473
Bug: 36079834
Test: Put #ifdef __ANDROID_VNDK__ into crtbrand.S, see changes
Merged-In: I7db0cccfe94d144f072e7cef23832884f3c066f0
Change-Id: I7db0cccfe94d144f072e7cef23832884f3c066f0

7 years agoRemove .(ll)ndk suffix from (ll)ndk_library
Dan Willemsen [Fri, 7 Apr 2017 21:09:18 +0000 (14:09 -0700)]
Remove .(ll)ndk suffix from (ll)ndk_library

Soong handles these automatically now.

Bug: 33241851
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Change-Id: Ibfe4cf5db732d9007b1cc12dbc523c427de1b23d

7 years agoMerge "Build the versioner even on unbundled branches." into oc-dev
Steven Moreland [Mon, 10 Apr 2017 15:30:01 +0000 (15:30 +0000)]
Merge "Build the versioner even on unbundled branches." into oc-dev

7 years agoBuild the versioner even on unbundled branches.
Dan Albert [Mon, 27 Mar 2017 20:28:27 +0000 (13:28 -0700)]
Build the versioner even on unbundled branches.

This is needed to generate the NDK, so unbundled projects using the
NDK need to build this. If they don't need the NDK, they should just
remove bionic from their manifest.

Test: make checkbuild
Bug: None
Merged-In: I7db816c4a341cf34d4d11739dc64182af630ad63
Change-Id: I7db816c4a341cf34d4d11739dc64182af630ad63
(cherry picked from commit 69cb22f4d73bf432d2b0bb78b74801c94b0824b5)

7 years agoAdd LLNDK stub libraries for the VNDK
Dan Willemsen [Mon, 20 Mar 2017 21:07:47 +0000 (14:07 -0700)]
Add LLNDK stub libraries for the VNDK

The stub libraries are the same as the (equivalent version) NDK, but
they also contain symbols tagged with 'vndk'. Except there are none of
those in Bionic currently.

For headers, the LLNDK/VNDK isn't using a sysroot like the NDK. Nor is
it hardcoding an explicit source path list like the platform. Instead it
runs the bionic/libc/include directory through versioner like the NDK,
then exports those generated headers and the kernel headers from the
stub library like any other exported header. Except it uses -isystem
instead of -I due to export_headers_as_system.

Test: aosp_arm; m -j
Test: Enable BOARD_VNDK_VERSION on aosp_arm; m -j
Test: Inspect out/soong/build.ninja before/after (w/o vndk)
Change-Id: Ief58a73907a83053b408b1d4b62999cba470d61c
(cherry picked from commit b8f7fde4bdfba5a65ef5a88265fdb79403e8a699)

7 years agoRevert "Revert "Run the versioner as part of the build.""
Dan Albert [Wed, 22 Mar 2017 22:28:05 +0000 (15:28 -0700)]
Revert "Revert "Run the versioner as part of the build.""

This reverts commit 69c7562f5983ed5bc1d330b1f44b5cf506efb60e.

Test: make checkbuild
Change-Id: Ie443029398c01b45e0a0317a8074808b064f35d4

7 years agoMerge "versioner: fix LLVM assertion failure." into oc-dev
TreeHugger Robot [Fri, 7 Apr 2017 02:39:06 +0000 (02:39 +0000)]
Merge "versioner: fix LLVM assertion failure." into oc-dev

7 years agoversioner: fix LLVM assertion failure.
Josh Gao [Thu, 6 Apr 2017 19:57:22 +0000 (12:57 -0700)]
versioner: fix LLVM assertion failure.

MemoryBuffer::getOpenFileSlice asserts that the map size passed in
isn't -1 (presumably because the offset can be nonzero). Switch to
getOpenFile, which results in an identical call to the implementation
function without the assert.

Bug: http://b/37002637
Test: export FORCE_BUILD_LLVM_COMPONENTS=true
      export FORCE_BUILD_LLVM_DEBUG=true
      export FORCE_BUILD_LLVM_DISABLE_NDEBUG=true
      mma -j && versioner

Change-Id: Ib610db9e07429aa3f64128eaef6ef555c4d1868e
(cherry picked from commit 8ef9874d564e1de25057817b43a5ef6f5065b458)

7 years agolinker: add android_get_exported_namespace
Jiyong Park [Mon, 3 Apr 2017 14:10:37 +0000 (23:10 +0900)]
linker: add android_get_exported_namespace

Depending on how ld.config.txt is configured, there can be multiple
built-in namespaces created by the linker from the beginning of a
process. android_get_exported_namespace is a platform only API for
getting a handle (android_namespace_t*) to one of the built-in namespaces
with given name. The returned namespace can then be given to
android_dlopen_ext in order to explicitly specify the target namespace
where the library is searched and loaded from.

Note that this function only returns 'exported' namespaces created via
ld.config.txt file. In order to export a namespace, the visible property
should be set to true:

namespace.<name>.visible = true

Namespaces are hidden by default. Hidden namespaces and namespaces
that are created programmatically, notably 'classloader-namespace',
aren't returned by this function.

Bug: 36851137
Test: confirmed that namespaces created with ld.config.txt is retrieved.
Test: linker-unit-tests passes
Change-Id: I0d05fa7e0e116009edf8ea362ab46774bc617cbf

7 years agoMerge "Add support for disabling the greylist." into oc-dev
Elliott Hughes [Thu, 6 Apr 2017 17:58:42 +0000 (17:58 +0000)]
Merge "Add support for disabling the greylist." into oc-dev

7 years agoFix compare_exchange_weak tests to allow spurious failure
Hans Boehm [Wed, 5 Apr 2017 00:34:59 +0000 (17:34 -0700)]
Fix compare_exchange_weak tests to allow spurious failure

Test: Ran bionic unit tests on angler.

Bug: 36869788

(cherry picked from commit 590a410d29978016b2a01e8fbedaf17154743b76)

Change-Id: I22c280baa6bc50334765dae043307d21e1e9c930

7 years agoAdd support for disabling the greylist.
Elliott Hughes [Fri, 24 Mar 2017 00:42:49 +0000 (17:42 -0700)]
Add support for disabling the greylist.

Useful for testing whether apps have actually stopped using greylisted
libraries even if they still have references to them in their apk to support
old Android releases but also haven't bumped their targetSdkVersion yet.

Since we already have two expensive __system_property_get calls and this
would add a third, optimize two (but leave the third since it's not
obviously amenable to optimization). None of this matters for user builds,
but I don't want userdebug/eng to have distractingly different performance.

Bug: http://b/36106661
Test: ran "can you escape 5" with and without this property
Change-Id: Id9a804695c1dca9b4be2ebd0e72f01817bb13cba

7 years agoAddition of a new system file for time zone data
Neil Fuller [Thu, 30 Mar 2017 17:12:49 +0000 (18:12 +0100)]
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
(cherry picked from commit 108279e9e5be02b15c8000d99ce2e600c0bc97ec)
(cherry picked from commit 7336db761c07539b947de7be5320aa982683b6e5)

Change-Id: I624afca175f49f0836d0c820f0f131ecc4ccb998

7 years agoBreak android_set_abort_message out of libc_logging.
Josh Gao [Mon, 3 Apr 2017 22:13:29 +0000 (15:13 -0700)]
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
(cherry picked from commit 10ec9286ae843b0a84438699458ba17bff2f5602)

7 years agoFix lookup logic for linked namespaces
Dimitry Ivanov [Mon, 27 Mar 2017 21:11:02 +0000 (14:11 -0700)]
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
(cherry picked from commit d3e7d088453e089b3d625b0864ccdf3c74893f18)

7 years agoMerge "Refactor sanitized library on-disk layout - bionic." into oc-dev
TreeHugger Robot [Sat, 1 Apr 2017 04:18:32 +0000 (04:18 +0000)]
Merge "Refactor sanitized library on-disk layout - bionic." into oc-dev

7 years agoMerge "Only use environment variables on the host." into oc-dev
TreeHugger Robot [Sat, 1 Apr 2017 02:33:27 +0000 (02:33 +0000)]
Merge "Only use environment variables on the host." into oc-dev

7 years agoRefactor sanitized library on-disk layout - bionic.
Vishwath Mohan [Wed, 29 Mar 2017 22:31:34 +0000 (15:31 -0700)]
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.

(cherry picked from commit 4113def4fa1526f1823549f6cc9cfe4c05964aa3)

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

7 years agoOnly use environment variables on the host.
Elliott Hughes [Fri, 31 Mar 2017 22:35:21 +0000 (15:35 -0700)]
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.

Bug: http://b/36807787
Test: ran tests
Change-Id: I0bb7879cc46f194152c67ddaf072cbebb424f789

7 years agoExpand whitelist
Paul Lawrence [Thu, 30 Mar 2017 22:24:13 +0000 (15:24 -0700)]
Expand whitelist

Bug: 36726183
Test: Builds, call 90 added to policy
Change-Id: Ib8db1b764ce22aadf8050031d40040dd6c0e669e

7 years agoFix x86 system calls made from ELF preinit.
Elliott Hughes [Wed, 29 Mar 2017 20:48:02 +0000 (13:48 -0700)]
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

(cherry picked from commit eb04ed506fbb0561b677d9518c9bae33f0262b03)

Change-Id: Ie9da1bf4c2dcc23be7d75c739ae8549309813f88

7 years agolinker: log only real dlerrors
Dimitry Ivanov [Tue, 28 Mar 2017 18:08:58 +0000 (11:08 -0700)]
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
(cherry picked from commit 11968b80af5be601b820f261e2e102e5b8ed48c4)