Commit graph

2091 commits

Author SHA1 Message Date
Martin Stjernholm
ba01a4cc5b Merge changes from topic "runtime-ld-configs" am: d35c4ccc40 am: 00f2f79179
am: 432c4cd11f

Change-Id: Ia1a199a51a601e38180f44b18842b79b348d5bab
2019-01-23 10:00:01 -08:00
Martin Stjernholm
d35c4ccc40 Merge changes from topic "runtime-ld-configs"
* changes:
  Make libdexfile_external.so accessible from binaries and libraries in /system.
  The runtime namespace needs to be visible since libopenjdk is loaded through dlopen().
2019-01-23 17:03:12 +00:00
Martin Stjernholm
c02464ced9 Make libdexfile_external.so accessible from binaries and libraries in /system.
There are dependencies on libdexfile_external from some central libraries
that are widely used (b/123186083).

One example is vendor/bin/hw/android.hardware.media.omx@1.0-service, which
requries the link from "system" to "runtime" in the [vendor] section.

The direct dependants are libunwindstack and simpleperf, so it's enough to
link from namespaces containing /system/{lib,lib64,bin}.

Test: Flash and boot
Test: Flash and boot with Runtime APEX enabled (http://r.android.com/q/topic:art-move-libs-to-runtime-apex)
Bug: 123186083
Bug: 113373927
Change-Id: I081aa7392c875202acdaf1185c2ff28e17ac7e76
2019-01-23 15:45:59 +00:00
Nicolas Geoffray
119e95b3b6 Merge "Conscrypt should only link against bionic." am: 1cab2c6bec am: 31e937429c
am: 06710823aa

Change-Id: Ic884d79df46b625e78f1b0bda03a368322bcef50
2019-01-23 01:30:49 -08:00
Martin Stjernholm
1fc8a55ba7 The runtime namespace needs to be visible since libopenjdk is loaded through dlopen().
Test: Flash and boot
Test: Flash and boot with Runtime APEX enabled (http://r.android.com/q/topic:art-move-libs-to-runtime-apex)
Bug: 113373927

Change-Id: I555ea988f56d1ee8e7488997a923207de044630f
2019-01-22 18:32:09 +00:00
Chris Wailes
ca11579b6c Added a new socket to Zygote init scripts.
This change adds new socket declarations to the init scripts for the
Zygote processes.  This socket is used for communication between the
System Server and the Blastula pool.

Bug: 68253328
Change-Id: I5dbb87770b1a3100c6c122bb39ca854006bb0b0d
Topic: zygote-prefork
Test: build image; flash device; launch apps
2019-01-22 09:42:06 -08:00
Nicolas Geoffray
88bdf80d17 Conscrypt should only link against bionic.
Also remove useless code in native_loader.cpp

Test: m
Change-Id: Id176256cc36fa32d3f722e1443429cb9fbec05f2
2019-01-22 15:32:23 +00:00
Nicolas Geoffray
abc1c8b905 Merge "Revert "Revert "Introduce conscrypt linker namespace.""" am: 4d30819263 am: af8e980ed1
am: fd6a05085c

Change-Id: Ie935c28c91dd88fc99b04fc556d2fcba71246fbd
2019-01-22 06:43:47 -08:00
Nicolas Geoffray
56bbf65ecf Merge "Add 'media' namespace in ld.config.txt" am: 7fa20386c3 am: f495d92287
am: bc60897aec

Change-Id: I9714df74f50dc6ebe72b3cc564ef7d2de41577e0
2019-01-22 01:34:15 -08:00
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
890e3bf4e7 Revert "Revert "Introduce conscrypt linker namespace.""
This reverts commit 5701a47685.

Bug: 123185917
Test: CtsJdwpTestCases
Test: android.signature.cts.api.killswitch_debug_class

Reason for revert: Fixed CtsJdwpTestCases and KillSwitchTest.

Change-Id: I6a074038a4e974875d68ca6a371f6a87ad48bce9
2019-01-22 09:15:22 +00:00
Nicolas Geoffray
7fa20386c3 Merge "Add 'media' namespace in ld.config.txt" 2019-01-22 08:51:10 +00:00
Dongwon Kang
c19263bcd0 Add 'media' namespace in ld.config.txt
Test: build & boot & atest MediaPlayer2Test
Bug: 112766913, Bug: 123185917
Change-Id: I6bccc5d767c108af5e71ad5cf64a1d4d48227761
2019-01-21 11:23:04 -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