Commit graph

1775 commits

Author SHA1 Message Date
Jiyong Park
60a2966fc9 Do not use versioned VNDK directory in vendor partition
Paths for extended VNDK libs don't need version suffix, because there
always is the single version that the vendor(odm) modules are built
against.

Bug: 70601582
Test: walleye boots to the UI.
Test: No further test is possible since we don't have extended VNDK yet
in our source tree.

Change-Id: Idbf4bb820ddb136d00744f64ddf6ebe6442ad16e
2017-12-14 21:43:04 +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
Logan Chien
97772e425b android.hardware.graphics.allocator@2.0 is no longer VNDK-SP
The interface lib has been in VNDK-SP because
android.hardware.graphics.mapper@1.0 was using it. However, since the
dependency has gone [1], there is no need keep it in VNDK-SP. The
VNDK-SP set should be kept as small as possible because libs in VNDK-SP
are subject to double-loading.

[1] 79d13ff0f5

Bug: 69480083
Test: /system/lib64/vndk-sp/android.hardware.graphics.allocator@2.0.so
disappears.
Test: sailfish boots

Change-Id: I0e6518f169dd620d6b1a9ada47754e371ef4a739
Merged-In: I0e6518f169dd620d6b1a9ada47754e371ef4a739
(cherry picked from commit 9d898f3678)
2017-12-13 17:05:14 +09:00
Treehugger Robot
5dde5e38d2 Merge "/vendor/priv-app is added to the permitted paths for the default ns" 2017-12-13 02:34:19 +00:00
Vishwath Mohan
32c03800c0 Merge "Fix asan permitted paths in the default namespace." 2017-12-13 02:08:30 +00:00
Justin Yun
210ff9485d Add VNDK version for namespace configuration files
If PLATFORM_VNDK_VERSION is set to a version other than "current",
add the version to the file names of the namespace configuration
files.

Bug: 69883025
Test: device boot
Change-Id: I27377549581125b6c750c1422d0ee4a607dda5e8
2017-12-13 10:31:04 +09:00
Vishwath Mohan
cede134907 Fix asan permitted paths in the default namespace.
This CL fixes an error with the asan permitted paths in
ld.config.txt.in.

Bug: 63927538
Test: lunch walleye_asan-userdebug && m -j40
Change-Id: Ica0504cb52ef6e6b3e4ce2deae3ce5984e38cc93
2017-12-12 16:17:41 -08:00
Jiyong Park
b52ff3e247 Use normalize-path-list
Let's use the existing macro.

Test: build walleye, boots to the UI.
Change-Id: Ic23d3454c629a02bfd96d0ca19c0c5c068ae7a03
2017-12-12 12:13:38 +09:00
Treehugger Robot
e78accb103 Merge "ASAN: Remove old list of services" 2017-12-12 00:15:31 +00:00
Andreas Gampe
27b8fcdfcf ASAN: Remove old list of services
Remove list of services and support for asan.options. This has not
been used in a while, and there is contention about listing names
of device-specific services.

Bug: 70387666
Test: m
Change-Id: I766c6b3a0c44b6b992a3259a3c4215a688452907
2017-12-11 11:36:17 -08:00
Justin Yun
44bb46f604 Use versioned VNDK directories in ld.config.txt
All vndk/vndk-sp directories will have version suffix if
"ro.vndk.version" is set.

Bug: 69984421
Bug: 66074376
Test: Build with BOARD_VNDK_VERSION=current and
      BOARD_VNDK_RUNTIME_DISABLE=true. Check boot.

Change-Id: I03849f9f96bc6c7880aa70c517e963aab4e033b8
2017-12-11 10:58:51 +09:00
Treehugger Robot
fd3225492b Merge "Fix media on W/T" 2017-12-09 00:48:52 +00:00
Treehugger Robot
b07cc5e0c0 Merge changes I3978cbe2,I7b8e1232
* changes:
  Reland "Prevent vendors from accessing private VNDK libs"
  Permitted and search path change
2017-12-08 00:50:34 +00:00
Elliott Hughes
3289b9c928 Merge "Add OWNERS." 2017-12-07 23:21:26 +00:00
Elliott Hughes
693d63f9cf Add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
2017-12-07 13:30:03 -08:00
Elliott Hughes
dcc0f8f76b Merge "Add a /bin symlink for convenience." 2017-12-07 16:55:25 +00:00
Jiyong Park
d083db9bc9 /vendor/priv-app is added to the permitted paths for the default ns
We will have apps under /vendor/priv-app. Add the path to the permitted
paths so that the apks and so libs under the directory can be loaded.

Bug: 35301609
Test: None since we don't have priv vendor app yet.
Change-Id: Ida998adb2e180852b1922e9933f25b988517399e
2017-12-07 18:31:18 +09:00
Marco Nelissen
4ad1a34289 Fix media on W/T
W/T enforce restrictions on linker paths, which M/S do not.
Because of this, media.extractor was unable to load its extractors on W/T.

Bug: 67405932
Test: play sounds successfully
Merged-In: I8914da74780c909da815beaffcd4d76fbe2cc6b5
Change-Id: I8914da74780c909da815beaffcd4d76fbe2cc6b5
(cherry picked from commit 593b43910b)
2017-12-07 18:30:47 +09:00
Jiyong Park
ad7ddd5a02 Reland "Prevent vendors from accessing private VNDK libs"
This reverts commit 875fe42a81.

... and fixes a bug that private VNDK libs are not accessible even to
RenderScript framework libraries (such as libRS_internal.so). This is
fixed by exceptionally allowing the private libs only to 'rs'
namespace.

Bug: 70260989
Bug: 70279973
Bug: 63878960
Test: Build for walleye and tested Photos edit.
Test: other renderscript app (camerascript) works as well
Merged-In: I3978cbe2e869f6a1c214c755ded038349bde7b6b
Change-Id: I3978cbe2e869f6a1c214c755ded038349bde7b6b
(cherry picked from commit 781c47f4da)
2017-12-07 13:44:46 +09:00
Sundong Ahn
e93d7f9941 Permitted and search path change
The permitted and search paths should be changed according to VNDK version.
However these paths are fixed with vndk and vndk-sp. So I define the
directory name as below
- /system/${LIB}/vndk${VNDK_VERSION}
- /system/${LIB}/vndk-sp${VNDK_VERSION}
${VNDK_VERSION} will be set by the property "ro.vndk.version".

Bug: 66074376
Test: build & run
Merged-In: I7b8e12327af89d131c4c49cb9b459a393c7dacb8
Change-Id: I7b8e12327af89d131c4c49cb9b459a393c7dacb8
(cherry picked from commit 85c773f0a2)
2017-12-07 13:44:29 +09:00
Jiyong Park
74857cccd2 Remove *.dep files for ld.config.txt, [llndk|vndksp].libraries.txt
The dep files are not required because change in the command line
triggers the rule.

Test: m -j ld.config.txt llndk.libraries.txt vndksp.libraries.txt
Re-run the build after adding or removing libs to/from the vndk set.
The txt files are updated accordingly.

Merged-In: I9c9e22088cc2afeb66e8b159f611b25d698cf800
Change-Id: I9c9e22088cc2afeb66e8b159f611b25d698cf800
(cherry picked from commit 81088bf131)
2017-12-07 03:06:52 +00:00
Elliott Hughes
ff1ef9f2b1 Add a /bin symlink for convenience.
We already have /etc and /sbin. As the Android world moves towards / being
on the system partition, the circumstances under which a /bin symlink
won't work are reduced. This should already be usable most of the time.

Bug: http://b/63142920
Test: `adb shell /bin/date`
Change-Id: I81c2209ae808ced186d05fbe1d5417ce8dd93ea7
2017-12-06 08:59:02 -08:00
Alin Jerpelea
6ba4207461 Merge "add odm partition to ld.config.legacy"
am: cc06663c04

Change-Id: I4251acfd4d37b09041aedfdbf926da0d2e64ff67
2017-12-06 04:10:24 +00: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
Steven Moreland
6cf3cd2288 Merge "ld.config.txt.in typo: absolution -> absolute"
am: 34778d24ae

Change-Id: Ib541b7b0f3e5162845f49673e65cac5ab1fc909d
2017-11-29 17:57:34 +00:00
Steven Moreland
ab338c10e6 ld.config.txt.in typo: absolution -> absolute
Test: none
Change-Id: I247722c0881fa733226eec6578f17b1a481d1e91
2017-11-28 12:42:19 -08:00
Jiyong Park
e04e4e7dfe add llndk|vndksp.libraries.txt to vndk_package
List of llndk and vndk-sp libraries are written in the txt file so that
they can be available at run-time. The information is used by
libnativeloader to configure the classloader-namespace specially for
vendor apks.

Bug: 64882323
Test: build 2017 pixel devices. check that the two files exist on
/system/etc.

Merged-In: Ifbe339a5862f6ef57a8213a14a022765ccf77283
Change-Id: Ifbe339a5862f6ef57a8213a14a022765ccf77283
(cherry picked from commit 26335f89b1)
2017-11-28 01:29:30 +00:00
Vishnu Nair
4d736b5fa5 Merge "Create location to store surface and window trace files on init"
am: 3dfba33d67

Change-Id: Ibcd26a9644e954d4e9fa5be1d538e45c44fcd1b9
2017-11-27 21:26:25 +00:00
Treehugger Robot
3dfba33d67 Merge "Create location to store surface and window trace files on init" 2017-11-27 21:17:07 +00:00
Vishnu Nair
d09ab7a217 Create location to store surface and window trace files on init
Bug: 64831661
Test: adb shell su root rm /data/misc/wmtrace && adb reboot && adb shell su ls /data/misc/wmtrace
Change-Id: I60979c26a9226534df534abd3d59df309f6ea6ad
2017-11-27 09:54:31 -08:00
Tom Cherry
4b3bcf2a10 Merge "Move mkdir /data/nfc/... to rootdir init.rc"
am: fa65396ca2

Change-Id: I623f24df9b42500f347ae427f4ffd94395abaa56
2017-11-22 20:03:47 +00:00
Tom Cherry
fa65396ca2 Merge "Move mkdir /data/nfc/... to rootdir init.rc" 2017-11-22 19:56:10 +00:00
Chen Xu
df482d03ad Merge "a new folder to store OTA carrier id update"
am: 76adcdf688

Change-Id: I052a0810830b2a81a8a992d66e8e59cda343b347
2017-11-22 04:35:44 +00:00
fionaxu
06b8e2e130 a new folder to store OTA carrier id update
Bug:64131637
Test: Build
Change-Id: I0ce4322f297bab427d70aed3c329345c899786bb
(cherry picked from commit 45713ff621)
2017-11-21 17:31:00 -08:00
Tom Cherry
c319310f9b Move mkdir /data/nfc/... to rootdir init.rc
These are directories used by the system so they should be created by
the system.

Test: treehugger
Change-Id: I2a721ef7871c8842fa912497f5ec6988fcec9e58
2017-11-21 10:40:25 -08:00
Xin Li
23e27db576 Merge commit 'a63ccea6abc7ea02e2d98e41c80793ca97237bd3' from
oc-mr1-dev-plus-aosp into stage-aosp-master

Change-Id: Ia33311cd1fd26dfaea59a69317b306fb91203c40
Merged-In: I03d06b10807e8a313c9654c2e1db36bfb59e3f99
2017-11-14 13:19:45 -08:00
Treehugger Robot
c437e14c17 Merge "PRODUCT_TREBLE_LINKER_NAMESPACES for ld.config.txt" 2017-11-13 21:06:34 +00:00
Steven Moreland
4e641e3b6a PRODUCT_TREBLE_LINKER_NAMESPACES for ld.config.txt
PRODUCT_FULL_TREBLE is being deprecated in favor
of smaller flags. Use the appropriate one instead.

Bug: 62019611
Test: manual
Change-Id: Id5d127c29f908cd3011031b3b698ddec3dcba9c1
2017-11-10 10:25:45 -08:00
Tianjie Xu
74fa3cab4e Create a new directory on boot for update_engine logs
Partners require to access update_engine's logs on the file system with
non-root permission.

Bug: 65568605
Test: directory created with the correct permission on boot
Change-Id: I1c1fb4acb8b0f2e7352ffa9e7d05a864940b5986
2017-11-09 12:11:28 -08:00
Jiyong Park
a2935e0c8b Tests are run with proper namespace configs by their locations
Tests in /data/[nativetest|benchmarktest] run with namespace config for
system and tests in /data/[nativetest|benchmarktest]/vendor run with
namespace config for vendor.

They no longer run in the 'test' namespace config which didn't impose
any restriction for libraries.

Bug: 67028906
Test: sailfish/marlin builds and boots
Test: no VTS regression on system.img from GSI + vendor.img from
marlin/sailfish
Test: VtsKernelLibcutilsTest successful in above config

Merged-In: I28cdef960d087565c8a22dca0e9a154fb1c3bb94
Change-Id: I28cdef960d087565c8a22dca0e9a154fb1c3bb94
(cherry picked from commit 326b783ad9)
2017-10-30 10:27:45 +09:00
Jiyong Park
6ed1a1c339 Fix: make vndk namespace visible for 2016 Pixes
The nativeloader tries to find the 'vndk' namespace when there is a
vendor apk in the classloader paths. This can happen even for a
downloaded app if the app is using a vendor apk via <uses-library> tag.

In order to prevent the nativeloader from failing to find the vndk
namespace, the namespace is marked as visible.

Bug: 66482442
Test: download the app mentioned in the bug, it does not crash.
Merged-In: I82e2394eb6eedcb8645e1a5b3735bbfe2735b312
Change-Id: I82e2394eb6eedcb8645e1a5b3735bbfe2735b312
(cherry picked from commit 1cc09e749f)
2017-10-30 10:27:45 +09:00
Jiyong Park
7f654c3243 vndk: remove vendor/lib from the search path of the 'vndk' namespace
'vndk' namespace is the place for VNDK-SP libs. So /vendor/lib must be
removed from its search paths. It was there just because libhardware
(which is VNDK-SP) is loading HAL libs in vendor partition from there.
However this problem has been solved by modifying the libhardware so
that HAL libs are loaded from the 'sphal' namespace and not from the
current (the 'vndk') namespace.

Bug: 37731053
Test: sailfish builds and boots
Merged-In: Ia88934a975aa8811e05b5ba408e42d132f20f4e9
Change-Id: Ia88934a975aa8811e05b5ba408e42d132f20f4e9
(cherry picked from commit f01b52895d)
2017-10-30 10:27:45 +09:00
Jiyong Park
e58fa1b0c6 libz is back to LLNDK
For 2016 pixel devices, where VNDK is not fully enforced, move libz back
to LLNDK so that we can pass the CTS without requiring the default
namespace to be isolated.

If we have libz in vndk-sp directory, test_linker_namespaces fails
because /system/lib/vndk-sp/libz.so becomes accessible. In order to make
the lib inaccessible, we have to make the default namespace isolated,
but this can't be done for 2016 pixel devices where VNDK is not fully
enforced. So, we choose to remove /system/lib/vndk-sp/libz.so and keep
the single copy at /system/lib.

Bug: 65018779
Test: android.jni.cts.JniStaticTest#test_linker_namespaces successful on
2016 pixel devices

Merged-In: Ib6b6560b02be69d2015c0afb86acf07c02b30c2f
Change-Id: Ib6b6560b02be69d2015c0afb86acf07c02b30c2f
(cherry picked from commit 697eb2da0d)
2017-10-30 10:27:45 +09:00
Jiyong Park
7075bca364 Make the rs namespace visible
This allows us to dlopen libRS_internal.so directly from the rs
namespace, not from the sphal namespace.

Bug: 64747884
Test: VtsHalRenderscriptV1_0TargetTest successful on the device built
with BOARD_VNDK_VERSION=current and [system] namespace config is applied
to /data/nativetest[64]/* processes.

Merged-In: I0b441791e395798e80a84592ca01e771bb1c201a
Change-Id: I0b441791e395798e80a84592ca01e771bb1c201a
(cherry picked from commit 421a5e46b7)
2017-10-30 10:27:45 +09:00
Justin Yun
136eb05892 Add libft2.so to ll-ndk for rs namespace
libft2.so is changed to ll-ndk that is available only for rs
namespace.

Bug: 64425518
Test: build and boot with BOARD_VNDK_VERSION=current
Merged-In: I991dc774ca9b92fb6e95a7656243a6a4ecdc0ab9
Change-Id: I991dc774ca9b92fb6e95a7656243a6a4ecdc0ab9
(cherry picked from commit 513f76394a)
2017-10-30 10:27:45 +09:00
Justin Yun
8ebf6ee6f6 Move libz vndk-sp from ll-ndk
The ABI of libz is not as stable as it is for ll-ndk.

Bug: 37617391
Test: build and boot
Merged-In: I883bc6fda268e98cc7cdd5888264170c58688794
Change-Id: I883bc6fda268e98cc7cdd5888264170c58688794
(cherry picked from commit dadd3a846f)
2017-10-30 10:27:45 +09:00
Josh Gao
18ea0978cf Delete obsolete debuggerd references.
Test: treehugger
Change-Id: Ic1a8cfb867decd76443fdc26333f2bcaa98b61bb
2017-10-27 16:12:49 -07:00
Elliott Hughes
77451492bc Merge "Remove Foreground Boost CPUSet" 2017-10-25 19:55:50 +00:00
Jake Weinstein
60bc597183 Remove Foreground Boost CPUSet
This functionality was removed at
https://android.googlesource.com/platform/frameworks/base/+/a712d4058f6f85268838
2017-10-23 20:07:22 -04:00
Jae Shin
a909e5e2a1 Merge changes from topic "rs_vndk_step2"
am: 678efa25a6

Change-Id: Idcab36c112406e3dc1fe4eb9cfd5c345cafc0290
2017-10-23 03:03:05 +00:00
Jiyong Park
324f3ed393 templatize ld.config.txt
am: ecc703c792

Change-Id: Ic9dc2f35a4a9a2c2a56cb24a9ac02e9373ed78df
2017-10-23 03:02:31 +00:00
Jiyong Park
6683a8735b Make default namespace for system processes isolated
am: 246338f90e

Change-Id: I2f2d2799ab57031a3c3b24830c0e10376e035acd
2017-10-23 03:01:58 +00:00
Justin Yun
e96c957e57 vndk: add vendor/lib(64)/vndk for vendor namespace
am: b5ddc5ae6b

Change-Id: I1e22e9a994932e3e93cbbafb8d5defd5efd69b7c
2017-10-23 03:01:12 +00:00
Justin Yun
c82e43034b Implement system namespace for vendor process
am: 333845c710

Change-Id: I0fda3fe689832b0b5cc13a381dacdd633886e27a
2017-10-23 03:00:13 +00:00
Jiyong Park
6d9f5e4012 Use the legacy linker namespace configs when target is sanitized
am: 614c5521a3

Change-Id: I80ff3cb047a9ad351590524a5602cdc0f9df3e61
2017-10-23 02:59:15 +00:00
Jiyong Park
b9d74495b1 Permit /system/lib/vndk-sp/hw/ for 'sphal' namespace
am: b5c0fc3ceb

Change-Id: Ic74e02582c7c2f5b7e9900bf77026168a2947fd2
2017-10-23 02:57:57 +00:00
Justin Yun
1cd1a2b812 Add system/${LIB}/vndk to default namespace for vendor.
am: e373672afd

Change-Id: I4f4e47bb297ec604f79007260883112da5de67e1
2017-10-23 02:56:40 +00:00
Jiyong Park
257de3def5 fix: boot fails on ASAN builds with VNDK restriction
Fix the bug that caused boot failure on ASAN builds with VNDK
restriciton. The major cause is because incorrect (old) ld.config.txt
was used when the build is sanitized, which prevented the dynamic linker
to find some VNDK libs that only exist in /system/lib/vndk; the old
ld.config.txt does not have the directory in its search paths. So, this
CL fixes the problem by having the same ld.config.txt for both sanitized
and non-sanitizied builds.

Furthermore, ld.config.txt is modified so that dependency to
libclang_rt* libs are redirected to those in /system/lib directory. This
ensures that the sanitizer runtime libs are not dual loaded but are
provided for both platform and vendors.

Bug: 65217017
Test: SANITIZE_TARGET=integer_overflow SANITIZE_TARGET_DIAG=integer_overflow m
on 2017 pixel devices. The build is successful and the device boots to
the UI.

Merged-In: I0e21e20d9aca340b984968e07d4ce542ae10fd31
Change-Id: I0e21e20d9aca340b984968e07d4ce542ae10fd31
(cherry picked from commit faefa6bd36)
2017-10-23 02:42:47 +00:00
Jiyong Park
ecc703c792 templatize ld.config.txt
Lists of libraries in between the linker namespaces are no longer
hard-coded in ld.config.txt, but instead come from Soong.

Bug: 37139976
Test: build 2017 pixel device with BOARD_VNDK_VERSION=current m -j
Test: the device is bootable, basic functionalities (camera, camcorder,
wifi, bt, gps, etc.) work.
Merged-In: I8170e6c3f6ee04b16359791d64cc46bd2714a073
Change-Id: I8170e6c3f6ee04b16359791d64cc46bd2714a073

(cherry picked from commit 367984602a)
2017-10-23 02:40:37 +00:00
Jiyong Park
246338f90e Make default namespace for system processes isolated
The default namespace for system process now becomes isolated, which
means it can load only the libs that are in search.paths and under
permitted.paths.

/system/framework, /system/app, /system/priv-app, /vendor/app, /data,
etc are added to the permitted paths since libart should be able to
dlopen odex files under the locations.

Following directories become unavailable:
/system/lib/vndk
/system/lib/vndk-sp

Bug: 37013858
Bug: 64888291
Bug: 64950640
Test: 2017 pixel devices builds and boots
Test: android.jni.cts.JniStaticTest#test_linker_namespaces passes
Merged-In: I2bbe9cc19940c3633c2fb901f9bf8ab813e38c13
Change-Id: I2bbe9cc19940c3633c2fb901f9bf8ab813e38c13
(cherry picked from commit 55f05d79f9)
2017-10-23 11:10:32 +09:00
Justin Yun
b5ddc5ae6b vndk: add vendor/lib(64)/vndk for vendor namespace
When the vndk is extended by vendor, the libs in vendor/lib(64)/vndk
will override system/lib(64)/vndk libs. Vendor binaries will search
vndk libs in vendor/lib(64)/vndk prior to system/lib(64)/vndk.

Also, remove a workaround for libsdm-color.so

Bug: 65032513
Test: build and boot check for libsdm-color.so will be loaded on boot
Test: currently no libs exist on vendor/lib(64)/vndk. No test for it
Merged-In: I99ed37eb1a9e92c83533e2d92c9c06db11f01e97
Change-Id: I99ed37eb1a9e92c83533e2d92c9c06db11f01e97
(cherry picked from commit 3094de9684)
2017-10-23 11:10:31 +09:00
Justin Yun
333845c710 Implement system namespace for vendor process
For vendor process default namespace searches as following order:
1. /vendor/lib/(hw|egl), /vendor/lib: Vendor libs + VNDK-vnd-ext
2. /system/lib/vndk-$(ver): VNDK libs
3. /vendor/lib/vndk-sp-$(ver): VNDK-SP-vnd-ext
4. /system/lib/vndk-sp-$(ver): VNDK-SP
and searches system namespace (/system/lib) only for LL-NDK libs.
This configuarion is used only with BOARD_VNDK_VERSION is defined.

Bug: 37192038
Test: build with 'BOARD_VNDK_VERSION=current' and boot

Merged-In: If9778b9266a084846ba8fe73e6bff25828359d33
Change-Id: If9778b9266a084846ba8fe73e6bff25828359d33
(cherry picked from commit 24c29f1be4)
2017-10-23 11:10:30 +09:00
Jiyong Park
614c5521a3 Use the legacy linker namespace configs when target is sanitized
The new linker namespace config causes problem when the target is
sanitized: vendor libs which are loaded in the sphal namespace can't
link against to libclang_rt* libs which are in /system/lib directory
because the directory is not allowed for sphal namsapce.

Long-term solution would be installing libclang_rt* to both /system/lib
and /vendor/lib so that vendor libs can link against to the one in
/vendor/lib.

Until the work is done, let's just disable the new linker namespace
config when the target is to be sanitized.

Bug: 63535130
Test: make SANITIZE_TARGET=integer_overflow
SANITIZE_TARGET_DIAG=integer_overflow builds and boots to the UI

Merged-In: I6afb69885aaa3d25e554b9ca699a572248bfc50a
Change-Id: I6afb69885aaa3d25e554b9ca699a572248bfc50a
(cherry picked from commit fff6f75fc1)
2017-10-23 11:10:29 +09:00
Jiyong Park
b5c0fc3ceb Permit /system/lib/vndk-sp/hw/ for 'sphal' namespace
android.hidl.memory@1.0-impl.so is a SP-HAL located in
/system/lib/vndk-sp/hw. This can't be moved to /vendor/lib since it is a
framework HAL.

Bug: 62930720
Test: 2017 pixel builds and boots with BOARD_VNDK_VERSION on
Merged-In: I9c456983ef68120c5e8c629efc6dd66a26220ecb
Change-Id: I9c456983ef68120c5e8c629efc6dd66a26220ecb
(cherry picked from commit 7d4cf3fd33)
2017-10-23 11:10:28 +09:00
Justin Yun
e373672afd Add system/${LIB}/vndk to default namespace for vendor.
With BOARD_VNDK_VERSION=current, vndk libs will be installed in
system/${LIB}/vndk. To make them available for vendor, it must be
added to default namespace.

Bug: 63866913
Test: build and boot with BOARD_VNDK_VERSION=current
Merged-In: I9e467a6125fc89513754b56a2420975559144f98
Change-Id: I9e467a6125fc89513754b56a2420975559144f98
(cherry picked from commit 90a2487776)
2017-10-23 11:10:27 +09:00
Jiyong Park
c8ae86afdd Add [test] section for /data/[nativetest|benchmarktest]
We have both system and vendor tests in the same directory
/data/nativetest. Since we can't distinguish system and vendor tests at
runtime, we choose to run all of them with the legacy namespace
configuration where /system/lib and /vendor/lib are both accessible
without any restriction. Furthermore, /system/lib/vndk-sp is added to
the list of accessible directories for tests since some libs (such as
libion.so) exist only in the directory but not in /system/lib.

This will change in the future when we install system and vendor tests
into different directories (vendor tests goes into ./vendor subdir).
Then, we will run the tests with [system] or [vendor] configurations
depending on their paths.

Bug: 63597267
Test: run bionic-unit-tests
Test: run linker-unit-tests
Merged-In: I810003b2da0b30335200c130f484ea7b041f9f80
Change-Id: I810003b2da0b30335200c130f484ea7b041f9f80
(cherry picked from commit c034a43d44)
2017-10-23 11:10:26 +09:00
Jiyong Park
433fe3a8a2 /data/nativetest[64] processes are running with the new ns config
Native tests under /data/nativetest[64] directory is now running with
the same linker namespace configuration as /system/bin/* processes.

This allows us to stop mimicing the linker namespace configuration of the
/system/bin/* processes using LD_LIBRARY_PATH.

Bug: 63597267
Test: run bionic-unit-tests
Test: run linker-unit-tests
Merged-In: If8e2ed0b8016e4e07bf6829735b8e02f952042d0
Change-Id: If8e2ed0b8016e4e07bf6829735b8e02f952042d0
(cherry picked from commit 9d1e50b809)
2017-10-23 11:10:25 +09:00
Dmitry Shmidt
455faa53ed Merge "console: Add setenv HOSTNAME console" am: d2c66b31a0 am: 5884f608d9
am: 825915bfde

Change-Id: Ia845dfb8cba654766dfff15f2eab7dbee621a45d
2017-10-11 20:50:54 +00:00
Dmitry Shmidt
5884f608d9 Merge "console: Add setenv HOSTNAME console"
am: d2c66b31a0

Change-Id: I85addec989872b9e66f0e68c4fea20b969a1eb25
2017-10-11 20:28:49 +00:00
Dmitry Shmidt
d0fb2510e2 console: Add setenv HOSTNAME console
Bug: 67678999
Test: Run serial console on Hikey

Change-Id: Ia5fa9c2af4771508d96545f6a8814a81d5ccee3c
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2017-10-11 11:20:02 -07:00
TreeHugger Robot
773ebbdfe3 Merge "resolve merge conflicts of 73d9596bc to oc-mr1-dev-plus-aosp" into oc-mr1-dev-plus-aosp 2017-09-30 00:57:51 +00:00
Keun Soo Yim
202c5af4be Merge "Tests are run with proper namespace configs by their locations" into oc-mr1-dev
am: aedc1c9ab0

Change-Id: I121703da98b8c66f24bbf0efced1c592c2fc113e
2017-09-29 23:23:08 +00:00
Keun Soo Yim
aedc1c9ab0 Merge "Tests are run with proper namespace configs by their locations" into oc-mr1-dev 2017-09-29 22:59:28 +00:00
Bowgo Tsai
62398781f5 resolve merge conflicts of 73d9596bc to oc-mr1-dev-plus-aosp
Change-Id: I8272038fe905a88273ce9aa690af0ee0005a6b67
2017-09-30 06:44:32 +08:00
Jiyong Park
f196067a8f Merge "Fix: make vndk namespace visible for 2016 Pixes" into oc-mr1-dev
am: 2f00c80c2b

Change-Id: I7659a648f88559ddf65c879e695c1766b3854686
2017-09-29 20:54:04 +00:00
TreeHugger Robot
2f00c80c2b Merge "Fix: make vndk namespace visible for 2016 Pixes" into oc-mr1-dev 2017-09-29 20:41:42 +00:00
Jiyong Park
f631a98a31 Merge "Remove workaround for VNDK violations" into oc-mr1-dev
am: 152687b26e

Change-Id: I40798ad3c2a394d3210a3c218fd52ea38fc8cbff
2017-09-29 19:05:49 +00:00
Bowgo Tsai
d29ac08509 Merge "Removing $(PRODUCT_OUT)/root/root"
am: 8cbbacdc15

Change-Id: Ia671976f8d7d4b83478c58d566e309f36af125ab
2017-09-29 03:27:38 +00:00
Jiyong Park
326b783ad9 Tests are run with proper namespace configs by their locations
Tests in /data/[nativetest|benchmarktest] run with namespace config for
system and tests in /data/[nativetest|benchmarktest]/vendor run with
namespace config for vendor.

They no longer run in the 'test' namespace config which didn't impose
any restriction for libraries.

Bug: 67028906
Test: sailfish/marlin builds and boots
Test: no VTS regression on system.img from GSI + vendor.img from
marlin/sailfish
Test: VtsKernelLibcutilsTest successful in above config

Change-Id: I28cdef960d087565c8a22dca0e9a154fb1c3bb94
2017-09-29 05:04:27 +09:00
Bowgo Tsai
144893e5ec Removing $(PRODUCT_OUT)/root/root
Bug: 65570851
Test: boot sailfish
Change-Id: I80c3c3de23c57343187fde207980731b5341bc1f
Merged-In: I80c3c3de23c57343187fde207980731b5341bc1f
(cherry picked from commit ededee3e40)
2017-09-28 18:10:58 +08:00
Jiyong Park
f8025aae82 Remove workaround for VNDK violations
lib-dplmedia.so and qseeproxydaemon no longer depend on non-VNDK
libraries. Remove the workaround.

Bug: 64427765
Bug: 64820887
Test: 2017 pixel devices boots
Change-Id: Ib8bcbbb16169dc5c997d6c0dad061c66dcd0ccfe
2017-09-26 01:54:57 +09:00
Jiyong Park
1cc09e749f Fix: make vndk namespace visible for 2016 Pixes
The nativeloader tries to find the 'vndk' namespace when there is a
vendor apk in the classloader paths. This can happen even for a
downloaded app if the app is using a vendor apk via <uses-library> tag.

In order to prevent the nativeloader from failing to find the vndk
namespace, the namespace is marked as visible.

Bug: 66482442
Test: download the app mentioned in the bug, it does not crash.
Change-Id: I82e2394eb6eedcb8645e1a5b3735bbfe2735b312
2017-09-26 01:38:22 +09:00
Jiyong Park
25a03a23a8 Merge changes from topic "vndk_jni" into oc-mr1-dev
am: 6f7d928940

Change-Id: I69af1cdf06bf71f1125644c7064b40444613eaa7
2017-09-14 14:52:51 +00:00
Jiyong Park
6eaa30765e add llndk|vndksp.libraries.txt to vndk_package
am: 26335f89b1

Change-Id: Idc8d3ff696c782963337fa21ead8a7665c0a1e98
2017-09-14 14:52:40 +00:00
TreeHugger Robot
6f7d928940 Merge changes from topic "vndk_jni" into oc-mr1-dev
* changes:
  vendor apk is unbundled
  add llndk|vndksp.libraries.txt to vndk_package
2017-09-14 01:35:43 +00:00
Jiyong Park
299591e464 Merge "fix: boot fails on ASAN builds with VNDK restriction" into oc-mr1-dev
am: 80206d8f03

Change-Id: I051d1683e95171bc1e3e3d16007c5d25ea923bc2
2017-09-08 01:41:44 +00:00
TreeHugger Robot
80206d8f03 Merge "fix: boot fails on ASAN builds with VNDK restriction" into oc-mr1-dev 2017-09-08 01:20:30 +00:00
Jiyong Park
a07f3057d0 vendor apk is unbundled
For devices where VNDK restrictions are all enforced, vendor apks are
recognized as unbundled; since system partition and vendor partition can
be updated independently from each other.

However, since vendor apks are still bundled in the vendor partition,
they are allowed to do more than ordinaly unbundled apks that are
downloaded and installed to the data partition.

1) /vendor/lib is allowed. So the path is added to the search_paths and
permitted paths of the classloader namespace.
2) LLNDK libs are allowed in addition to the NDK libs. So, LLNDK lib list
from llndk.libraries.txt is added to the list from public.libraries.txt.
3) VNDK-SP libs are allowed. To do so, the classloader namespace is
linked to the 'vndk' namespace where VNDK-SP libs are searched and
loaded from. The list of available VNDK-SP libs is read from
vndksp.libraries.txt file.
4) Name of the namespace is changed to 'vendor-classloader-namespace'
since the namespace is configured differently from the ordinary
'classloader-namespace'.

Bug: 63553457
Test: 2017 pixel devices build and boots to the UI
Test: a vendor apk (e.g. TimeService.apk) works. Turn the airplain mode on.
Set time. Reboot the device. The time is not reset.
Test: 1) set target as 2017 pixel
2) m -j CtsVendorJniTestCases
3) copy the built apk into /vendor/app/CtsVendorJniTestCases
4) reboot / factory reset
5) adb shell am instrument -w android.jni.vendor.cts

Change-Id: I447452eb025c0a0fd076b5c9ac081d453dc6074e
2017-09-07 20:26:10 +09:00
Jiyong Park
26335f89b1 add llndk|vndksp.libraries.txt to vndk_package
List of llndk and vndk-sp libraries are written in the txt file so that
they can be available at run-time. The information is used by
libnativeloader to configure the classloader-namespace specially for
vendor apks.

Bug: 64882323
Test: build 2017 pixel devices. check that the two files exist on
/system/etc.

Change-Id: Ifbe339a5862f6ef57a8213a14a022765ccf77283
2017-09-07 11:51:29 +09:00
Jiyong Park
533062b8d6 Merge "templatize ld.config.txt" into oc-mr1-dev
am: 2d3cf6799e

Change-Id: I570d4d52b630c3de0e82ec67638c6c37c48d1074
2017-09-01 03:28:45 +00:00
TreeHugger Robot
2d3cf6799e Merge "templatize ld.config.txt" into oc-mr1-dev 2017-09-01 03:23:17 +00:00
Jiyong Park
8e14484166 Merge "libz is back to LLNDK" into oc-mr1-dev
am: d9d20baf6f

Change-Id: Id2649fcd9c66003a5e84d75d91a34604b5f5d7e0
2017-09-01 00:54:49 +00:00
TreeHugger Robot
d9d20baf6f Merge "libz is back to LLNDK" into oc-mr1-dev 2017-09-01 00:39:14 +00:00
Jiyong Park
faefa6bd36 fix: boot fails on ASAN builds with VNDK restriction
Fix the bug that caused boot failure on ASAN builds with VNDK
restriciton. The major cause is because incorrect (old) ld.config.txt
was used when the build is sanitized, which prevented the dynamic linker
to find some VNDK libs that only exist in /system/lib/vndk; the old
ld.config.txt does not have the directory in its search paths. So, this
CL fixes the problem by having the same ld.config.txt for both sanitized
and non-sanitizied builds.

Furthermore, ld.config.txt is modified so that dependency to
libclang_rt* libs are redirected to those in /system/lib directory. This
ensures that the sanitizer runtime libs are not dual loaded but are
provided for both platform and vendors.

Bug: 65217017
Test: SANITIZE_TARGET=integer_overflow SANITIZE_TARGET_DIAG=integer_overflow m
on 2017 pixel devices. The build is successful and the device boots to
the UI.

Change-Id: I0e21e20d9aca340b984968e07d4ce542ae10fd31
2017-09-01 07:53:56 +09:00
Jiyong Park
367984602a templatize ld.config.txt
Lists of libraries in between the linker namespaces are no longer
hard-coded in ld.config.txt, but instead come from Soong.

Bug: 37139976
Test: build 2017 pixel device with BOARD_VNDK_VERSION=current m -j
Test: the device is bootable, basic functionalities (camera, camcorder,
wifi, bt, gps, etc.) work.
Change-Id: I8170e6c3f6ee04b16359791d64cc46bd2714a073
2017-09-01 07:53:56 +09:00
Jiyong Park
ab8de9ebc3 Make default namespace for system processes isolated
am: 55f05d79f9

Change-Id: Idd31e85fbe01a506f11c88fd4dcecb23db936d0e
2017-08-31 16:17:20 +00:00
Jiyong Park
697eb2da0d libz is back to LLNDK
For 2016 pixel devices, where VNDK is not fully enforced, move libz back
to LLNDK so that we can pass the CTS without requiring the default
namespace to be isolated.

If we have libz in vndk-sp directory, test_linker_namespaces fails
because /system/lib/vndk-sp/libz.so becomes accessible. In order to make
the lib inaccessible, we have to make the default namespace isolated,
but this can't be done for 2016 pixel devices where VNDK is not fully
enforced. So, we choose to remove /system/lib/vndk-sp/libz.so and keep
the single copy at /system/lib.

Bug: 65018779
Test: android.jni.cts.JniStaticTest#test_linker_namespaces successful on
2016 pixel devices

Change-Id: Ib6b6560b02be69d2015c0afb86acf07c02b30c2f
2017-08-31 22:11:35 +09:00
Bowgo Tsai
f390f04381 Merge "Move adbd from root to system"
am: 3d6f85167e

Change-Id: I3b89a7a8e98252319f850a225ef7ba2080e54879
2017-08-31 06:30:48 +00:00
Treehugger Robot
3d6f85167e Merge "Move adbd from root to system" 2017-08-31 06:22:16 +00:00
Jiyong Park
55f05d79f9 Make default namespace for system processes isolated
The default namespace for system process now becomes isolated, which
means it can load only the libs that are in search.paths and under
permitted.paths.

/system/framework, /system/app, /system/priv-app, /vendor/app, /data,
etc are added to the permitted paths since libart should be able to
dlopen odex files under the locations.

Following directories become unavailable:
/system/lib/vndk
/system/lib/vndk-sp

Bug: 37013858
Bug: 64888291
Bug: 64950640
Test: 2017 pixel devices builds and boots
Test: android.jni.cts.JniStaticTest#test_linker_namespaces passes
Change-Id: I2bbe9cc19940c3633c2fb901f9bf8ab813e38c13
2017-08-31 11:52:03 +09:00