blob: e624b5a0de8adc87b2451b5386a0115aaf5f08ae [file] [log] [blame]
Jiyong Park450cff42017-04-05 14:24:14 +09001# Copyright (C) 2017 The Android Open Source Project
2#
3# Bionic loader config file.
4# This gives the exactly the same namespace setup in pre-O.
5#
6
7# All binaries gets the same configuration 'legacy'
8dir.legacy = /system
changho.shin715b1aa2018-11-28 15:15:16 +09009dir.legacy = /product
Jiyong Park450cff42017-04-05 14:24:14 +090010dir.legacy = /vendor
Alin Jerpeleafa7958e2017-09-27 09:40:59 +020011dir.legacy = /odm
Jiyong Park450cff42017-04-05 14:24:14 +090012dir.legacy = /sbin
13
changho.shin715b1aa2018-11-28 15:15:16 +090014# Except for /postinstall, where only /system and /product are searched
Jiyong Parkd7e6cb22018-03-20 01:12:31 +090015dir.postinstall = /postinstall
16
Jiyong Park450cff42017-04-05 14:24:14 +090017[legacy]
18namespace.default.isolated = false
Jiyong Park2498e1b2017-12-12 22:11:47 +090019
20namespace.default.search.paths = /system/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090021namespace.default.search.paths += /product/${LIB}
Jiyong Park2498e1b2017-12-12 22:11:47 +090022namespace.default.search.paths += /vendor/${LIB}
23namespace.default.search.paths += /odm/${LIB}
24
25namespace.default.asan.search.paths = /data/asan/system/${LIB}
26namespace.default.asan.search.paths += /system/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090027namespace.default.asan.search.paths += /data/asan/product/${LIB}
28namespace.default.asan.search.paths += /product/${LIB}
Jiyong Park2498e1b2017-12-12 22:11:47 +090029namespace.default.asan.search.paths += /data/asan/vendor/${LIB}
30namespace.default.asan.search.paths += /vendor/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090031namespace.default.asan.search.paths += /data/asan/odm/${LIB}
32namespace.default.asan.search.paths += /odm/${LIB}
Jiyong Parkd7e6cb22018-03-20 01:12:31 +090033
34###############################################################################
Nicolas Geoffrayad125602019-01-24 21:20:20 +000035# APEX related namespaces.
36###############################################################################
37
chenbruceaa87fd52019-01-24 13:01:21 +080038additional.namespaces = runtime,conscrypt,media,resolv
Nicolas Geoffrayad125602019-01-24 21:20:20 +000039
40# Keep in sync with ld.config.txt in the com.android.runtime APEX.
chenbruced7717402019-01-29 11:52:41 +080041# If a shared library or an executable requests a shared library that
42# cannot be loaded into the default namespace, the dynamic linker tries
43# to load the shared library from the runtime namespace.And then, if the
44# shared library cannot be loaded from the runtime namespace either, the
45# dynamic linker tries to load the shared library from the resolv namespace.
46# Finally, if all attempts fail, the dynamic linker returns an error.
chenbruceaa87fd52019-01-24 13:01:21 +080047namespace.default.links = runtime,resolv
48namespace.default.asan.links = runtime,resolv
Nicolas Geoffrayad125602019-01-24 21:20:20 +000049# Visible because some libraries are dlopen'ed, e.g. libopenjdk is dlopen'ed by
50# libart.
51namespace.default.visible = true
52namespace.default.link.runtime.shared_libs = libart.so:libartd.so
53namespace.default.link.runtime.shared_libs += libdexfile_external.so
54namespace.default.link.runtime.shared_libs += libnativebridge.so
55namespace.default.link.runtime.shared_libs += libnativehelper.so
56namespace.default.link.runtime.shared_libs += libnativeloader.so
Victor Chang785ba2e2019-01-15 18:04:56 +000057namespace.default.link.runtime.shared_libs += libandroidicu.so
58
59# TODO(b/122876336): Remove libpac.so once it's migrated to Webview
60namespace.default.link.runtime.shared_libs += libpac.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +000061
chenbruced7717402019-01-29 11:52:41 +080062# When libnetd_resolv.so can't be found in the default namespace, search for it
63# in the resolv namespace. Don't allow any other libraries from the resolv namespace
64# to be loaded in the default namespace.
chenbruceaa87fd52019-01-24 13:01:21 +080065namespace.default.link.resolv.shared_libs = libnetd_resolv.so
66
Nicolas Geoffrayad125602019-01-24 21:20:20 +000067###############################################################################
68# "runtime" APEX namespace
69#
70# This namespace exposes externally accessible libraries from the Runtime APEX.
71###############################################################################
72namespace.runtime.isolated = true
Nicolas Geoffraya9b4f2b2019-01-26 01:06:43 +000073namespace.runtime.visible = true
Nicolas Geoffrayad125602019-01-24 21:20:20 +000074
75# Keep in sync with ld.config.txt in the com.android.runtime APEX.
76namespace.runtime.search.paths = /apex/com.android.runtime/${LIB}
77namespace.runtime.asan.search.paths = /apex/com.android.runtime/${LIB}
78namespace.runtime.links = default
79# TODO(b/119867084): Restrict to Bionic dlopen dependencies and PALette library
80# when it exists.
81namespace.runtime.link.default.allow_all_shared_libs = true
82
83###############################################################################
84# "media" APEX namespace
85#
86# This namespace is for libraries within the media APEX.
87###############################################################################
88namespace.media.isolated = true
89namespace.media.visible = true
90
91namespace.media.search.paths = /apex/com.android.media/${LIB}
92namespace.media.asan.search.paths = /apex/com.android.media/${LIB}
93
Dongwon Kang3408eaa2019-02-22 00:47:13 -080094namespace.media.permitted.paths = /apex/com.android.media/${LIB}/extractors
95
Nicolas Geoffrayad125602019-01-24 21:20:20 +000096namespace.media.links = default
Dongwon Kang787e09a2019-03-07 10:05:23 -080097namespace.media.link.default.allow_all_shared_libs = true
Nicolas Geoffrayad125602019-01-24 21:20:20 +000098
99###############################################################################
100# "conscrypt" APEX namespace
101#
102# This namespace is for libraries within the conscrypt APEX.
103###############################################################################
104namespace.conscrypt.isolated = true
105namespace.conscrypt.visible = true
106
107# Keep in sync with ld.config.txt in the com.android.runtime APEX.
108namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB}
109namespace.conscrypt.asan.search.paths = /apex/com.android.conscrypt/${LIB}
Pete Bentley7b967bf2019-01-30 18:35:48 +0000110namespace.conscrypt.links = runtime,default
111namespace.conscrypt.link.runtime.shared_libs = libjavacore.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000112namespace.conscrypt.link.default.shared_libs = libc.so
113namespace.conscrypt.link.default.shared_libs += libm.so
114namespace.conscrypt.link.default.shared_libs += libdl.so
Tom Cherryfe1f7012019-02-08 11:55:36 -0800115namespace.conscrypt.link.default.shared_libs += liblog.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000116
117###############################################################################
chenbruceaa87fd52019-01-24 13:01:21 +0800118# "resolv" APEX namespace
119#
120# This namespace is for libraries within the resolv APEX.
121###############################################################################
122namespace.resolv.isolated = true
123namespace.resolv.visible = true
124
125namespace.resolv.search.paths = /apex/com.android.resolv/${LIB}
126namespace.resolv.asan.search.paths = /apex/com.android.resolv/${LIB}
127namespace.resolv.links = default
128namespace.resolv.link.default.shared_libs = libc.so
129namespace.resolv.link.default.shared_libs += libm.so
130namespace.resolv.link.default.shared_libs += libdl.so
131namespace.resolv.link.default.shared_libs += libbinder_ndk.so
Tom Cherryfe1f7012019-02-08 11:55:36 -0800132namespace.resolv.link.default.shared_libs += liblog.so
Dongwon Kang9dff5152019-02-08 14:00:35 -0800133namespace.resolv.link.default.shared_libs += libvndksupport.so
chenbruceaa87fd52019-01-24 13:01:21 +0800134
135###############################################################################
Jiyong Parkd7e6cb22018-03-20 01:12:31 +0900136# Namespace config for binaries under /postinstall.
137# Only one default namespace is defined and it has no directories other than
changho.shin715b1aa2018-11-28 15:15:16 +0900138# /system/lib and /product/lib in the search paths. This is because linker
139# calls realpath on the search paths and this causes selinux denial if the
140# paths (/vendor, /odm) are not allowed to the poinstall binaries.
141# There is no reason to allow the binaries to access the paths.
Jiyong Parkd7e6cb22018-03-20 01:12:31 +0900142###############################################################################
143[postinstall]
144namespace.default.isolated = false
changho.shin715b1aa2018-11-28 15:15:16 +0900145namespace.default.search.paths = /system/${LIB}
146namespace.default.search.paths += /product/${LIB}