blob: 87926714a3a44046b96b868d13b954884b8e80d1 [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
Martin Stjernholmadf45032019-03-26 16:30:23 +000017# Fallback entry to provide APEX namespace lookups for binaries anywhere else.
18# This must be last.
19dir.legacy = /data
20
Jiyong Park450cff42017-04-05 14:24:14 +090021[legacy]
22namespace.default.isolated = false
Jiyong Park2498e1b2017-12-12 22:11:47 +090023
24namespace.default.search.paths = /system/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090025namespace.default.search.paths += /product/${LIB}
Jiyong Park2498e1b2017-12-12 22:11:47 +090026namespace.default.search.paths += /vendor/${LIB}
27namespace.default.search.paths += /odm/${LIB}
28
29namespace.default.asan.search.paths = /data/asan/system/${LIB}
30namespace.default.asan.search.paths += /system/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090031namespace.default.asan.search.paths += /data/asan/product/${LIB}
32namespace.default.asan.search.paths += /product/${LIB}
Jiyong Park2498e1b2017-12-12 22:11:47 +090033namespace.default.asan.search.paths += /data/asan/vendor/${LIB}
34namespace.default.asan.search.paths += /vendor/${LIB}
changho.shin715b1aa2018-11-28 15:15:16 +090035namespace.default.asan.search.paths += /data/asan/odm/${LIB}
36namespace.default.asan.search.paths += /odm/${LIB}
Jiyong Parkd7e6cb22018-03-20 01:12:31 +090037
38###############################################################################
Nicolas Geoffrayad125602019-01-24 21:20:20 +000039# APEX related namespaces.
40###############################################################################
41
chenbruceaa87fd52019-01-24 13:01:21 +080042additional.namespaces = runtime,conscrypt,media,resolv
Nicolas Geoffrayad125602019-01-24 21:20:20 +000043
44# Keep in sync with ld.config.txt in the com.android.runtime APEX.
chenbruced7717402019-01-29 11:52:41 +080045# If a shared library or an executable requests a shared library that
46# cannot be loaded into the default namespace, the dynamic linker tries
Roland Levillaine51c8762019-03-07 19:06:57 +000047# to load the shared library from the runtime namespace. And then, if the
chenbruced7717402019-01-29 11:52:41 +080048# shared library cannot be loaded from the runtime namespace either, the
49# dynamic linker tries to load the shared library from the resolv namespace.
50# Finally, if all attempts fail, the dynamic linker returns an error.
chenbruceaa87fd52019-01-24 13:01:21 +080051namespace.default.links = runtime,resolv
52namespace.default.asan.links = runtime,resolv
Nicolas Geoffrayad125602019-01-24 21:20:20 +000053# Visible because some libraries are dlopen'ed, e.g. libopenjdk is dlopen'ed by
54# libart.
55namespace.default.visible = true
Martin Stjernholm5c074e02019-03-01 14:14:58 +000056namespace.default.link.runtime.shared_libs = libdexfile_external.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +000057namespace.default.link.runtime.shared_libs += libnativebridge.so
58namespace.default.link.runtime.shared_libs += libnativehelper.so
59namespace.default.link.runtime.shared_libs += libnativeloader.so
Victor Chang785ba2e2019-01-15 18:04:56 +000060namespace.default.link.runtime.shared_libs += libandroidicu.so
61
62# TODO(b/122876336): Remove libpac.so once it's migrated to Webview
63namespace.default.link.runtime.shared_libs += libpac.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +000064
chenbruced7717402019-01-29 11:52:41 +080065# When libnetd_resolv.so can't be found in the default namespace, search for it
66# in the resolv namespace. Don't allow any other libraries from the resolv namespace
67# to be loaded in the default namespace.
chenbruceaa87fd52019-01-24 13:01:21 +080068namespace.default.link.resolv.shared_libs = libnetd_resolv.so
69
Nicolas Geoffrayad125602019-01-24 21:20:20 +000070###############################################################################
71# "runtime" APEX namespace
72#
73# This namespace exposes externally accessible libraries from the Runtime APEX.
74###############################################################################
75namespace.runtime.isolated = true
Nicolas Geoffraya9b4f2b2019-01-26 01:06:43 +000076namespace.runtime.visible = true
Nicolas Geoffrayad125602019-01-24 21:20:20 +000077
78# Keep in sync with ld.config.txt in the com.android.runtime APEX.
79namespace.runtime.search.paths = /apex/com.android.runtime/${LIB}
80namespace.runtime.asan.search.paths = /apex/com.android.runtime/${LIB}
81namespace.runtime.links = default
Martin Stjernholm609236f2019-02-27 21:40:42 +000082# Need allow_all_shared_libs because libart.so can dlopen oat files in
83# /system/framework and /data.
84# TODO(b/130340935): Use a dynamically created linker namespace similar to
85# classloader-namespace for oat files, and tighten this up.
Nicolas Geoffrayad125602019-01-24 21:20:20 +000086namespace.runtime.link.default.allow_all_shared_libs = true
87
88###############################################################################
89# "media" APEX namespace
90#
91# This namespace is for libraries within the media APEX.
92###############################################################################
93namespace.media.isolated = true
94namespace.media.visible = true
95
96namespace.media.search.paths = /apex/com.android.media/${LIB}
97namespace.media.asan.search.paths = /apex/com.android.media/${LIB}
98
Dongwon Kang3408eaa2019-02-22 00:47:13 -080099namespace.media.permitted.paths = /apex/com.android.media/${LIB}/extractors
100
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000101namespace.media.links = default
Dongwon Kanga013e3d2019-03-15 14:43:07 -0700102namespace.media.link.default.shared_libs = libandroid.so
103namespace.media.link.default.shared_libs += libbinder_ndk.so
104namespace.media.link.default.shared_libs += libc.so
Yifan Hong063b6be2019-03-29 13:17:35 -0700105namespace.media.link.default.shared_libs += libcgrouprc.so
Dongwon Kanga013e3d2019-03-15 14:43:07 -0700106namespace.media.link.default.shared_libs += libdl.so
107namespace.media.link.default.shared_libs += liblog.so
108namespace.media.link.default.shared_libs += libmediametrics.so
109namespace.media.link.default.shared_libs += libmediandk.so
110namespace.media.link.default.shared_libs += libm.so
111namespace.media.link.default.shared_libs += libvndksupport.so
112
113namespace.media.link.default.shared_libs += libclang_rt.asan-aarch64-android.so
114namespace.media.link.default.shared_libs += libclang_rt.asan-arm-android.so
115namespace.media.link.default.shared_libs += libclang_rt.asan-i686-android.so
116namespace.media.link.default.shared_libs += libclang_rt.asan-x86_64-android.so
117namespace.media.link.default.shared_libs += libclang_rt.hwasan-aarch64-android.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000118
119###############################################################################
120# "conscrypt" APEX namespace
121#
122# This namespace is for libraries within the conscrypt APEX.
123###############################################################################
124namespace.conscrypt.isolated = true
125namespace.conscrypt.visible = true
126
127# Keep in sync with ld.config.txt in the com.android.runtime APEX.
128namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB}
129namespace.conscrypt.asan.search.paths = /apex/com.android.conscrypt/${LIB}
Pete Bentley7b967bf2019-01-30 18:35:48 +0000130namespace.conscrypt.links = runtime,default
Pete Bentleycc6c50a2019-03-21 17:13:14 +0000131namespace.conscrypt.link.runtime.shared_libs = libandroidio.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000132namespace.conscrypt.link.default.shared_libs = libc.so
133namespace.conscrypt.link.default.shared_libs += libm.so
134namespace.conscrypt.link.default.shared_libs += libdl.so
Tom Cherryfe1f7012019-02-08 11:55:36 -0800135namespace.conscrypt.link.default.shared_libs += liblog.so
Nicolas Geoffrayad125602019-01-24 21:20:20 +0000136
137###############################################################################
chenbruceaa87fd52019-01-24 13:01:21 +0800138# "resolv" APEX namespace
139#
140# This namespace is for libraries within the resolv APEX.
141###############################################################################
142namespace.resolv.isolated = true
143namespace.resolv.visible = true
144
145namespace.resolv.search.paths = /apex/com.android.resolv/${LIB}
146namespace.resolv.asan.search.paths = /apex/com.android.resolv/${LIB}
147namespace.resolv.links = default
148namespace.resolv.link.default.shared_libs = libc.so
Yifan Hong063b6be2019-03-29 13:17:35 -0700149namespace.resolv.link.default.shared_libs += libcgrouprc.so
chenbruceaa87fd52019-01-24 13:01:21 +0800150namespace.resolv.link.default.shared_libs += libm.so
151namespace.resolv.link.default.shared_libs += libdl.so
152namespace.resolv.link.default.shared_libs += libbinder_ndk.so
Tom Cherryfe1f7012019-02-08 11:55:36 -0800153namespace.resolv.link.default.shared_libs += liblog.so
Dongwon Kang9dff5152019-02-08 14:00:35 -0800154namespace.resolv.link.default.shared_libs += libvndksupport.so
chenbruceaa87fd52019-01-24 13:01:21 +0800155
156###############################################################################
Jiyong Parkd7e6cb22018-03-20 01:12:31 +0900157# Namespace config for binaries under /postinstall.
158# Only one default namespace is defined and it has no directories other than
changho.shin715b1aa2018-11-28 15:15:16 +0900159# /system/lib and /product/lib in the search paths. This is because linker
160# calls realpath on the search paths and this causes selinux denial if the
161# paths (/vendor, /odm) are not allowed to the poinstall binaries.
162# There is no reason to allow the binaries to access the paths.
Jiyong Parkd7e6cb22018-03-20 01:12:31 +0900163###############################################################################
164[postinstall]
165namespace.default.isolated = false
changho.shin715b1aa2018-11-28 15:15:16 +0900166namespace.default.search.paths = /system/${LIB}
167namespace.default.search.paths += /product/${LIB}