Commit graph

32957 commits

Author SHA1 Message Date
Ytai Ben-Tsvi
7e393109dd Allow audioserver to access sensorservice am: c71b2c18cc
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821634

Change-Id: I637157e5836746048bc597ccc97ad5cb506bf561
2021-09-08 21:50:34 +00:00
Ytai Ben-Tsvi
c71b2c18cc Allow audioserver to access sensorservice
This is required for accessing sensor data in audioserver.

Bug: 188502620
Test: log-based verification of sensor data coming through.
Change-Id: I183ce5106401ae7853096e80a8650cc7919e6221
2021-09-08 11:44:11 -07:00
Jooyung Han
e76a594f6c microdroid: rename property to "apk_root_hash" am: 6f3b5e2edc
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821314

Change-Id: I8954f856c59353da4aec55465f8d3a822f2d182f
2021-09-08 08:32:03 +00:00
Jooyung Han
6f3b5e2edc microdroid: rename property to "apk_root_hash"
Bug: 193504400
Test: atest MicrodroidHostTestCases
Change-Id: I3bd0fd337d85b29e5dfdfba49ee5328e48f5be89
2021-09-08 16:05:29 +09:00
Pirama Arumuga Nainar
a57a7c3dd3 Merge "Allow access to trace_data_file from untrusted_app context" am: b85fd253cd
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1817854

Change-Id: I05763d732d852f1fdf1d4820defd424e69290899
2021-09-07 20:26:12 +00:00
Pirama Arumuga Nainar
b85fd253cd Merge "Allow access to trace_data_file from untrusted_app context" 2021-09-07 19:50:34 +00:00
Yabin Cui
75e283467e Revert "allow simpleperf to profile more app types." am: dd2079d7f0
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1819236

Change-Id: Idc8b4643909998fa47587bebe11c4419860dcd82
2021-09-07 18:51:26 +00:00
Yabin Cui
dd2079d7f0 Revert "allow simpleperf to profile more app types."
This reverts commit 26de4c4ecc.

Reason for revert: security concern

Bug: 199086135
Test: none
Change-Id: I0f3aa7f099121f350e487db4ef0135aa045911cb
2021-09-07 10:18:28 -07:00
Treehugger Robot
1e2b736556 Merge "Microdroid boot process is controlled by microdroid_manager" am: ab5a2c23cf
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1818183

Change-Id: Ibd764c29ee1000557340767fd9eb1623c2e86bdb
2021-09-07 16:38:50 +00:00
Treehugger Robot
ab5a2c23cf Merge "Microdroid boot process is controlled by microdroid_manager" 2021-09-07 16:21:24 +00:00
Pirama Arumuga Nainar
0612731aa5 Allow access to trace_data_file from untrusted_app context
Bug: http://b/170257616

This allows native code in CTS tests to write their coverage profiles.
Like other cases of this pattern, this is only enabled with the
NATIVE_COVERAGE build parameter, and shouldn't affect release build
configurations.

Test: atest -a CtsNdkBinderTestCases and verify non-zero coverage in
      cts/tests/tests/binder_ndk/libbinder_ndk_test/
Change-Id: Id78aa67750f33c4a8ec6e7fcf8418ff23fc27ac7
2021-09-07 09:03:03 -07:00
Woody Lin
69afe58d0d Add userspace_panic_device and userpanic_use am: 7ed2456b45
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1813959

Change-Id: Ic743e5abb62a5760a3c526f4536a1b0a83cc6be7
2021-09-07 09:27:41 +00:00
Jiyong Park
27bb6c6608 Microdroid boot process is controlled by microdroid_manager
Previously, the boot process of microdroid was mostly implemented in the
init.rc file. microdroid_manager was started first in the background,
then apexd, apkdmverity, and zipfuse were executed in sequence. However,
in order to correctly implement the app payload verification scheme,
most of the early boot process has to be controlled by
microdroid_manager. Specifically, apkdmverity should be started "after"
the apk roothash is read from the instance disk by microdroid_manager.

As an alternative, we could let apkdmverity the read instance disk by
itself. However, this is undesirable because doing so requires multiple
processes - microdroid_manager and apkdmverity - have access to the
instance disk and more seriously the secret key to decrypt it.

Another alternative is to let microdroid_manager do the dm-verity
configuration which apkdmverity does. This also is considered
undesirable because then we would give the permissions for configuring
dm-verity devices to microdroid_manager which is a long-running daemon
process. Note that apkdmverity is not a daemon process.

This CL introduces a few number of changes which are required to let
microdroid_manager directly control the early boot process:

1) microdroid_manager is allowed to start the services apkdmverity and
zipfuse by using the `ctl.start` sysprop.

2) apkdmverity is allowed to use bootstrap bionic libraries as it is now
executed before APEXd activates the APEXes.

3) A new sysprop `microdroid_manager.apk_roothash` is added. It is
written by microdroid_manager and read by apkdmverity. It contains the
roothash read from the instance disk. This value is not a secret.

4) Another new sysprop `apex_config.done` is added. It is set by init
just after `perform_apex_config` and read by microdroid_manager.
Microdroid_manager uses this to wait until linker configuration is ready
so that it can execute app payloads with the config.

Bug: 193504400
Test: atest MicrodroidHostTestCases
Change-Id: If29ce17d7a6cb4859e8ceeffb321724e7f11bf82
2021-09-07 17:13:43 +09:00
Woody Lin
7ed2456b45 Add userspace_panic_device and userpanic_use
Define type userspace_panic_device and macro userpanic_use for init,
llkd, and system_server to access /dev/userspace_panic - a kernel file
node for userspace processes to request kernel panic.

Bug: 188777408
Change-Id: I1e9d115d85f664aa84bdd6bb4b95bdb48e3aab9a
2021-09-07 01:18:25 +08:00
Alan Stokes
8d90131012 Merge "SEPolicy for compos_verify_key." am: d1ac340034
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1818452

Change-Id: I22c4c3ed09c2db1ee66f524b9ca1d5e4c26c0b91
2021-09-06 08:08:49 +00:00
Alan Stokes
d1ac340034 Merge "SEPolicy for compos_verify_key." 2021-09-06 07:55:58 +00:00
Bart Van Assche
5ebe643596 Add the 'bdev_type' attribute to all block device types am: d05534f3d5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1816979

Change-Id: If14fc996690a70802f3e5ed4e807fc966de4d783
2021-09-03 22:28:44 +00:00
Alan Stokes
39f497013c SEPolicy for compos_verify_key.
Remove some allow rules for odsign, since it no longer directly
modifies CompOs files. Instead allow it to run compos_verify_key in
its own domain.

Grant compos_verify_key what it needs to access the CompOs files and
start up the VM.

Currently we directly connect to the CompOs VM; that will change once
some in-flight CLs have landed.

As part of this I moved the virtualizationservice_use macro to
te_macros so I can use it here. I also expanded it to include
additional grants needed by any VM client that were previously done
for individual domains (and then deleted those rules as now
redundant).

I also removed the grant of VM access to all apps; instead we allow it
for untrusted apps, on userdebug or eng builds only. (Temporarily at
least.)

Bug: 193603140
Test: Manual - odsign successfully runs the VM at boot when needed.
Change-Id: I62f9ad8c7ea2fb9ef2d468331e26822d08e3c828
2021-09-03 16:31:02 +01:00
Bart Van Assche
d05534f3d5 Add the 'bdev_type' attribute to all block device types
The following patch iterates over all block devices:
https://android-review.googlesource.com/c/platform/system/core/+/1783847/9

The following patch grants 'init' and 'apexd' permission to iterate over
all block devices:
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1783947

The above SELinux policy change requires to add the 'bdev_type'
attribute to all block devices. Hence this patch.

Bug: 194450129
Test: Untested.
Change-Id: I706285544f348944ca0c24e031b7c4e1052ec390
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-09-02 10:13:16 -07:00
Tianjie Xu
60587b5246 Merge "Set context for partition.*.verified.root_digest properties." am: e4623f3219
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1814306

Change-Id: Ifeafda46ef76a11118efa5b0094fc5453331d384
2021-09-01 17:59:03 +00:00
Tianjie Xu
e4623f3219 Merge "Set context for partition.*.verified.root_digest properties." 2021-09-01 17:47:11 +00:00
Treehugger Robot
3367996656 Merge "allow installd to kill dex2oat and dexoptanalyzer" am: 4442c1f7eb
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1798367

Change-Id: I8412c792979bc2a4f1aadb41016bdc210621d924
2021-09-01 17:24:58 +00:00
Treehugger Robot
4442c1f7eb Merge "allow installd to kill dex2oat and dexoptanalyzer" 2021-09-01 17:11:23 +00:00
Treehugger Robot
44cff45716 Merge "Allow microdroid_manager to write instance.img" am: c5cc2e9730
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1811876

Change-Id: Ie0c61c582b4ab934d213044e2f7719cf6aa4ebff
2021-09-01 09:49:53 +00:00
Treehugger Robot
c5cc2e9730 Merge "Allow microdroid_manager to write instance.img" 2021-09-01 09:38:41 +00:00
Jiyong Park
ee3661ef2b Allow microdroid_manager to write instance.img
Bug: 193504400
Test: atest MicrodroidHostTestCases
Change-Id: Icac8aa7e1badc90d2725c81e3c0f9594b7e18608
2021-08-31 17:14:09 +09:00
Tianjie
ade005f8dd Set context for partition.*.verified.root_digest properties.
This is requested by the partner engineer team to uniquely identify
a partition.

Bug: 197973981
Test: boot the device
Change-Id: Id0393698d730391eb8e438e424e527451f54d4ea
2021-08-30 17:13:51 -07:00
Roshan Pius
d5b3963233 Mark uwb apex data directory as system_server_data_dir am: 0f98b1c6bb
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1813957

Change-Id: I46e8c558d2a6a8ed350911e45045c4972df2e577
2021-08-30 21:27:03 +00:00
Roshan Pius
0f98b1c6bb Mark uwb apex data directory as system_server_data_dir
UWB stack needs to persist state inside it's apex directory.

Denial logs:
08-30 19:44:53.670  1635  1635 W queued-work-loo: type=1400 audit(0.0:9):
avc: denied { write } for name="com.android.uwb" dev="dm-40" ino=206
scontext=u:r:system_server:s0 tcontext=u:object_r:apex_module_data_file:s0
tclass=dir permissive=0

Bug: 197963882
Test: Verified shared preferences file creation/write under uwb
apex data directory.

Change-Id: Ic4925822ca7e01cd23aea6805c80720f2a3db9d7
2021-08-30 13:03:08 -07:00
Roshan Pius
fbfb4a8b89 Allow uwb HAL client/server to talk to service manager am: 3015324460
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1811079

Change-Id: Ia652e5350fd0cf86ad8648a04c4d27f50bd06c50
2021-08-28 00:26:44 +00:00
Roshan Pius
3015324460 Allow uwb HAL client/server to talk to service manager
Denial logs:
08-27 21:43:18.716   801   801 W android.hardwar: type=1400 audit(0.0:4): avc:
denied { call } for scontext=u:r:hal_uwb_default:s0 tcontext=u:r:servicemanager:s0
tclass=binder permissive=0

Bug: 195308730
Test: Bootup default UWB HAL implementation on cuttlefish & verify UCI stack
can talk to the HAL.

Change-Id: I493af52513fd5b8f89d1375f80226ffa10c34f48
2021-08-28 00:01:59 +00:00
Ankita Vyas
e0d6c3604f Merge "Add selinux changes for Locale Manager Service" am: 7ac013be94
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1810459

Change-Id: Idd51d097ffd18b7e0f4c47e4e83221d24b787b94
2021-08-27 04:13:38 +00:00
Ankita Vyas
7ac013be94 Merge "Add selinux changes for Locale Manager Service" 2021-08-27 03:59:42 +00:00
Treehugger Robot
209b78ab83 Merge "sepolicy: Change UWB HAL from HIDL to versioned AIDL" am: d7fc7bd30b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1809163

Change-Id: I423431ce2bee07fd3c2a968f4c59799b17fa71c6
2021-08-27 01:55:54 +00:00
Treehugger Robot
d7fc7bd30b Merge "sepolicy: Change UWB HAL from HIDL to versioned AIDL" 2021-08-27 01:45:00 +00:00
Roshan Pius
7076dfaa4f Merge "sepolicy: Add UWB HAL interface in AOSP" am: ea6c84b560
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1808158

Change-Id: I8168654bf875acbec024e8a2d144cbfb0486ef17
2021-08-27 00:37:05 +00:00
Roshan Pius
cd8333b53a sepolicy: Change UWB HAL from HIDL to versioned AIDL
No new HIDL HAL's are allowed in Android T. UWB HAL converted to
versioned AIDL interface to be compliant.

Bug: 195308730
Test: Compiles
Change-Id: I35cf8edd244baa02778ee8eff46840ae26424869
2021-08-27 00:28:56 +00:00
Roshan Pius
ea6c84b560 Merge "sepolicy: Add UWB HAL interface in AOSP" 2021-08-27 00:25:17 +00:00
Treehugger Robot
b99ff7ee1b [automerger skipped] Merge "sepolicy: Rename hal_uwb -> hal_uwb_vendor" am: 0e88c8807f -s ours
am skip reason: Merged-In I7bf4794232604372134ea299c8e2a6ba14a801d3 with SHA-1 37ee61f663 is already in history

Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1808157

Change-Id: I91c8a1ba4b33a915380d3dc6d358ebe0642cdd76
2021-08-26 16:02:27 +00:00
Treehugger Robot
0e88c8807f Merge "sepolicy: Rename hal_uwb -> hal_uwb_vendor" 2021-08-26 15:51:45 +00:00
“Ankita
623ece0386 Add selinux changes for Locale Manager Service
Test: build and booted device

Bug: 194094788

Change-Id: Ic3c1f135985a5003ed07a8da9dbd7a3f8b61ae71
2021-08-26 14:33:24 +00:00
Roshan Pius
37ee61f663 sepolicy: Rename hal_uwb -> hal_uwb_vendor
Since we are now creating an AOSP HAL for uwb. Rename Pixel specific
internal UWB HAL from Android S to hal_uwb_vendor to avoid conflicts
with the AOSP HAL sepolicy rules that are going to be added in
Android T.

Android S Architecture:
|Apps | AOSP API | Vendor Service | Vendor HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Android T Architecture:
|Apps | AOSP API | AOSP Service | AOSP HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Ignore-AOSP-First: Dependent changes in internal-only projects.

Bug: 195308730
Test: Compiles
Change-Id: I7bf4794232604372134ea299c8e2a6ba14a801d3
Merged-In: I7bf4794232604372134ea299c8e2a6ba14a801d3
(cherry picked from commit 40465250e4)
(cherry picked from commit 27ab309fad)
2021-08-26 05:20:39 +00:00
Treehugger Robot
28515dd083 Merge "sepolicy: Add new crypto type ro.crypto.type=managed" am: aedbe31acb
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1802147

Change-Id: I0e8e1faed5cc0cb92a4cae6debeb6d67a7430049
2021-08-26 04:51:40 +00:00
Treehugger Robot
aedbe31acb Merge "sepolicy: Add new crypto type ro.crypto.type=managed" 2021-08-26 04:37:37 +00:00
Treehugger Robot
43a5bb124a Merge "Allow Bluetooth to access system config" am: 2ce33d50bc
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1804066

Change-Id: I812dd99f043b63ddf8405bc19a76b78b58c95305
2021-08-25 13:52:20 +00:00
Treehugger Robot
2ce33d50bc Merge "Allow Bluetooth to access system config" 2021-08-25 13:40:12 +00:00
wescande
4b6a6aa861 Allow Bluetooth to access system config
The removing of getSystemConfigEnabledProfilesForPackage
hidden api for mainline project triggered a SEDenial:
```
avc: denied { read } for comm="droid.bluetooth" name="u:object_r:incremental_prop:s0" dev="tmpfs" ino=20229 scontext=u:r:bluetooth:s0 tcontext=u:object_r:incremental_prop:s0 tclass=file permissive=0
avc: denied { open } for comm="droid.bluetooth" path="/dev/__properties__/u:object_r:incremental_prop:s0" dev="tmpfs" ino=180 scontext=u:r:bluetooth:s0 tcontext=u:object_r:incremental_prop:s0 tclass=file permissive=0
avc: denied { getattr } for comm="droid.bluetooth" path="/dev/__properties__/u:object_r:incremental_prop:s0" dev="tmpfs" ino=180 scontext=u:r:bluetooth:s0 tcontext=u:object_r:incremental_prop:s0 tclass=file permissive=0
avc: denied { map } for comm="droid.bluetooth" path="/dev/__properties__/u:object_r:incremental_prop:s0" dev="tmpfs" ino=180 scontext=u:r:bluetooth:s0 tcontext=u:object_r:incremental_prop:s0 tclass=file permissive=0

avc: denied { read } for comm="droid.bluetooth" name="filesystems" dev="proc" ino=4026532079 scontext=u:r:bluetooth:s0 tcontext=u:object_r:proc_filesystems:s0 tclass=file permissive=0
avc: denied { open } for comm="droid.bluetooth" path="/proc/filesystems" dev="proc" ino=4026532079 scontext=u:r:bluetooth:s0 tcontext=u:object_r:proc_filesystems:s0 tclass=file permissive=0
avc: denied { getattr } for comm="droid.bluetooth" path="/proc/filesystems" dev="proc" ino=4026532079 scontext=u:r:bluetooth:s0 tcontext=u:object_r:proc_filesystems:s0 tclass=file permissive=0
```

Bug: 190440540
Test: Manual
Tag: #refactor
Change-Id: I86c77e540d783a4286a15cdf66b083aae1a55589
2021-08-25 12:33:00 +00:00
Roshan Pius
8a5370c5e4 sepolicy: Add UWB HAL interface in AOSP
Adding sepolicy rules for the AOSP HAL interface.

Ignore-AOSP-First: Dependent changes in internal-only projects.

Bug: 195308730
Test: Compiles
Change-Id: I56302b570a749f7d72b6fe8f4f4a8767ea4785c1
Merged-In: I56302b570a749f7d72b6fe8f4f4a8767ea4785c1
2021-08-24 20:10:21 -07:00
Roshan Pius
65e938e539 sepolicy: Rename hal_uwb -> hal_uwb_vendor
Since we are now creating an AOSP HAL for uwb. Rename Pixel specific
internal UWB HAL from Android S to hal_uwb_vendor to avoid conflicts
with the AOSP HAL sepolicy rules that are going to be added in
Android T.

Android S Architecture:
|Apps | AOSP API | Vendor Service | Vendor HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Android T Architecture:
|Apps | AOSP API | AOSP Service | AOSP HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Ignore-AOSP-First: Dependent changes in internal-only projects.

Bug: 195308730
Test: Compiles
Change-Id: I7bf4794232604372134ea299c8e2a6ba14a801d3
Merged-In: I7bf4794232604372134ea299c8e2a6ba14a801d3
2021-08-24 20:10:06 -07:00
Satoshi Niwa
dd9d2871d8 sepolicy: Add new crypto type ro.crypto.type=managed
This type is used when device encryption is managed by the host system.
(e.g. ARC++)
Please see b/136127632#comment10 for the reason why we introduce this.

Bug: 169207445
Test: m
Change-Id: I8c4eaa57389e591b2c520b59bb95408d43daf22c
2021-08-25 10:40:57 +09:00