Commit Graph

4757 Commits

Author SHA1 Message Date
Jeffrey Huang
53114d6184 Merge "GpuService binder call StatsManagerService" 2020-02-07 18:03:26 +00:00
Jeffrey Huang
aac4b2f8c0 Merge "Allow system server to add StatsHal" 2020-02-07 18:03:04 +00:00
Jeffrey Huang
b481e320a1 GpuService binder call StatsManagerService
This binder call is needed because we want to migrate
libstatspull to use StatsManagerService instead of Statsd

The binder call to statsd can be removed after the migration.

Test: m -j
Bug: 148641240
Change-Id: Id1387a2cbe74ba8d84f4973c6e4d17c5e0b88009
2020-02-06 11:54:33 -08:00
Andrei-Valentin Onea
c79be18ddd Merge "Make platform_compat discoverable everywhere" 2020-02-06 13:40:34 +00:00
Jeffrey Vander Stoep
9788ca1738 Merge "net_dns_prop: neverallow most access" 2020-02-06 12:16:22 +00:00
Andrei Onea
25b39acefe Make platform_compat discoverable everywhere
The binder's methods are protected by signature
permissions (LOG_COMPAT_CHANGE, READ_COMPAT_CHANGE_CONFIG and
OVERRIDE_COMPAT_CHANGE_CONFIG).

This is a re-landing of https://r.android.com/1210143, which was
reverted due to http://b/142942524. The actual fix was done in
http://ag/10234812.

Bug: 142650523
Test: atest PlatformCompatGatingTest
Change-Id: Ibddac8933ea58d44457a5d80b540347e796ebe71
2020-02-06 12:11:37 +00:00
Treehugger Robot
15d70fec33 Merge "sepolicy: Relabel wifi. properties as wifi_prop" 2020-02-06 02:53:51 +00:00
Treehugger Robot
ca3d3dfa70 Merge "adbd should be able to shutdown shell:unix_stream_socket" 2020-02-06 02:17:31 +00:00
Howard Ro
f8ddb83890 Merge "Surfaceflinger binder call StatsManagerService" 2020-02-06 01:52:40 +00:00
Jeffrey Huang
dd1ce53b27 Allow system server to add StatsHal
Bug: 148794952
Test: m -j
Change-Id: I14cc282bb262f1ec62ab3473d9229763c1a02e21
Merged-In: I14cc282bb262f1ec62ab3473d9229763c1a02e21
2020-02-05 17:24:48 -08:00
Josh Gao
b9c7001837 adbd should be able to shutdown shell:unix_stream_socket
adbd started calling shutdown and waiting for EOF before closing
sockets in commit 74b7ec72, because closing a TCP socket while you have
pending data to read is specified to send a TCP RST to the other end,
which can result in data that we've written into the socket to be
prematurely thrown away on the other end. Not being able to do so on a
Unix domain socket is benign, aside from the denial showing up in the
log.

Fixes the following selinux denial when installing a package:

  avc: denied { shutdown } for scontext=u:r:adbd:s0 tcontext=u:r:shell:s0 tclass=unix_stream_socket permissive=0

Test: manual
Change-Id: I266092a8323ac02bfe96738a8f4a8021f3a10387
2020-02-05 17:24:46 -08:00
Jeffrey Huang
225850bd0c Surfaceflinger binder call StatsManagerService
This binder call is needed because we want to migrate
libstatspull to use StatsManagerService instead of Statsd

The binder call to statsd can be removed after the migration.

Test: m -j
Bug: 148641240
Change-Id: If6cf7eb77aa229751c44e5291d49f05177dbb8dd
2020-02-05 14:40:40 -08:00
Treehugger Robot
231b89410f Merge "GpuStats: sepolicy change for using new statsd puller api" 2020-02-05 21:58:42 +00:00
Yifan Hong
df701f3e45 Merge "Only write snapshotctl_log when debug" 2020-02-05 21:23:11 +00:00
Jeff Vander Stoep
5afd6d788c net_dns_prop: neverallow most access
Prepare for these properties to be completely removed.

Bug: 33308258
Test: build
Change-Id: Ie22918247db1d6e85a36e0df958916b6752629d0
2020-02-05 09:55:30 +01:00
Martijn Coenen
164359b952 Merge "Create new mediaprovider_app domain." 2020-02-05 07:58:54 +00:00
Yifan Hong
b6b35b7c46 Only write snapshotctl_log when debug
Only write snapshotctl_log_data_file for userdebug_or_eng.

Test: boot, still see log
Bug: 148818798
Change-Id: I03e979efd65e3992bd8ef30e6408768a14aa1de2
2020-02-04 17:15:06 -08:00
Yiwei Zhang
dbbe3bd7d8 GpuStats: sepolicy change for using new statsd puller api
Bug: 148421389
Test: statsd_testdrive 10054
Change-Id: Icf1a4bf809b1413c0e413290bbeadd987faff710
2020-02-04 15:55:59 -08:00
Yifan Hong
28d5e87d39 Merge "snapshotctl better logging" 2020-02-04 22:18:33 +00:00
Connor O'Brien
d90d4aa2bb Merge "Allow system_server to attach bpf programs to tracepoints" 2020-02-04 21:11:47 +00:00
Yifan Hong
589bb6f369 snapshotctl better logging
Test: snapshotctl merge --log-to-file
Bug: 148818798
Change-Id: I0e9c8ebb6632a56670a566f7a541e52e0bd24b08
2020-02-04 10:09:24 -08:00
Martijn Coenen
e3f1d5a314 Create new mediaprovider_app domain.
This is a domain for the MediaProvider mainline module. The
MediaProvider process is responsible for managing external storage, and
as such should be able to have full read/write access to it. It also
hosts a FUSE filesystem that allows other apps to access said storage in
a safe way. Finally, it needs to call some ioctl's to set project quota
on the lower filesystem correctly.

Bug: 141595441
Test: builds, mediaprovider module gets the correct domain
Change-Id: I0d705148774a1bbb59c927e267a484cb5c44f548
2020-02-04 16:53:18 +01:00
Songchun Fan
f09db16c56 [selinux] properly labeling dirs under /data/incremental
Setting files and dirs under /data/incremental as apk_data_file, so that
they will have the same permissions as the ones under /data/app.

Current layout of the dirs:
1. /data/incremental/[random]/mount -> holds data files (such as base.apk) and
control files (such as .cmd). Its subdirectory is first bind-mounted to
/data/incremental/tmp/[random], eventually bind-mounted to
/data/app/~~[randomA]/[packageName]-[randomB].

2. /data/incremental/[random]/backing_mount -> hold incfs backing image.

3. /data/incremental/tmp/[random] -> holds temporary mountpoints (bind-mount targets)
during app installation.

Test: manual
Change-Id: Ia5016db2fa2c7bad1e6611d59625731795eb9efc
2020-02-03 14:28:37 -08:00
Connor O'Brien
e3f0b2ca13 Allow system_server to attach bpf programs to tracepoints
In order to track time in state data using eBPF, system_server needs
to be able to attach BPF programs to tracepoints, which involves:
- calling perf_event_open and the PERF_EVENT_IOC_SET_BPF ioctl
- running BPF programs
- reading tracepoint ids from tracefs

Grant system_server the necessary permissions for these tasks

Test: modify system_server to try to attach programs; check for
denials
Bug: 138317993
Change-Id: I07dafd325a9c57d53767a09d4ca7b0fb2dd2d328
Signed-off-by: Connor O'Brien <connoro@google.com>
2020-01-31 19:47:24 -08:00
Oli Lan
2b44078cac Merge changes I179c05b3,Ia529ede4
* changes:
  Add dac_read_search to apexd to prevent spurious denials.
  Allow apexd to execute toybox for snapshot & restore.
2020-01-31 10:05:21 +00:00
Nicolas Geoffray
89946d7e1b Merge "Add getattr access on tmpfs_zygote files for webview_zygote." 2020-01-31 08:09:05 +00:00
Jon Spivack
499e0173b5 Merge "Revert^2 "Move aidl_lazy_test_server to system_ext"" 2020-01-31 00:04:08 +00:00
Andrei-Valentin Onea
606f3d7fcf Merge "Revert "Make platform_compat discoverable everywhere"" 2020-01-30 22:37:03 +00:00
Andrei-Valentin Onea
8a40e7c132 Revert "Make platform_compat discoverable everywhere"
Revert "Add new permissions to test"

Revert submission 1210143-platformcompat-permissions

Reason for revert: http://b/142942524
Reverted Changes:
I3601b12d5: Add new permissions to test
I65d425aac: Make platform_compat discoverable everywhere
I1c8cbb656: Add permissions for using PlatformCompat methods

Change-Id: I356c1d1c4d1213eea6e5585b23faa40722b1a01a
2020-01-30 21:38:35 +00:00
Nicolas Geoffray
80aaf85eed Add getattr access on tmpfs_zygote files for webview_zygote.
webview_zygote inherits tmpfs files from zygote and needs to stat
them after fork.

Bug: 138851227
Test: run walleye_jitzygote config, fork webview_zygote.
Change-Id: I092b942c0426f3f5731536ae9f2f5886a9196d3d
2020-01-30 21:29:19 +00:00
Oli Lan
7e346c98fc Add dac_read_search to apexd to prevent spurious denials.
As apexd now has dac_override, it should also have dac_read_search to
avoid spurious denials.

Bug: 141148175
Test: Build, run apex installation, check denials.
Change-Id: I179c05b36ae0fe62d943ca59ee7f8158507f1f10
2020-01-30 19:06:30 +00:00
Oli Lan
1a775e077b Allow apexd to execute toybox for snapshot & restore.
This allows apexd to execute "cp" to perform snapshot and
restore operations.

Other rules for this were added in aosp/1217340, but this one was
missed.

Bug: 141148175
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeSys
Change-Id: Ia529ede468578bfadc87e049a2c0ab4f87e1c43d
2020-01-30 16:54:42 +00:00
Jon Spivack
988e381b6b Revert^2 "Move aidl_lazy_test_server to system_ext"
4eae75c9d4

Reason for revert: This undoes the previous reversion, which was made to fix b/148282665.

Change-Id: I70d6e60a0468abea19f5efd7fde10207a251cf61
2020-01-29 02:09:34 +00:00
Zimuzo Ezeozue
5119becf5d Merge "Grant vold, installd, zygote and apps access to /mnt/pass_through" 2020-01-28 22:26:58 +00:00
Songchun Fan
b3ed1d4245 Merge "Change selinux path config for oat files" 2020-01-28 22:05:48 +00:00
Zim
fcf599c89c Grant vold, installd, zygote and apps access to /mnt/pass_through
/mnt/pass_through was introduced to allow the FUSE daemon unrestricted
 access to the lower filesystem (or sdcardfs).

At zygote fork time, the FUSE daemon will have /mnt/pass_through/0
bind mounted to /storage instead of /mnt/user/0. To keep /sdcard
(symlink to /storage/self/primary) paths working, we create a
'self' directory  with an additional 'primary' symlink to
/mnt/pass_through/0/emulated/0 which is a FUSE mount point.

The following components need varying sepolicy privileges:

Vold: Creates the self/primary symlink and mounts the lower filesystem
on /mnt/pass_through/0/emulated. So needs create_dir and mount access
+ create_file access for the symlink

zygote: In case zygote starts an app before vold sets up the paths.
This is unlikely but can happen if the FUSE daemon (a zygote forked app)
is started before system_server completes vold mounts.
Same sepolicy requirements as vold

installd: Needs to clear/destroy app data using lower filesystem
mounted on /mnt/pass_through so needs read_dir access to walk
/mnt/pass_through

priv_app (FUSE daemon): Needs to server content from the lower
filesystem mounted on /mnt/pass_through so needs read_dir access to
walk /mnt/pass_through

Bug: 135341433
Test: adb shell ls /mnt/pass_through/0/self/primary
Change-Id: I16e35b9007c2143282600c56adbc9468a1b7f240
2020-01-28 20:56:36 +00:00
Songchun Fan
7de88d73b6 Change selinux path config for oat files
We are updating apps' apk path to have a two-level structure.
Default apk path of an installed app:
Before: /data/app/[packageName]-[randomString]/base.apk
After: /data/app/[randomStringA]/[packageName]-[randomStringB]/base.apk

As a result, the oat files will be two levels below /data/app.

Test: manual
BUG: 148237378
Change-Id: If8e1fed46096f2e5f4150f6eedf74af76ac9d4b4
2020-01-28 10:33:13 -08:00
Kenny Root
ebbc1b43cc Merge "rebootescrow: allow use of block file" 2020-01-28 17:10:37 +00:00
Jeffrey Vander Stoep
31ddf45500 Merge "untrusted_app: disallow bind RTM_ROUTE socket" 2020-01-28 16:30:18 +00:00
Andrei-Valentin Onea
88da0687fb Merge "Make platform_compat discoverable everywhere" 2020-01-28 12:04:43 +00:00
Oli Lan
ca6ffc2854 Merge "Add sepolicy rules to allow apexd to perform snapshot and restore." 2020-01-28 09:58:02 +00:00
Jeff Vander Stoep
b38a1d8804 untrusted_app: disallow bind RTM_ROUTE socket
Bug: 141455849
Change-Id: I27a8735626a5c3c8aad49e8a68de166f3a10cfde
Test: CtsSelinuxTargetSdkCurrentTestCases
Test: atest bionic-unit-tests-static
Test: atest NetworkInterfaceTest
2020-01-28 10:49:50 +01:00
Treehugger Robot
9baf6d6609 Merge "priv_app: Remove permissions for config_gz" 2020-01-27 22:44:13 +00:00
Kenny Root
960f73b75b rebootescrow: allow use of block file
pmem uses a block file while access_ramoops uses a char file. Allow both for
now until we can unify on pmem.

Additionally allow the reading of vendor properties so it can read the
path to the character or block device to open.

Test: atest VtsHalRebootEscrowTargetTest
Bug: 146400078
Change-Id: Ief61534e0946480a01c635ce1672579959ec8db5
2020-01-27 12:28:44 -08:00
Oli Lan
335d704c77 Add sepolicy rules to allow apexd to perform snapshot and restore.
This adds rules required for apexd to perform snapshot and restore
of the new apex data directories.

See go/apex-data-directories for more information on the feature.

See the chain of CLs up to ag/10169468 for the implementation of
snapshot and restore.

Bug: 141148175
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeSys
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_DeUser
Test: atest StagedRollbackTest#testRollbackApexDataDirectories_Ce
Change-Id: I1756bbc1d80cad7cf9c2cebcee9bee6bc261728c
2020-01-27 18:21:29 +00:00
Ashwini Oruganti
5ab5e8ad20 priv_app: Remove permissions for config_gz
Looking at go/sedenials, we see this permission being used by
MediaProvider once like so:

type=1400 audit(0.0:569759): avc: granted { getattr } for comm=4173796E635461736B202331 path="/proc/config.gz" dev="proc" ino=4026532157 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:config_gz:s0 tclass=file app=com.google.android.providers.media.module

This permission should not be granted to all priv-apps now that GMS core
has been split out into its own domain. This change removes the
permission for the priv_app domain and the corresponding auditallow.

Bug: 147833123
Test: TH
Change-Id: I4f60daefcbdd4991c5d2c32330e907a03bfe6fe5
2020-01-27 10:03:22 -08:00
Jon Spivack
5f11b2e0ed Merge "Revert "Move aidl_lazy_test_server to system_ext"" 2020-01-25 21:29:45 +00:00
Jon Spivack
4eae75c9d4 Revert "Move aidl_lazy_test_server to system_ext"
Revert submission 1209453-aidl-lazy-presubmit

Reason for revert: b/148282665. A test has begun to fail on git_stage-aosp-master, and I need to verify whether these changes are responsible.

Reverted Changes:
Ib09a2460e: Add aidl_lazy_test to general-tests
Ib08989356: Move aidl_lazy_test_server to system_ext
I694e6ad35: Add aidl_lazy_test_server to Cuttlefish
I65db12c63: Add aidl_lazy_test to presubmit
I7ec80a280: Dynamically stop services with multiple interfaces...

Change-Id: I55f6b0f7800f348259787f62c6faa19a90f8bdcc
2020-01-25 02:55:04 +00:00
Treehugger Robot
b9b2acff99 Merge "Whitelisting window_manager_native_boot system property" 2020-01-24 19:52:07 +00:00
Andrei Onea
59da5e821f Make platform_compat discoverable everywhere
The binder's methods are protected by signature
permissions (READ_COMPAT_CHANGE_CONFIG and
OVERRIDE_COMPAT_CHANGE_CONFIG).

Bug: 142650523
Test: atest PlatformCompatTest
Test: atest CompatConfigTest
Test: atest OverrideValidatorImplTest
Change-Id: I65d425aacb120c6481076431151cf43ecab2509f
2020-01-24 17:01:37 +00:00