Commit graph

1784 commits

Author SHA1 Message Date
Yifan Hong
bcdfe0d795 BOARD_USES_PRODUCT_SERVICES_IMAGE => BOARD_USES_PRODUCT_SERVICESIMAGE
This is the name used by envsetup.sh.

Test: `m init.environ.rc` and see directory
$OUT/root/product-services and see symlink $OUT/system/product-services

Change-Id: Ie615b6d76e2c60e6472900c33d9a87cfe99c4064
2018-07-27 11:14:43 -07:00
Dario Freni
3613710099 Add support for /product-services partition.
This CL is largely and adaptation of
Ie996def20e25dc1afe0c74af2096af844934b2dc

Bug: 80741439
Test: Successfully built product-services.img with one module in it, and
flashed on device. Also successfully built image with
/system/product-services and no dedicated /product-services partition.

Change-Id: I1046dfe19bf874da929c9131b76a1f85422fbb80
Merged-In: I1046dfe19bf874da929c9131b76a1f85422fbb80
2018-07-26 16:27:28 +00:00
Tom Cherry
b504f38d7e Merge "ueventd: let scripts provide firmware directories" 2018-07-16 23:00:53 +00:00
Tom Cherry
7421fa1aed ueventd: let scripts provide firmware directories
Since some vendors will have firmware in mount points in
/mnt/vendor/..., we extend the ueventd script language to allow
specifying the firmware directories.

Also, move the existing 4 directories to ueventd.rc as a primary user
of this mechanism.

Bug: 111337229
Test: boot sailfish; firmwares load
Change-Id: I0854b0b786ad761e40d2332312c637610432fce2
2018-07-13 15:34:25 -07:00
Luis Hector Chavez
d07d0942c6 init.rc: Remount / with MS_REMOUNT|MS_BIND|MS_NODEV
/ should not have any character/block devices, so might as well pass in
the nodev flag.

Bug: 73255020
Test: aosp_sailfish still boots
Test: sailfish:/ # find / -xdev -a \( -type b -o -type c -o -type p -o -type s \)
      sailfish:/ #
Test: rootfs on / type rootfs (rw,seclabel)
      /dev/root on / type ext4 (ro,seclabel,nodevrelatime)

Change-Id: Ia73e04b53a47506892d9d3cb61b471b81bb72dc3
2018-07-11 08:36:00 -07:00
Yabin Cui
4f0da7cb82 Add debug system properties to control profiling limits.
When security.perf_harden is disabled through adb, use some debug
system properties to set profiling limits in the kernel, including
cpu percentage, memory, and max sample rate.

Bug: 110706031
Test: boot hikey960 and manually set system properties to make
Test: sure it works.

Change-Id: I44c0adf3a000bb393905233f2a097c97b5fe91ec
2018-07-09 16:03:30 -07:00
Mark Salyzyn
7ab805ea1d rootdir: access to pstore denied to bootstat
Test: boot_reason_test.sh
Bug: 110925971
Change-Id: Iba7b7325fe8c9ad18a7f8dbda550d6008400693e
2018-06-29 13:10:08 -07:00
Doheon Lee
cccad0bf84 Determine product partition path on build time
Path of product partitoin can be set as /product or /system/product
whether generate extra product partition or not.
Substitute %PRODUCT% to relevant path to know linker which path should
search and permit.

Bug: 110286945
Test: m -j # Check /system/etc/ld.config.$(PLATFORM_VNDK_VERSION).txt
Change-Id: I6ca177d0c9c5af00ad821879fece40848331fc8d
2018-06-19 08:10:14 +00:00
Inseob Kim
3918936b9e Add /system/product/* paths to permitted paths
As linker doesn't resolve paths in permitted paths, /system/product
variants should be added to support devices having product partition
under /system.

Bug: 110286945
Test: m -j succeeds on taimen and libraries under /system can dlopen
libraries under /system/product/apps

Change-Id: Icd102d44511702e4ec66c07a367b59c3d9700a44
2018-06-18 14:16:49 +09:00
Jiyong Park
011ee12b1d Shared libs are supported in recovery mode
adbd has been built as a static executable since the same binary was
copied to the recovery partition where shared library is not supported.
However, since we now support shared library in the recovery partition,
adbd is built as a dynamic executable.

In addition, the dependency from adbd to libdebuggerd_handler is removed
as debuggerd is handled by the dynamic linker.

A few more modules in /system/core are marked as recovery_available:
true as they are transitive dependencies of the dynamic linker.

This change also includes ld.config.recovery.txt which is the linker
config file for the recovery mode. It is installed to /etc/ld.config.txt
and contains linker namespace config for the dynamic binaries under
/sbin.

Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: Select 'mount /system' in the recovery mode, then `adb shell`.
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.

Change-Id: I363d5a787863f1677ee40afb5d5841321ddaae77
2018-06-10 08:32:24 +09:00
Inseob Kim
25195daaca Support /product/bin
Bug: 80422611
Test: m -j succeeded and permissions of files under /product/bin are set
correctly

Change-Id: I83377d809c47c92da6b226d2853ea6a7462fb127
2018-06-01 08:33:04 +09:00
Treehugger Robot
39cab7cd25 Merge "Support product-specific libraries" 2018-05-24 03:04:48 +00:00
Logan Chien
dda4678a11 Merge "Always use versioned VNDK directory" 2018-05-22 04:04:07 +00:00
Niklas Lindgren
fd66538ef3 Add a new directory to store downloaded apns
downloaded apns-conf.xml will be stored in the folder
/data/misc/apns/ to make sure TelephonyProvider gets
access.

Bug: 79948106
Test: Manual
Change-Id: I4ba0596fa6523c0eb96328dbe46ead02587bd9b8
2018-05-21 18:48:28 +02:00
Logan Chien
5a35d12e62 Always use versioned VNDK directory
Bug: 78605339
Test: sailfish-userdebug builds and boots
Test: sailfish boots with GSI
Change-Id: I7da5845b5c1caed3b73d7665f1db672f2764c2a8
(cherry picked from commit 6a145749be)
2018-05-17 14:29:44 +08:00
Inseob Kim
67cb05654c Support product-specific libraries
Product-specific libraries in /product/lib can be exposed to Android
apps by adding the list of the libs into
/product/etc/public.libraries-<companyname>.txt. The libs MUST be named
as lib<name>.<companyname>.so.

Bug: 73095206
Test: with taimen
mma -j and runtest.sh. The libs are all loaded in system, but not in
vendor. After reinstalling app using adb -r and reopening app, only
libraries listed in .txt are loaded

Change-Id: I7c386813c72a7b225a7f244b6c5fec4ac0660fd3
2018-05-16 01:36:25 +00:00
Ralph Nathan
ab39ce88e4 Add a public.libraries.txt file for iot devices.
Previously on Android Things, we used a vendor public.libraries.txt
file. This cl enables us to tag our library correctly.

Bug: 78226207
Test: test app works
Change-Id: I9e69717e5968a903e84f59c1d889c8e4cf9bcc35
2018-04-20 13:46:55 -07:00
Treehugger Robot
c629131c26 Merge "init.rc: create /data/system/dropbox" 2018-04-18 21:48:39 +00:00
Tri Vo
4640149fd5 Merge "Add /mnt/vendor rw mount point for vendor partitions." 2018-04-18 19:32:32 +00:00
Jeff Vander Stoep
148dea71a5 init.rc: create /data/system/dropbox
Ensure dropbox has the new dropbox_data_file label.

Bug: 31681871
Test: ls -dZ /data/system/dropbox
    u:object_r:dropbox_data_file:s0 /data/system/dropbox

Change-Id: Ia67646f4a789155e20650c33fe4412cae7f930d2
2018-04-18 07:15:37 -07:00
Tri Vo
0b66969ba0 Add /mnt/vendor rw mount point for vendor partitions.
Changes to init's behavior during early mount:
1. Mounting of tmpfs on /mnt is moved from init stage to early mount.
2. init creates /mnt/vendor used to mount vendor partitions.
3. If a device tree fstab entry for early mount specifies a mount point
under /mnt/vendor e.g. /mnt/vendor/foo, init will create
/mnt/vendor/foo mount point.

Bug: 64905218
Test: change dt fstab entry to mount persist to /mnt/vendor/persist;
mount point is created correctly, and partition is mounted in early
mount. See go/pag/1069774
Test: device boots with /mnt/vendor and previous contents of /mnt present,
and selinux label "mnt_vendor_file" is applied correctly.
Test: cts-tradefed run commandAndExit cts --skip-all-system-status-check
--primary-abi-only --skip-preconditions -m CtsAppSecurityHostTestCases
-t android.appsecurity.cts.PermissionsHostTest
Change-Id: I3739130739eadf508355c7f2531366fcaed74175
Merged-In: I3739130739eadf508355c7f2531366fcaed74175
(cherry picked from commit b511475664)
2018-04-17 11:19:44 -07:00
Mark Salyzyn
64d97d8761 lmkd: limit capability set to minimum
Set F() capability set and 'drop' lmkd from AID_ROOT to AID_LMKD uid
and from AID_ROOT to AID_LMKD and AID_SYSTEM gid.

/dev/memcg/memory.pressure defaults to root.root mode 0000, set it up
as root.system mode 0040 to allow lmkd read access.

Instrument failure to set SCHED_FIFO.

Annotate access points that require elevated capabilities.

Test: check /proc/`pidof lmkd`/status for capability set
Test: lmkd_unit_test
Bug: 77650566
Change-Id: I986081a0434cf6e842b63a55726380205b30a3ea
2018-04-16 14:51:56 -07:00
Logan Chien
8667747a0e Allow VNDK-SP extensions to use vendor lib
This commit adds a wildcard linker namespace link between the "vndk"
namespace and the "sphal" namespace of the system processes.  This is
created for VNDK-SP-Ext to load vendor libs in "sphal" namespace.

Bug: 77249955
Test: lunch aosp_walleye-userdebug && make -j8  # runs unit tests
Test: lunch aosp_sailfish-userdebug && make -j8  # runs unit tests
Test: Create a VNDK-SP-Ext, link to vendor libs, and run it.
Change-Id: I71b0fb604a84272156aa119130c272f891847008
2018-03-29 17:18:40 +08: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
Benedict Wong
78ca1fecef Merge "Set SPI Allocation Timeout to One Hour" 2018-03-16 17:45:20 +00:00
Benedict Wong
00308f8554 Set SPI Allocation Timeout to One Hour
This change increases the default expiration length of an SA to 1h. The
IPsec API expects that SPIs are allocated indefinitely, but potential
for instability requires that these get cleaned up automatically. As
such, the duration was chosen as a sane, but long timeout value.

Bug: 72316671
Test: Added CTS tests to enforce this behavior
Change-Id: I47aef9cea4a09da253b2ec048a8797af5fa25529
2018-03-14 18:24:23 +00:00
Bowgo Tsai
39476ffd8a Support /odm partition
Bug: 64195575
Test: boot a device
Change-Id: I52c0da32aef80c060f6efa47ddf62577fb543ad8
2018-03-14 16:19:03 +08:00
Bowgo Tsai
00749affc4 Adding /odm support
Treble system-as-root GSI needs to work on devices with and without /odm
partition. This change creates the following symlinks for devices without
/odm partition:

  /odm/app ->/vendor/odm/app
  /odm/bin ->/vendor/odm/bin
  /odm/etc ->/vendor/odm/etc
  /odm/firmware ->/vendor/odm/firmware
  /odm/framework ->/vendor/odm/framework
  /odm/lib -> /vendor/odm/lib
  /odm/lib64 -> /vendor/odm/lib64
  /odm/overlay -> /vendor/odm/overlay
  /odm/priv-app -> /vendor/odm/priv-app

For devices with odm partition, /odm will be used as the mount point and
those symlinks will be hidden after mount.

Bug: 70678783
Test: boot a A/B device without /odm partition, checks those symlinks exist
Test: boot a A/B device with /odm partition, checks those symlinks don't exist
Change-Id: I4d960b52e2754f461188f3ab562c751f502046ea
2018-03-09 17:34:29 +08:00
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