Commit graph

1756 commits

Author SHA1 Message Date
Treehugger Robot
7238eca684 Merge "init.rc: Add nodev,noexec,nosuid to /config" 2018-02-15 03:01:33 +00:00
Luis Hector Chavez
8774945036 init.rc: Add nodev,noexec,nosuid to /config
This change adds some additional flags to the /config mount. This is to
reduce the number of mounts with unnecessary privileges.

Bug: 73255020
Test: aosp_sailfish still boots
Test: CtsAppSecurityHostTestCases {ExternalStorageHostTest,StorageHostTest}
Merged-In: If3409d917cdf76a67ebfb7c4035a3ae8fee6189f
Change-Id: If3409d917cdf76a67ebfb7c4035a3ae8fee6189f
2018-02-14 20:58:56 +00:00
Luis Hector Chavez
081aa0a303 init.rc: Mount /mnt with nodev,nosuid,noexec
This change adds some additional flags to /mnt. This is to reduce
the number of mounts with unnecessary flags.

Bug: 73255020
Test: aosp_sailfish still boots
Test: CtsAppSecurityHostTestCases {StorageHostTest,ExternalStorageHostTest}
Test: CtsOsTestCases StorageManagerTest
Test: find /mnt  | egrep -v '^/mnt/runtime/(default|read|write)/emulated' | \
      xargs ls -lZd  # Shows no character devices or executable files
Change-Id: I54739133119d9626ebeb2ef9a1c127f7a90fa098
2018-02-14 20:51:40 +00:00
Luis Hector Chavez
30780a7305 init.rc: Remount / with MS_REMOUNT|MS_BIND
Since we only want to change the ro flag on / (and leave all other mount
flags alone), this can also be achieved by passing MS_REMOUNT|MS_BIND,
even if the mount is not a bind-mount.

This aims to make running Android within a user namespace easier, since
remounts without the MS_BIND flag are forbidden.

Bug: 73255020
Test: aosp_sailfish still boots
Test: rootfs on / type rootfs (rw,seclabel)
      /dev/root on / type ext4 (ro,seclabel,relatime,data=ordered)
Change-Id: I2f89a8badfc467db47304c9355648e8fd8ad1272
2018-02-14 20:51:06 +00:00
Justin Yun
8065a608a6 Move libz to llndk from vndk-sp for non-VNDK-enforced devices.
For non-VNDK-enforced devices, libz cannot be installed in vndk-sp
to avoid CTS test failure.
Move libz to llndk from vndk-sp for generating the namespace
configuration from ld.config.vndk_lite.txt.

Bug: 73296261
Test: run android.jni.cts test on marlin/sailfish
Change-Id: I1b8b43cd87dc8dfdd2667001ae1e50d9eaedf93d
2018-02-14 16:11:14 +09:00
Luis Hector Chavez
f8a7e37b2d init.rc: Perform some mounts with nodev,nosuid,noexec
This change adds some additional flags to some mounts. This is to reduce
the number of mounts with these flags.

Bug: 73255020
Test: aosp_sailfish still boots
Change-Id: I285e6d7b3dcc19f691a3d6780e7d3a3a5d7cb3de
2018-02-12 23:17:10 +00:00
Justin Yun
27bdc37fac Rename namespace configuration source files.
For strict VNDK runtime restriction, use ld.config.txt as a source
file. For treblized devices without BOARD_VNDK_VERSION, use
ld.config.vndk_lite.txt file.

Test: Build and boot on Pixel 2017 and 2018 devices.
Change-Id: Ie5b77facd4c11bc73219ecf13ad1298ac5d60d8e
2018-02-08 08:46:59 +09:00
Justin Yun
8a9a8eeb85 Use actual VNDK list for non-VNDK-enforcing devices
Rename ld.config.txt.in to ld.config.vndk.txt and
ld.config.txt to ld.config.vndk_light.txt.

For FULL_TREBLE devices without BOARD_VNDK_VERSION, update the VNDK
library list in ld.config.vndk_light.txt with the actual VNDK list.

Bug: 69526027
Test: Build marlin/sailfish and check boot
Change-Id: Idbb0cc97d11037c1493d4739e84961297ce51dbd
Merged-In: Idbb0cc97d11037c1493d4739e84961297ce51dbd
2018-02-08 08:33:15 +09:00
bohu
b40193e50a emulator: not start adbd upon ro.kernel.qemu=1
clean up emulator specific rules.

BUG: 72900827

Change-Id: Ica60838562fd773bcde5752c11586183ce55b71a
2018-02-03 17:22:15 -08:00
Logan Chien
1e11f5f709 Merge "ld.config.txt: Link vendor vndk ns to default ns" 2018-01-26 04:45:26 +00:00
Jaekyun Seok
dff165d3a2 Support /product partition
This CL will enable reading /product/build.prop and add product paths
into ld.config.txt.in.

Bug: 64195575
Test: tested with 'PRODUCT_PRODUCT_PROPERTIES := ro.product.abc=abc' on
sailfish

Change-Id: Ie996def20e25dc1afe0c74af2096af844934b2dc
2018-01-25 09:37:20 +09:00
Logan Chien
ea4a2bdd44 ld.config.txt: Link vendor vndk ns to default ns
This commit links the vndk namespace of vendor processes to the default
namespace of vendor processes.  allow_all_shared_libs is specified so
that VNDK extensions can link with other vendor libraries in
/vendor/lib[64].

Bug: 69824336

Test: Create a vndk-ext lib that links to vendor lib and use that
vndk-ext lib in a vendor executable.

Change-Id: Ibd3dc2e5f0f2e6ff9fc9677c6bcfcf87a1a70e50
2018-01-23 11:02:54 +08:00
Logan Chien
91b3fb4f3f ld.config.txt: Move vendor vndk to vndk namespace
This commit moves /{odm,vendor}/lib[64]/vndk[-sp] to vndk namespace so
that vndk extension can override vndk libs from
/system/lib[64]/vndk[-sp].

Bug: 69824336

Test: Create libutils_ext locally and it can be called from
android.hardware.nfc@1.0-service.

Change-Id: Id63e58d665fa41eda85950ee1d16fe06c35cd7d3
2018-01-22 11:30:56 +08:00
Treehugger Robot
658e4ddd03 Merge "Adding /data/local/traces for traceur app" 2018-01-20 00:51:30 +00:00
Max Bires
181d11c5cb Adding /data/local/traces for traceur app
Traceur app is being split out of shell user. Previously it logged to
shell's bugreports directory. It no longer has access, so it needs a
new, user-friendly file location to store trace data.

Bug:68126425
Test: Traceur can write and shell can read from this directory
Change-Id: I9e344973fd43eb5699f7a848524e20b06458fb77
2018-01-19 09:37:44 -08:00
Justin Yun
cbbf195e46 Add VNDK version suffix in ld.config.txt on build time.
As we use different ld.config.txt per version, we don't need to
substitute the VNDK_VER on run time.
Remove all ${VNDK_VER} from the linker namespace configuration files.

Bug: 70603313
Test: build and boot GSI for walleye and sailfish
Change-Id: Ief8aee5c3308b2462cafaffc2423deda4e51a7bb
2018-01-17 12:14:25 +09:00
Oscar Shu
da007e0deb Merge "Firmware dump create directory" 2018-01-16 23:57:15 +00:00
Chenbo Feng
2cba6f2e0e Mount eBPF file system and cgroupv2 root directory
Mount the eBPF file system under /sys/fs/bpf to allow netd to pin and
retrieve persistent eBPF map object from the file system. It helps the
system to maintain a consistent eBPF data store when netd crashed and
restart. Mount the cgroupv2 module and use the root folder of it to
monitor network statistics through eBPF program attached.

Test: eBPF map object show up under /sys/fs/bpf after netd start.
Bug: 30950746
Change-Id: Ie475112116603798fe75a75c5a84f4bbe5b942ec
2018-01-16 21:45:25 +00:00
xshu
9a7a5b61c4 Firmware dump create directory
Setting up infanstructure for vendor tombstone in dir:
/data/vendor/tombstones

Wifi specific dumps will go into:
/data/vendor/tombstones/wifi

Bug: 70170285
Test: compile, run on device.
Change-Id: Ie16dd8236d9b5df19adb9818b4c62ce01e0d0b10
2018-01-16 19:10:57 +00:00
Jeff Vander Stoep
e2f77d8ef1 OWNERS: add myself
Test: none
Change-Id: I150226c19370a2c5f06781003ec88befa0e91da7
2018-01-12 13:31:54 -08:00
Justin Yun
dd16301bab Do not append VNDK version if VNDK is not used
If BOARD_VNDK_VERSION is not defined, ro.vndk.version will not be
set. In this case, the device, is not able to use versioned
configuration files.
Check BOARD_VNDK_VERSION to append the VNDK version to the namespace
configuration files.

Bug: 71730104
Test: Check boot on both 2016 and 2017 Pixel devices.
Change-Id: I1df27c75de42a526768a156387f22a934cda6d72
2018-01-11 08:29:54 +09:00
Treehugger Robot
f6363989f4 Merge "Allow input system access to /dev/v4l-touch" 2018-01-09 21:45:52 +00:00
Justin Yun
939f06b429 Removed unused part in ld.config.txt.in
In the namespace with "isolated = false", "permitted.paths" is not
used.

Bug: 71727966
Test: walleye device boot
Change-Id: I6f624be3c4e2c4070bb784632d0757408ec12db0
2018-01-09 14:13:40 +09:00
Jeff Sharkey
a7004e5fed Merge changes from topic "resgidz"
* changes:
  Add reserved disk GID to critical component.
  Set reserved GID when setting reserved blocks.
  Allocate GID to use reserved disk space.
2018-01-08 18:17:50 +00:00
Jeff Sharkey
9410d572fb Add reserved disk GID to critical component.
We recently created a new GID that can be granted to critical system
processes, so that the system is usable enough for the user to free
up disk space used by abusive apps.

Test: builds, boots
Bug: 62024591
Change-Id: Ia5af7535cc05a214f8720ac08c594c6db888597a
2018-01-07 19:25:00 -07:00
Steve Muckle
1a3e3065fb rootdir: make sure the /odm mountpoint is always available
The odm partition will eventually be required. Prepare for this by
creating its mount point.

Bug: 37322799
Test: run cts-dev -m CtsPermissionTestCases
Change-Id: Ibd031b68dd7328c853ded401bb2690dbd6675141
2018-01-04 08:45:20 -08:00
Siarhei Vishniakou
38d4352fce Allow input system access to /dev/v4l-touch
Bug: 62940136
Test: read /dev/v4l-touchX from inputflinger

Change-Id: I394686e4167855f50ddd6ff9aebcf3c94f6550b0
2017-12-22 17:06:24 -08:00
Logan Chien
b00ed37a66 Merge "Separate VNDK libs into another linker namespace" 2017-12-21 01:32:04 +00:00
Treehugger Robot
3388af49e6 Merge "/vendor/lib/hw is removed from search paths for vendor default ns" 2017-12-20 02:19:14 +00:00
Jiyong Park
483cd2e2fe /vendor/lib/hw is removed from search paths for vendor default ns
Shared libraries in the directory should be dlopened with full file
paths. That was a workaround for some legacy prebuilt binaries and they
are all now fixed. Thus removing.

Bug: 70551668
Test: walleye, aosp_walleye, taimen, aosp_taimen boot to the UI

Change-Id: Ifb123b09c13f873cbefa7784e76dfe5f35575a8d
2017-12-19 21:43:25 +09:00
Logan Chien
225b71d8c5 Separate VNDK libs into another linker namespace
This commit extracts /system/lib[64]/vndk and /system/lib[64]/vndk-sp
into another namespace in the vendor section.  This commit is necessary
because LLNDK libraries (e.g. libc or libnativewindow) may otherwise
link to the shared libraries in /system/lib[64]/vndk-sp, which may be
older than the one LLNDK libraries built with.

Test: aosp_walleye boots
Bug: 70816018
Change-Id: I6fceb0da92c978ad940af91f5efe84e673c9247e
2017-12-19 15:29:48 +08:00
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