Commit graph

2079 commits

Author SHA1 Message Date
Nicolas Geoffray
1cd3d41313 Merge "Delay zygote startup until after the Runtime APEX has been mounted." am: 876cd75748 am: ce0abc4d93
am: 3639043906

Change-Id: Ifb657a5725de5092d1202b32d4e0288433882726
2019-01-22 01:18:39 -08:00
Nicolas Geoffray
97f0c48712 Merge "Revert "Introduce conscrypt linker namespace."" am: e606e00042 am: 3326da5bb7
am: 9ea6ac833b

Change-Id: I50c9696c6049a4183da388dd659fe87e88982a4d
2019-01-21 09:44:38 -08:00
Nicolas Geoffray
5701a47685 Revert "Introduce conscrypt linker namespace."
This reverts commit 67a09e5791.
Exempt-From-Owner-Approval: Fixes P0 failures.

Bug: 123185917


Reason for revert: media namespace needs to be introduced.

Change-Id: I0c28798a3143c1e627278c3a908207e670171416
2019-01-21 17:23:31 +00:00
Nicolas Geoffray
95cb5d8303 Merge "Introduce conscrypt linker namespace." am: 8922048185 am: 70df103b96
am: a3370d6bd4

Change-Id: I87d60938dc7c32865a6ea8aad4dd3514450e14c5
2019-01-21 04:21:41 -08:00
Nicolas Geoffray
67a09e5791 Introduce conscrypt linker namespace.
And have the linker translate a java library path from an apex
to a linker namespace.

Bug: 122874359
Test: m, boots, gtest, run-test, CtsJdwpTests
Change-Id: I216c3509c45589d28acdac068aec53877aeb104a
Exempt-From-Owner-Approval: Carrying Jiyong's +2
2019-01-21 12:05:13 +00:00
Martin Stjernholm
440efa5796 Delay zygote startup until after the Runtime APEX has been mounted.
It depends on libdexfile_external, libnative{bridge,helper,loader} and
libart(d), which are provided by the Runtime APEX.

Test: flash & boot
Test: atest CtsJdwpTestCases
Bug: 113373927
Change-Id: I0df99f444e892c47a5f06bd1bcf5d184defb4517
2019-01-21 10:55:31 +00:00
Dan Willemsen
621cff03f7 Merge "Remove LOCAL_MODULE_TAGS := debug" am: 763bac7826 am: 67d1b381f9
am: 151bc1c2de

Change-Id: Ic9b215432453476130a0d45b4e4387c7159de9de
2019-01-19 00:14:30 -08:00
Dan Willemsen
763bac7826 Merge "Remove LOCAL_MODULE_TAGS := debug" 2019-01-19 07:39:56 +00:00
Sudheer Shanka
b8b6df2ae9 Merge "Reland "Create new mount directory /mnt/runtime/full."" am: c39ed35d82 am: 5e4c507abd
am: ec21712d16

Change-Id: I59446c2d66b016119579b4c2b17e65997d4a3f10
2019-01-18 17:46:58 -08:00
Sudheer Shanka
c39ed35d82 Merge "Reland "Create new mount directory /mnt/runtime/full."" 2019-01-19 00:24:23 +00:00
Sudheer Shanka
81c687dff8 Reland "Create new mount directory /mnt/runtime/full."
This will be used for system internals to access
secondary volumes without having to bypass sdcardfs.

This reverts commit 54b8844b13

Bug: 121277410
Test: manual
Change-Id: Id5b995dc5899b5999f1dea662ba1c3ee475a0e46
2019-01-19 00:21:10 +00:00
Dan Willemsen
ceaf4e76e5 Remove LOCAL_MODULE_TAGS := debug
It's replaced with entries in PRODUCT_PACKAGES_DEBUG in
build/make/target/product/base_system.mk

Test: treehugger
Change-Id: I4dc69c34ddc2c494fc74bc4afee6efa240c9b0d3
2019-01-18 15:16:50 -08:00
Srinivas Paladugu
6fabbecd97 Merge "Allow write access to system_server on zram sysfs" 2019-01-18 23:00:32 +00:00
Jiyong Park
d7daac2c75 Merge changes from topic "revert_move_bionic_to_apex" am: e0c7a8bbdd am: 555b7ead70
am: e9f4339db8

Change-Id: Ic4054f6ea0845ff6576b0ada314e01e7b0eb7299
2019-01-18 02:41:06 -08:00
Jiyong Park
8b73dfc0a4 Revert "Bionic libs and the dynamic linker are bind mounted"
This reverts commit 2599088ff6.
Reason: Breaks some 3p apps.

Bug: 122920047
Test: run the app, login.
Change-Id: Idea332b1f91e9d2ac6ebd3879da7820c8ba2284f
2019-01-18 12:30:51 +09:00
Srinivas Paladugu
3a63283aff Allow write access to system_server on zram sysfs
System server needs to be able to write to idle and
writeback nodes in the zram sysfs directory.

Bug: 117682284
Bug: 122674343
Test: Test writeback on go ref device
Change-Id: I1cd663b73a7ebb255fe7e459601e720961bbd69e
2019-01-16 20:54:58 -08:00
Sudheer Shanka
285767556c Merge "Revert "Create new mount directory /mnt/runtime/full."" am: 3daecf5977 am: 9ced0aae27
am: 7b4f851966

Change-Id: I4db125c3daeda219d41b47f163851f5a70acee1c
2019-01-16 18:24:34 -08:00
Treehugger Robot
3daecf5977 Merge "Revert "Create new mount directory /mnt/runtime/full."" 2019-01-17 01:04:50 +00:00
Sudheer Shanka
54b8844b13 Revert "Create new mount directory /mnt/runtime/full."
This reverts commit 987e732fe8.

Reason for revert: 122957837

Change-Id: Ib1451d46a05f34eb52fdc13143529913df5ec001
2019-01-16 19:52:29 +00:00
Sudheer Shanka
e08289d2cf Merge "Create new mount directory /mnt/runtime/full." am: 598a4bcb13 am: 051a89009c
am: c8de4932f7

Change-Id: I8f1b857d6af5bcb4a9c479eca65301090abbc2df
2019-01-16 09:12:12 -08:00
Sudheer Shanka
598a4bcb13 Merge "Create new mount directory /mnt/runtime/full." 2019-01-16 16:34:21 +00:00
Jiyong Park
509819b1ee Merge "Load build sysprops early" am: 4fc83b1885 am: 14471cbe5d
am: cf05b13182

Change-Id: I595b3e624676e691d290b2b657efe8dad996d1c8
2019-01-15 12:56:01 -08:00
Jiyong Park
3b316ee201 Load build sysprops early
*/build.prop files are now loaded much earlier than before; from 'on
post-fs' to the time when the property service is started which is
before init starts the action loop.

This ensures that all processes that are launched by init have a
consistent view of system properties. Previously, the processes that
started before 'on post-fs' were initially with the small number of
sysprops loaded from */default.prop and then suddenly get additional
sysprops from */build.prop while they are executing.

Bug: 122714998
Test: device boots

Change-Id: Ic07528421dfbe8d4f43673cea41175d33cfbf298
2019-01-15 22:40:49 +09:00
Sudheer Shanka
987e732fe8 Create new mount directory /mnt/runtime/full.
This will be used for system internals to access
secondary volumes without having to bypass sdcardfs.

Bug: 121277410
Test: manual
Change-Id: I6546fa8df419157b3c2adcf5ff3faa4db4458cff
2019-01-11 11:32:34 -08:00
Jiyong Park
bd653fa045 Bionic libs are located at /system/lib am: 3fa8415b37 am: 1c4851f223
am: 556a4a7d60

Change-Id: Ibefcda2ceb31a1707af8faf4302d0a84015e5229
2019-01-11 09:53:48 -08:00
Jiyong Park
9189474580 Bionic libs and the dynamic linker are bind mounted am: 2599088ff6 am: 82a0d5be74
am: 90aae8d6c7

Change-Id: I6302778662b0b38362496c4f935f884e18cbb75f
2019-01-11 09:53:08 -08:00
Jiyong Park
3fa8415b37 Bionic libs are located at /system/lib
Bionic libs, regardless of whether they are bootstrap ones or from the
runtime APEX, are available via /system/lib. Since /system/lib is in the
search paths of the default(platform) namespace, there is no need to
list the bionic libs to the namespace link to the runtime namespace.

Bug: 120266448
Test: m; device boots
Test: atest CtsJniTestCases CtsCompilationTestCases CtsBionicTestCases
all passing except for following tests that are also failing at ToT
dl#exec_linker
dl#exec_linker_load_from_zip
dl#exec_linker_load_self
dl#exec_linker_load_file

Change-Id: Ib67acd4f384b2f0e70b5fe8ec6b45a5506367223
2019-01-11 15:17:04 +09:00
Jiyong Park
2599088ff6 Bionic libs and the dynamic linker are bind mounted
This change makes the bionic libs and the dynamic linker from the
runtime APEX (com.android.runtime) available to all processes started
after apexd finishes activating APEXes.

Specifically, the device has two sets of bionic libs and the dynamic
linker: one in the system partition for pre-apexd processes and another
in the runtime APEX for post-apexd processes. The former is referred as
the 'bootstrap' bionic and are located at
/system/lib/{libc|libdl|libm}.so and /system/bin/linker. The latter is
referred as the 'runtime' bionic and are located at
/apex/com.android.runtime/lib/bionic/{libc|libdl|libm}.so and
/apex/com.android.runtime/bin/linker.

Although the two sets are located in different directories, at runtime,
they are accessed via the same path: /system/lib/* and
/system/bin/linker ... for both pre/post-apexd processes. This is done
by bind-mounting the bootstrap or the runtime bionic to the same path.
Keeping the same path is necessary because there are many modules and
apps that explicitly or implicitly depend on the fact that bionic libs
are located in /system/lib and are loaded into the default linker
namespace (which has /system/lib in its search paths).

Before the apexd is started, init executes a built-in action
'prepare_bootstrap_bionic' that bind-mounts the bootstrap bionic to the
mount points. Processes started during this time are provided with the
bootstrap bionic. Then after the apexd is finished, init executes
another built-in action 'setup_runtime_bionic' which again mounts the
runtime bionic to the same mount points, thus hiding the previous mounts
that target the bootstrap bionic. The mounting of the runtime bionic
(which is only for post-apexd processes) is hidden from pre-apexd
processes by changing propagation type of the mount points to 'private'
and execute the pre-apexd processes with a new mount namespace using
unshare(2). If a pre-apexd process crashes and re-launched after the
apexd is on, the process still gets the bootstrap bionic by unmounting
the runtime bionic which effectively un-hides the previous bind-mounts
targeting the bootstrap bionic.

Bug: 120266448
Test: device boots
Test: cat /proc/`pidof zygote`/mountinfo shows that
/system/lib/{libc|libdl|libm}.so and /system/bin/linker are from the
runtime APEX
Test: cat /proc/'pidof vold`/mountinfo shows that the same mount points
are from system partition.

Change-Id: I7ca67755dc0656c0f0c834ba94bf23ba9b1aca68
2019-01-11 15:17:04 +09:00
Narayan Kamath
aa267b6164 Merge "Allow the system user to read apex_data_file." am: 6cc741ec9a am: 54c3f13487
am: 1ccd0e89d8

Change-Id: Ia7b26ee4f953ae17e7e68a5c0e07ac521ac2ded1
2019-01-08 04:13:12 -08:00
Narayan Kamath
6cc741ec9a Merge "Allow the system user to read apex_data_file." 2019-01-08 11:50:12 +00:00
Tri Vo
befd2e7bfa Merge "ueventd.rc: Move device-specific entries to /vendor/ueventd.rc." am: 7061c88de1 am: 4c770625f9
am: 200a1ad164

Change-Id: I3f5c4945af7e5d9539180df9a82de195bad73d00
2019-01-07 14:35:44 -08:00
Tri Vo
7061c88de1 Merge "ueventd.rc: Move device-specific entries to /vendor/ueventd.rc." 2019-01-07 22:09:44 +00:00
Narayan Kamath
8464d79877 Allow the system user to read apex_data_file.
For consistency with APKs, signature verification is performed
in the system_server. This includes checking that the signature of
an updated install matches the signature of the active package that
it updates. For this, it requires search access to /data/apex and
read access to the files under that directory.

Test: m
Change-Id: I8795b26b9a40ba7126c2a548fbec82ff322a1453
2019-01-07 19:15:10 +00:00
Logan Chien
b5d6b3494a Merge "Fix runtime namespace links for vendor processes" am: c2aad281fc am: e1324405a4
am: 67b1d7d834

Change-Id: Iaedfcf926bf062af57955fd93c9746138dc13774
2019-01-06 21:42:00 -08:00
Logan Chien
c2aad281fc Merge "Fix runtime namespace links for vendor processes" 2019-01-07 05:19:49 +00:00
Logan Chien
c0bb441b15 Fix runtime namespace links for vendor processes
This commit removes the soname filter from the namespace fallback link
from `runtime` to `system` in the vendor process.  This fixes the
problem that vendor process might fail to load `libnetd_client.so`,
`libc_malloc_debug.so`, `libc_malloc_debug_leak.so`, and other libc
dependencies.

This commit also removes the namespace fallback link from `runtime` to
`default` in the vendor process.  According to the comments in [1], the
original intention was to allow the access to `/system/${LIB}` not
`/vendor/${LIB}`.  Furthermore, `com.android.runtime` suppose to work
without libraries from `/vendor/${LIB}`.

[1] https://android-review.googlesource.com/c/858456

Bug: 119867084
Bug: 122025516  # Motivation of this commit
Test: Executables under vendor partition are not blocked by
`libnetd_client.so` not found error.

Change-Id: I682baada9d755910832474bb3d8307cd49c21ece
2019-01-07 11:14:34 +08:00
Tri Vo
4f408746cf ueventd.rc: Move device-specific entries to /vendor/ueventd.rc.
Bug: 110962171
Test: boot sailfish, taimen, blueline
Change-Id: If740c2bd85409c9a057cff68f8bfd870cad35b37
2019-01-06 16:15:07 -08:00
Ryan Haining
9a0804475d Merge "Allow dlopen()ing libraries from the netd APEX on pasan build" am: 0c2d673fcc am: 20f1be47d3
am: 137d547e40

Change-Id: Ibc5647f852ff5793df36bb971bf40dd1128d6ad8
2018-12-28 13:43:59 -08:00
Ken Chen
30200f1e24 Allow dlopen()ing libraries from the netd APEX on pasan build
This is a workaround to allow us to use libnetd_resolv.so from
the resolver APEX before b/120661824 is fixed.

We cannot put the APEX into the search path due to b/120661824,
but we can put it into the permitted path,

Bug: b/122073006
Test: builds, boots
Test: system/netd/tests/runtests.sh
Change-Id: If6f13ba9dc249d019b820a7c37cf6d4cdd8d0a7d
2018-12-28 17:20:01 +08:00
Martin Stjernholm
e7268de040 Merge "Revert^2 "Linker namespace configuration for the Runtime APEX."" am: f679c58787 am: 587ebc4bfb
am: 26b91d0eb4

Change-Id: I9705f4a9d323ba8d0cd5485b2a253b3029a47677
2018-12-21 05:53:45 -08:00
Martin Stjernholm
f679c58787 Merge "Revert^2 "Linker namespace configuration for the Runtime APEX."" 2018-12-21 13:30:22 +00:00
Martin Stjernholm
e71d91e729 Revert^2 "Linker namespace configuration for the Runtime APEX."
This reverts commit a0d9f2fd6c.

Original change: Needs to support e.g. app_process in "default" ->
libnativehelper in "runtime" -> platform libs in "default" -> libc etc in "runtime".

Always make sure to switch namespaces when switching library paths between
/system and the APEX, so that internal library dependencies in both
locations are loaded from their own directory. E.g. libc++ and libbase live
in both places, and their dependents must always load the version they were
compiled with.

This CL also adds a temporary workaround to not break hwasan builds
(b/121038155).

Bug: 119867084
Bug: 113373927
Bug: 121038155
Change-Id: I58d09ed091dd82b2162c4a0b51555174d9322e0e
Test: Flash and reboot device
Test: Remount / read-write, then on device: rm -f system/lib{,64}/lib{c,m,dl}.so; system/bin/dex2oat -h; stop && start
Test: mmma bionic/tests/ && adb root && adb shell rm -rf /data/nativetest\* && adb push out/target/product/taimen/data/nativetest* /data/ && adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests && adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: cts-tradefed run commandAndExit cts-dev -m CtsJniTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsCompilationTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsBionicTestCases (8 failures remain unchanged by this CL)
Test: Patch internal; lunch taimen_hwasan-userdebug && m SANITIZE_TARGET=hwaddress && vendor/google/tools/flashall -w && adb shell /vendor/bin/sh -c ls
2018-12-21 11:15:52 +00:00
Dario Freni
7e4dbeb34c Merge "Create staging directory for Staging Manager." am: d1ff11b94a am: 3cde91620f
am: 8ae96c92ef

Change-Id: I60ec39059b60734d1136368eb8fe7c2b24b5df67
2018-12-20 09:35:10 -08:00
Dario Freni
22cdf96697 Create staging directory for Staging Manager.
Staging Manager is a high-level service (yet to be committed) that
manages multi-package sessions requiring a reboot to be applied, for
example if one of the packages is an APEX file. This directory will
contain the session data and the temporary copies of the packages.

Bug: 118865310
Test: N/A
Change-Id: I8aceefab849cf5af17086cb6868b801d1c2615e9
2018-12-20 15:24:18 +00:00
Lorenzo Colitti
3618926adc Merge "Allow dlopen()ing libraries from the netd APEX." am: 95a8d0d0c7 am: e93f1bba90
am: 934b08a013

Change-Id: Ief8c006c230faa1fd6758754a98ba1a39f4bc640
2018-12-19 06:44:16 -08:00
Lorenzo Colitti
472c900f6b Allow dlopen()ing libraries from the netd APEX.
This is a workaround to allow us to use libnetd_resolv.so from
the resolver APEX before b/120661824 is fixed.

We cannot put the APEX into the search path due to b/120661824,
but we can put it into the permitted path,

Test: builds, boots
Test: system/netd/tests/runtests.sh
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest
Change-Id: Ia68df860b7edc92180284f62736146e6029d7655
2018-12-19 16:52:06 +09:00
Andreas Gampe
434e7d6389 Merge "Revert "Linker namespace configuration for the Runtime APEX."" am: ece144857b am: 3138ddb181
am: 3438ac260a

Change-Id: I72166807c00e0d0719519516a484481989a872eb
2018-12-17 15:19:43 -08:00
Treehugger Robot
ece144857b Merge "Revert "Linker namespace configuration for the Runtime APEX."" 2018-12-17 22:55:15 +00:00
Tri Vo
54ed2bfe9e Merge "Reland "Remove obsolete ueventd.rc rules."" am: 80e191af8b am: fbcd5eacd6
am: f051cf7c68

Change-Id: I878464dc0f0e640c16af9c73b000370420ff4c00
2018-12-17 14:38:43 -08:00
Tri Vo
80e191af8b Merge "Reland "Remove obsolete ueventd.rc rules."" 2018-12-17 22:16:36 +00:00