Commit graph

47 commits

Author SHA1 Message Date
Daichi Hirono
e76c0d2816 Add a link from runtime ns to the neuralnetworks ns
libneuralnetworks.so could be preloaded. In that case, it should be
accessible from libnativeloader which runs in the art namespace.

Bug: 141847343
Bug: 142089311
Test: m, cheets2 boots
Change-Id: I8710b624dff131f5cb797d53915f6597e3017c34
2019-10-09 07:43:52 +00:00
Martin Stjernholm
752a1e0408 Rename the runtime linker namespace following ART/Runtime APEX split.
Remove the kludge in libnativeloader to deal with the inconsistency wrt the
name of the APEX package.

Test: Build & boot
Test: atest system/core/libnativeloader (on cf_x86_phone)
Bug: 139408016
Change-Id: I6115b49237c78c2ea4aa943ca4fe0b296b5a2b62
2019-10-07 12:14:57 +01:00
Przemyslaw Szczepaniak
5cdf2ef310 Merge "Add libneuralnetworks_packageinfo to neuralnetworks apex dependencies." 2019-09-24 15:08:09 +00:00
Martin Stjernholm
59b54f42bb Revert "Include com.android.runtime in the "runtime" linker namespace."
No longer required for hwasan builds, since b/140790209 is fixed.

This reverts change-id I27069b20f7c7068b931340f548b284ce1676466c.

This also reverts the identified change for the memory regression in
b/140648539.

Test: Build & boot on taimen_hwasan-userdebug
Test: Build & boot on crosshatch_hwasan-userdebug
Bug: 140790209
Bug: 139408016
Bug: 140648539
Change-Id: Ib61c53571a4de0970a86ebc391a2ce780247943a
2019-09-19 19:11:47 +01:00
Przemyslaw Szczepaniak
6122bc0037 Add libneuralnetworks_packageinfo to neuralnetworks apex dependencies.
Test: build & flash crosshatch
Bug: 139282353
Change-Id: Ia67aa4f74b1b7fe4f730995c42feb935cb3cd6c8
2019-09-17 16:35:58 +01:00
Martin Stjernholm
391332d276 Include com.android.runtime in the "runtime" linker namespace.
This is a temporary fix to keep the Bionic-associated libraries accessible
in the runtime namespace, pending a proper namespace split.

Test: Build & boot with taimen_hwasan-userdebug
Bug: 139408016
Bug: 139916951
Exempt-From-Owner-Approval: Approved internally
Change-Id: I27069b20f7c7068b931340f548b284ce1676466c
Merged-In: I27069b20f7c7068b931340f548b284ce1676466c
2019-08-30 17:47:31 +01:00
Martin Stjernholm
df96e1f25c Update paths and names for the new ART APEX.
Test: Build & boot
Test: atest CtsJniTestCases
Bug: 135753770
Exempt-From-Owner-Approval: Approved internally
Change-Id: Ic59b7bc8aae7ce521cf3ec9df4ab72aa611d0b75
Merged-In: Ic59b7bc8aae7ce521cf3ec9df4ab72aa611d0b75
2019-08-30 17:47:31 +01:00
Przemyslaw Szczepaniak
0bb871dc9f ld.config for com.android.neuralnetworks APEX.
Makes updated libneuralnetworks.so in /apex/com.android.neuralnetworks/{LIB}
loadable from all relevant namespaces.

Test: Verified that right library is being loaded using lsof and
Test: verbose debug logs from bionic/ld.
Bug: 137320025
Change-Id: I38140bb9915a3f85f10456e15ed0f492dbdba802
2019-07-22 11:28:42 +01:00
Martin Stjernholm
0d28abc5b1 Update TODOs for ICU library links.
Test: Presubmit boot test
Bug: 120786417
Bug: 134659294
Change-Id: I362e0e67c5adfd510dda12bed52629af92bfcc3d
2019-06-06 14:11:04 +01:00
Victor Chang
0c7edece94 Allow linking to libicuuc.so and libicui18n.so from executable in /data
Executable in /data/ runs in default linker namespace, not
classloader namespace.
In Q, we moved libicuuc.so and libicui18n into the runtime
namespace, and allow linking from runtime namespace and classloader
namespace.

This change further allows linking from default namespace, and tries
to fix the regression temporarily.

Bug: 130788466
Test: The app issue is fixed after this CL
Change-Id: Ifae52b554124514e433cfe78875643a7450fbabd
2019-05-14 20:22:34 +01:00
Martin Stjernholm
c57ed29dd5 Reland: Fix libnativeloader to correctly link to the platform namespace.
This relands http://r.android.com/951440:

This affected binaries in the Runtime APEX, where the platform namespace is
"platform" rather than "default".

Also extend ANDROID_ADDITIONAL_PUBLIC_LIBRARIES to create links to both to
platform and runtime namespaces, so that it can be used to open up access to
internal libraries in the Runtime APEX as well, which is used by ART gtests
and run tests.

Also update some comments in the ld.config*.txt files to accurately explain
why some namespaces need to be visible, and some other minor changes for
consistency. There are no semantically significant changes in those files.

Test: Flash and boot
Test: Run an ART run test with the internal libarttest.so library
Test: lunch aosp_cf_x86_phone-eng;
  atest android.compilation.cts.AdbRootDependentCompilationTest#testCompile_curProfile \
    com.android.cts.dexmetadata.InstallDexMetadataHostTest#testProfileSnapshotAfterInstall \
    installd_dexopt_test
Bug: 130293232
Bug: 121117762
Change-Id: I3d9f2102a03e83843e15bc78b5ad347220c52769
2019-05-01 16:46:06 +01:00
Martin Stjernholm
8a50dad467 Add linker entries for the new libdexfiled_external.so.
Follow up to http://r.android.com/943476. This library is only available in
debug builds of the Runtime APEX.

Test: Flash and boot with eng build
Change-Id: I260f9b838f44ba3f8976c117d9e42fc456239e88
2019-04-30 16:11:30 +01:00
Martin Stjernholm
b9259a9cbe Revert "Fix libnativeloader to correctly link to the platform namespace."
This reverts commit 4ca0ca67bf.

Reason for revert: Breaks android.compilation.cts.AdbRootDependentCompilationTest#testCompile_curProfile and others: http://g/art-team/R2nEDA1Ka_s

Change-Id: Ia6285648133d21e61040efafc73cac97d702a7c4
2019-04-29 20:57:16 +00:00
Martin Stjernholm
4ca0ca67bf Fix libnativeloader to correctly link to the platform namespace.
This affected binaries in the Runtime APEX, where the platform namespace is
"platform" rather than "default".

Also extend ANDROID_ADDITIONAL_PUBLIC_LIBRARIES to create links to both to
platform and runtime namespaces, so that it can be used to open up access to
internal libraries in the Runtime APEX as well, which is used by ART gtests
and run tests.

Also update some comments in the ld.config*.txt files to accurately explain
why some namespaces need to be visible, and some other minor changes for
consistency. There are no semantically significant changes in those files.

Test: Flash and boot
Test: Run an ART run test with the internal libarttest.so library
Bug: 130293232
Bug: 121117762
Change-Id: I7ebaf5370dd0f533b1bb5f0e67e7c3c1df48e512
2019-04-29 13:09:08 +01:00
Dongwon Kang
5744cc4e99 Fix a warning on namespace.media.link.default.shared_libs
Test: build & dumpsys media.extractor
Bug: 130882530
Change-Id: Ifd46858b5a864f0fbed87baa3321f233ea12954e
Merged-In: Ifd46858b5a864f0fbed87baa3321f233ea12954e
2019-04-23 23:15:24 +00:00
Dongwon Kang
4b2b76e101 Remove libandroid.so from media namespace.
Test: adb shell dumpsys media.extractor
Bug: 130637522
Change-Id: I6bcdac60a740d19a97bbac19e6339e0552b0d572
Merged-In: Ia6366834613d1e12498fa90377e79f62a2149776
2019-04-17 18:05:51 +00:00
Martin Stjernholm
609236f66c Describe the reason for the allow_all_shared_libs from the runtime namespace
better.

Test: N/A - comment change only
Bug: 119867084
Change-Id: I80743236f95cedc43b8f80ac32a09ac0094f779e
2019-04-11 13:54:44 +01:00
Yifan Hong
063b6beef0 Add libcgrouprc to ld.config.*.txt.
Test: boots (sanity)
Bug: 123664216
Change-Id: I23c3ece44816e4e213f9630b915e19978a259823
Merged-In: I23c3ece44816e4e213f9630b915e19978a259823
2019-04-02 22:31:57 -07:00
Martin Stjernholm
60de348654 Merge "Apply the standard system linker config to all of /data." 2019-03-28 12:37:29 +00:00
Martin Stjernholm
adf4503de1 Apply the standard system linker config to all of /data.
This is necessary to get the correct APEX namespace setup for apps that
executes binaries from there.

In older releases no linker config applied to binaries in /data, so the
fallback config in /system/bin/linker was used, which basically just looked
up libraries in /system/{lib,lib64}. With the introduction of APEXes that
location no longer contains the complete set of libraries, so this is
necessary to retain functional parity.

Strictly speaking this fallback rule should apply as last resort for a
binary in any location, but the linker does not accept "dir.system = /".

Test: Flash and boot
Test: The app regression in b/128569634
Bug: 128569634
Change-Id: Icfcd66f0a7d8d898618be1b6186bb1111d20d688
2019-03-26 18:10:51 +00:00
Martin Stjernholm
5c074e0ab9 Remove links to libart(d).so in the runtime.
They are not needed since the binaries and relevant exported libraries have
moved to the Runtime APEX.

Test: Flash and boot
Test: atest CtsJniTestCases CtsJdwpTestCases
Bug: 119867084
Change-Id: If416fbae7057aec02059bb31a4dcd8b63dcc0cad
2019-03-26 17:24:12 +00:00
Pete Bentley
cc6c50a123 Tighten native API surface.
AsynchronousCloseMonitor is moved into libandroidio by
r.android.com/910073 and so libjavacore no longer needs to
be linked to the conscrypt namespace.

Bug: 123744297
Test: m && flashall
Test: atest CtsLibcoreOkHttpTestCases
Test: atest CtsLibcoreTestCases
Change-Id: Id720b59e4ef42a2c0226b497a1cc3c54f7a837d0
2019-03-21 17:13:14 +00:00
Roland Levillain
5c99a0c067 Include tests directories in the linker legacy configuration.
Make ld.config.legacy.txt similar to other linker configurations with
respect to tests in /data/{nativetest,benchmarktest}{,64}.

Note: The linker legacy configuration is used by the ART generic build
targets, defined in project device/generic/art.

Test: ART chroot-based on-device testing using the master-art
Bug: 121117762
Change-Id: I6c8fafa2568862e450aa7b9fea1177a184cb9705
2019-03-18 19:07:32 +00:00
Dongwon Kang
a013e3d53d List stable libraries media apex relies on.
With allow_all_shared_libs, the libs under /system/lib may be used
instead of libs included in the apex. This change adds stable libraries
the media apex relies on to prevent this case.

Test: dumpsys media.extractor, atest MediaPlayer2Test
Bug: 127791685

Change-Id: I6a0419e6da9e9f48a394257b1e8f977ec2dfa9a1
2019-03-15 17:23:03 -07:00
Roland Levillain
ecef987a35 Merge "Fix a typo in linker configuration comments." 2019-03-08 11:48:43 +00:00
Roland Levillain
e51c87634a Fix a typo in linker configuration comments.
Test: n/a
Change-Id: I3fa36094cf3eb45b0e1400712f22b8477a096b59
2019-03-07 19:06:57 +00:00
Dongwon Kang
787e09a1de allow_all_shared_libs for media namespace in ld.config.legacy.txt
This is a temporal fix. With this change, the extractor plug-ins uses
unstable libs under /system/lib[64]. The right resolution is being
discussed.

Test: applied the same change to ld.config.txt and checked
      the memory map of media.extractor on cuttlefish.
Bug: 127791685

Change-Id: Ifd5b79831f27ef4017bb8aa774671aa9b2c5264e
2019-03-07 10:14:02 -08:00
Dongwon Kang
3408eaa914 Add permitted path in media namesapce for extractor process.
Test: build, boot, dumpsys media.extractor
Bug: 125134086
Change-Id: I5ed67d7d8d3ad7abf2cff7da8f33fdaab842acff
2019-02-22 01:16:54 -08:00
Tom Cherry
fe1f701761 liblog: add stubs variant
Ensure that only the symbols in liblog.map.txt can be used by the
platform.

Bug: 123349183
Test: build
Change-Id: I99ae5d0e8ba8f5061ec20701c941d861c9eb615d
2019-02-20 12:32:12 -08:00
vichang
ce912aadda Merge changes from topic "dup_icu4c"
* changes:
  Linker namespace changes for moving ICU4C to APEX
  Remove the public libs in runtime namespace
2019-02-19 10:14:31 +00:00
Victor Chang
785ba2e68e Linker namespace changes for moving ICU4C to APEX
libandroidicu is used by various libraries, e.g. libxml2, minikin.
Thus, expose libandroidicu to default namespace.

libpac is only used by libjni_pacprocessor (part of framework).

libicuuc, libicui18n are not exposed to default namespace,
because everyone else, except app, should use libandroidicu.
They are exposed to classloader namespace from runtime namespace
via the work done in libnativeloader in http://r.android.com/887453
b/120786417 has more details about these 2 libraries.

Bug: 120659668
Test: m droid
Change-Id: I2cd3378f1eb94b7bb1c942738b59d7e577a5f8f0
2019-02-14 10:42:27 +00:00
Dongwon Kang
9dff515bdb Exclude libvndksupport from APEXes.
Test: build, boot, and checked mount paths.
Bug: 123948402
Change-Id: I687dde4f3d1a7971f68c7c536de5002dcdaecfa4
2019-02-11 11:14:11 -08:00
Pete Bentley
7b967bf6cf Export libjavacore into the conscrypt linker namespace.
Needed to allow access to AsynchronousCloseMonitor.

Bug: 123121395
Bug: 122881655
Test: atest CtsLibcoreOkHttpTestCases:com.squareup.okhttp.CallTest
Change-Id: I1c73a9beb7a083a61ed52e437d7377b2486a34f7
2019-01-31 11:06:41 +00:00
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