Commit graph

14 commits

Author SHA1 Message Date
Treehugger Robot
dd70df2e69 Merge "Add more comments for resolv apex." 2019-01-30 13:56:30 +00:00
chenbruce
d771740030 Add more comments for resolv apex.
Describe the link of resolv apex detailedly.

Bug: 119527674
Test: make; flash; lsof -p $(pidof netd)
Change-Id: I0f6038eb9950c6b862a257d0a6f35f19cb83a328
2019-01-30 17:03:09 +08:00
Treehugger Robot
2d3ef2a22f Merge "Linker namespace configuration for the Resolv APEX." 2019-01-28 15:21:52 +00:00
Nicolas Geoffray
3ea7785ee9 Merge "Make runtime namespace visible." 2019-01-28 09:16:21 +00:00
chenbruce
aa87fd5f7d Linker namespace configuration for the Resolv APEX.
Support netd to load resolv Apex.
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.

Bug: 119527674
Test: make; flash; lsof -p $(pidof netd)
Test: 1. manual test datacall/wifi work
      2. manual test tethering work
      3. system/netd/tests/runtests.sh
Change-Id: I3f69e85f2f529636f0ef29a2d9d71ad582c46dfb
2019-01-28 16:42:58 +08:00
Jiyong Park
c84bbb0079 Remove permitted path for non-isolated namespace
No reason to have permitted path for non-isolated namespace.

Bug: 123303398
Test: N/A
Change-Id: Iaddb358efab7a2017c17f74ee53a9d711646b57c
2019-01-26 11:34:40 +09:00
Nicolas Geoffray
a9b4f2b66b Make runtime namespace visible.
So that ART can look it up by name.

Test: m && boots
Change-Id: Ib747a92e7decad2f9effe976a771a4eb0becc440
2019-01-26 01:06:43 +00:00
Dongwon Kang
0095e35fdd Add mediametrics to ld.config.legacy.txt
Test: TH
Bug: 119675363
Change-Id: Ic2fa2cf1931b40f0f476e8be797aa0db9a2582b7
2019-01-25 09:26:17 -08:00
Nicolas Geoffray
ad12560306 Add APEX namespaces in ld.config.legacy.txt.
Used by chrome-os and potentially automotive.

Test: m
Bug: 123092860
Bug: 123303398
Change-Id: I21d166d5866da2049aa5383ce856df329332e2a8
2019-01-24 21:20:47 +00:00
changho.shin
715b1aab50 Support product partition for non-treblized devices
Non-treblized devices use ld.config.legacy.txt, which does not
support product partition, leading to access denial from/to product partition.
Declare directly /product since search paths are resolved in linker config.

Test: m -j with non-treblized device upgraded to P.
Change-Id: Ic142b807f5dbffdfa5c774b3df8d0903b9626b6a
2018-11-28 17:17:05 +09:00
Jiyong Park
d7e6cb27b6 /postinstall/* does not search for a lib in /vendor or /odm
There has been no section in the linker config file for the binaries
under /postinstall. As a result, the binaries were run with the legacy
default config where /vendor/lib and /odm/lib are added to the search
paths. This is causing selinux denials as the binaries for OTA are not
allowed to access /vendor/lib or /odm/lib, but the dynamic linker calls
realpath(3) on the paths to canonicalize them.

Fixing the issue by letting /postinstall/* binaries to run with a
dedicated linker namespace config, where /vendor/lib and /odm/lib are
not added to the search paths. Not having the paths is okay because
he OTA binaries should not have dependency to the libs there.

Bug: 75287236
Test: do the OTA, selinux denials on postinstall_file is not shown
Test: above test should pass on  wahoo, marlin and pre-treble devices
Change-Id: I49c11a0929002adfef667890c0a375c2b41054f4
2018-03-20 10:12:00 +09:00
Jiyong Park
2498e1b1d3 Re-format ld.config.*.txt files
Re-format the files by splitting lines using +=.

Also add /odm/${LIB} where needed.

A few directories that are no longer required are removed from the
search paths and permitted paths.

Test: walleye and sailfish boots to the UI, renderscript, camera,
camcodder, sound, etc. are working.

Change-Id: I3150f0c3d35130d6b1a665e3f0813d33b1b7f546
2017-12-14 21:43:04 +09:00
Alin Jerpelea
fa7958e1fb add odm partition to ld.config.legacy
change is needed to be able to load libraries from /odm partition

/odm partition should have the lowest priority so that it can not override
the libraries from /vendor or /system partitions

Test: libraries are loaded ok.
Change-Id: Ifdfc22a3406ae3ad1fde53618d4120fd0498f615
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2017-12-01 06:14:11 +09:00
Jiyong Park
450cff4b68 Configure ld.config.txt for SP-HALs
Now, framework process (any process that is executing /system/bin/* or
/system/xbin/*) are started with three namespaces; default, sphal and
vndk.

default namespace is the namespace that is responsible for loading libs
from /system/lib. It can't load libs from other places such as
/vendor/lib. (However, we temporarily open the path since we haven't
finished the system partition cleanup, but will do eventually).

sphal namespace is the namespace where SP-HAL (Same-process HAL) is
loaded. SP-HAL are the only vendor libraries that are allowed to be
loaded inside framework processes. libEGL_<chipset>.so and
android.hardware.graphics.mapper@2.0-impl.so, etc are SP-HALs. When
framework needs to load those SP-HALs, it explicitly loads it from this
namespace using android_get_exported_namespace() and
android_dlopen_ext().

vndk namespace is the namespace for loading vndk-sp (Vendor-NDK for
Same-Process) libs, which is a small set of framework libraries that
SP-HALs can link against. These libraries are compiled for the same
version of Android that the vendor partition is compiled against.
SP-HALs can not use libraries other than vndk-sp and ndk libs.
Membership to vndk-sp and ndk are strictly closed.

Note that in a system, there are two copies of vndk-sp libs. One at
/system/lib and the other at /vendor/lib/vndk-sp. As a result, there can
be two instances of a same library in a process.

Also adds ld.config.legacy.txt which is used on non-Treble devices where
PRODUCT_FULL_TREBLE is not set to true.
Note, this split can be cleaned up further after b/37139976 is solved.

Bug: 34407260
Test: git diff HEAD:rootdir/etc/ld.config.legacy.txt
HEAD^:rootdir/etc/ld.config.txt => 0
Test: sailfish boots (because BOARD_VNDK_VERSION is not set to
'current')

Change-Id: I8331d94edc38f22c4f8abc66cdf2050af9d0605b
2017-04-14 16:39:36 +09:00