Commit graph

30236 commits

Author SHA1 Message Date
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
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
Treehugger Robot
037a21ba15 Merge "Add /dev/vsock permissions to microdroid" 2021-08-24 23:35:34 +00:00
Treehugger Robot
56c495fca8 Merge "Remove unnecessary privileges from dex2oat in VM" 2021-08-24 20:23:09 +00:00
Inseob Kim
2e0fb00f22 Add /dev/vsock permissions to microdroid
microdroid_manager needs to know its own CID until the full RPC binder
support is landed.

Bug: 191845268
Test: run MicrodroidDemoApp
Test: atest MicrodroidHostTestCases
Change-Id: I8f6c667f0827d1089baa21417c2b0ba382d94d26
2021-08-24 14:23:18 +09:00
Keith Mok
97935f4898 Merge "Revert "crash_dump: supress denials for files in /proc"" 2021-08-23 16:15:20 +00:00
Victor Hsieh
dedb4909c3 Remove unnecessary privileges from dex2oat in VM
With a change in dex2oat to avoid opening /proc/self/fd, this change
removes open and a few other privileges from dex2oat.

Bug: 196404749
Test: ComposHostTestCases
Change-Id: I822c7ef3886a1cde8601e71afa2eb79973cd573c
2021-08-19 14:01:59 -07:00
Orion Hodson
26d95ebaab Merge "odrefresh: add permission to sigkill child processes" 2021-08-18 10:24:37 +00:00
Suren Baghdasaryan
ce8e066761 Merge "Allow init to execute extra_free_kbytes.sh script" 2021-08-17 19:17:59 +00:00
Eric Biggers
cc0f64416f Merge "Restore permission for shell to list /sys/class/block" 2021-08-17 18:22:55 +00:00
Orion Hodson
522bcbe9e6 odrefresh: add permission to sigkill child processes
Bug: 177432913
Bug: 196969404
Test: manually decrease odrefresh compilation timeout, no avc denied
Change-Id: Ic89dcdb64974ac00c83504d876a94d8b5c6b2a29
2021-08-17 19:08:08 +01:00
Suren Baghdasaryan
6988677f22 Allow init to execute extra_free_kbytes.sh script
extra_free_kbytes.sh is used by init to set /sys/vm/watermark_scale_factor
value. Allow init to execute extra_free_kbytes.sh and the script to access
/proc/sys/vm/watermark_scale_factor and /proc/sys/vm/extra_free_kbytes
files.

Bug: 109664768
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I55ec07e12a1cc5322cfdd4a48d0bdc607f45d832
2021-08-17 17:02:38 +00:00
Rick Yiu
16c9c6a557 Merge "Move mediaprovider_app to common code" 2021-08-17 07:55:03 +00:00
Treehugger Robot
49b13bc0f3 Merge "Remove obsolete file contexts" 2021-08-17 01:15:29 +00:00
Eric Biggers
8b2b951349 Restore permission for shell to list /sys/class/block
As a side effect, commit ec50aa5180 ("Allow the init and apexd
processes to read all block device properties") removed permission for
the shell context to list the /sys/class/block directory.  There is a
CTS test that relies on this (CtsNativeEncryptionTestCases), so grant
permission to do this again.

Bug: 196521739
Bug: 194450129
Test: Before this change, 'adb shell ls /sys/class/block' fails.
      After this change, 'adb shell ls /sys/class/block' succeeds.
Change-Id: I87cb90880f927db1385887b35c84f4dd7f95021b
2021-08-16 10:54:44 -07:00
Bart Van Assche
4dcefe8898 Merge "Add the 'bdev_type' attribute to all block devices" 2021-08-16 16:39:24 +00:00
Victor Hsieh
5f6e4324b3 Allow compos to getattr on authfs
Bug: 161471326
Bug: 196635431
Test: ComposTestCase
Change-Id: I3a4073726d31686c8eb945ba9417cb2afe238d79
2021-08-13 15:48:21 -07:00
Bart Van Assche
27ecd60a79 Add the 'bdev_type' attribute to all block devices
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: I959bae6f9590b1867905d46e194c45b0ea4248df
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-13 13:54:02 -07:00
Victor Hsieh
9ef8696796 Remove obsolete file contexts
Bug: 194474784
Test: can't find "compos_key_main" and "compsvc_worker" in code search
Change-Id: If0959f180f54f798ecd90a12ce71f0570cf14484
2021-08-13 15:03:23 +00:00
Treehugger Robot
2cc457c4fb Merge "Add MicrodroidHostTestCases to TEST_MAPPING" 2021-08-13 04:33:16 +00:00
Inseob Kim
5bc8cb0f5c Add MicrodroidHostTestCases to TEST_MAPPING
Test: presubmit
Change-Id: I9cd6f575f0d7c9764103d09a44a128290bbaf973
2021-08-13 01:19:27 +00:00
Andrew Walbran
21d1710c32 Merge "crosvm now takes all files by FD." 2021-08-12 16:25:50 +00:00
Treehugger Robot
1ca4b5c045 Merge "Define sepolicy for compos and dex2oat" 2021-08-12 14:27:09 +00:00
Treehugger Robot
92d6a4b271 Merge "Grant authfs_service and authfs CAP_SYS_ADMIN" 2021-08-12 14:27:09 +00:00
Rick Yiu
bc2fe2d944 Move mediaprovider_app to common code
The policy under device folder will be removed for GSI, so move the
policy to common code.

Bug: 196326750
Test: build pass
Change-Id: I9544db1771ba7b94a98913bf892386f95cf919be
2021-08-12 17:04:30 +08:00
Victor Hsieh
aa987aaa2d Define sepolicy for compos and dex2oat
Bug: 194474784
Test: ComposTestCase # with debug disabled
Change-Id: I2a53df337356fc8e299837358da2a5a88c9c20d3
2021-08-11 10:42:19 -07:00
Paul Crowley
d46569c261 Merge "Allow vold to deleteAllKeys in Keystore" 2021-08-11 17:39:55 +00:00
Victor Hsieh
5f7c02328c Grant authfs_service and authfs CAP_SYS_ADMIN
CAP_SYS_ADMIN is required to mount a filesystem (currently in authfs, a
child process of authfs_service). It seems the parent also needs to be
allowed.

Bug: 194474784
Test: Use the service (from compsvc), no longer seeing the denials
Change-Id: I122734ee9f11899af4d7b647bc3049e4dbdad09e
2021-08-11 15:48:14 +00:00
Treehugger Robot
d456d11251 Merge "sepolicy: Add supporting for property name with phone id" 2021-08-11 09:03:40 +00:00
EdenSu
8d82a8f10b sepolicy: Add supporting for property name with phone id
Add debug property name with phone id.

Bug: 194281028
Test: Build and verified there is no avc denied in the log
Change-Id: Ia7ca93a3390b2f59e894ca7ebce4cae9c0f83d28
2021-08-11 13:57:54 +08:00
Paul Crowley
bf29c3a2dc Allow vold to deleteAllKeys in Keystore
Add deleteAllKeys to IKeystoreMaintenance and allow vold to call it.
Allow vold to read the property
`ro.crypto.metadata_init_delete_all_keys.enabled`

Bug: 187105270
Test: booted twice on Cuttlefish
Change-Id: I2fb0e94db9d35c1f19ca7acb2f541cfb13c23524
2021-08-10 21:51:09 -07:00
Arthur Ishiguro
e1ced2f4d8 Context Hub stable AIDL sepolicy
Bug: 194285834
Test: TreeHugger
Change-Id: I88675f7f61821619abbff87fa5ee321836745324
2021-08-10 22:06:43 +00:00
Victor Hsieh
a70e6052c2 Allow authfs_service to add itself to service manager
Fixes: 196018177
Test: atest MicrodroidHostTestCases
Change-Id: Ib47b8bf5d5d683e7f163e8f69d8a06ffe8f2675b
2021-08-10 10:55:54 -07:00
Keith Mok
6e9494af08 Merge "Allow crash_dump to read uptime" 2021-08-10 07:25:46 +00:00
Treehugger Robot
6d0f93af27 Merge "sepolicy updates for adding native flag namespace for lmkd" 2021-08-10 02:02:30 +00:00
Jiyong Park
11d2b1c5c9 Merge "Don't prevent crosvm from accessing vendor-owned VM disk images" 2021-08-10 01:34:08 +00:00
Suren Baghdasaryan
592e06c910 sepolicy updates for adding native flag namespace for lmkd
sepolicy updates for running lmkd experiments.

Bug: 194316048
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I21df3b76cce925639385111bd23adf419f026a65
2021-08-09 17:35:09 -07:00
Bart Van Assche
ec50aa5180 Allow the init and apexd processes to read all block device properties
Addressing b/194450129 requires configuring the I/O scheduler and the
queue depth of loop devices. Doing this in a generic way requires
iterating over the block devices under /sys/class/block and also to
examine the properties of the boot device (/dev/sda). Hence this patch
that allows 'init' and 'apexd' to read the properties of all block
devices. The patch that configures the queue depth is available at
https://android-review.googlesource.com/c/platform/system/core/+/1783847.

Test: Built Android images, installed these on an Android device and verified that modified init and apexd processes do not trigger any SELinux complaints.
Change-Id: Icb62449fe0d21b3790198768a2bb8e808c7b968e
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-09 13:46:41 -07:00
Jooyung Han
996da475a1 Merge "microdroid_manager: allow to read dm_device" 2021-08-09 17:49:16 +00:00
Victor Hsieh
14aad3711d Merge "SELinux policy for authfs_service and authfs" 2021-08-09 17:12:22 +00:00
Kelvin Zhang
4b68fb3ff5 Merge "Add sepolicy for build prop for go/vabc-xor" 2021-08-09 14:58:57 +00:00
Jooyung Han
797acf9072 Don't audit microdroid_app getattr vsock_socket
Microdroid_manager creates a vsock socket and app's output is redirected
to it.

Bug: 195751698
Test: MicrodroidHostTestCases
Change-Id: I66759067169cc97a6c1fc084395761e06c6e20f6
2021-08-09 12:50:41 +00:00
Martijn Coenen
a194f2737e Merge "Allow shell to read odsign properties." 2021-08-09 06:45:56 +00:00
Jiyong Park
3fee5a43c1 Don't prevent crosvm from accessing vendor-owned VM disk images
There can be VM disk images that are specific to the underlying SoC.
e.g. in case where SoC-specific hardware is dedicated to a VM and the VM
needs drivers (or HALs) for the hardware.

Don't prevent crosvm from reading such a SoC-specific VM disk images.

Note that this doesn't actually allow crosvm to do that in AOSP. Such an
allow rule could be added in downstreams where such use cases exist.

Bug: 193605879
Test: m
Change-Id: If19c0b6adae4c91676b142324c2903879548a135
2021-08-09 11:13:54 +09:00
Keith Mok
c3e42c0034 Revert "crash_dump: supress denials for files in /proc"
This reverts commit bd247bc88a.

Bug: 193159611
Bug: 183575981
Test: manual

Change-Id: Id79f623d7aa759862a519411f95ab364e9916f6b
2021-08-07 18:01:21 +00:00
Keith Mok
a03659044b Allow crash_dump to read uptime
crash_dump need to read process uptime
which need to be calc by minus the system uptime

Bug: 193159611
Bug: 183575981
Test: manual
Change-Id: I9f071007f31b8101d2d67db19b5d2b2835e6c5a4
2021-08-07 17:59:54 +00:00
Victor Hsieh
49c0ec7a67 SELinux policy for authfs_service and authfs
authfs_service is a binder service on microdroid. Upon a request by the
client, the service will create the mount directory, execute authfs to
mount the FUSE, and finally unmount and delete the mount directory.

authfs currently requires more privileges than it should, but it's ok
because the client owns the VM, and all input will be verified by
signatures. But there is plan to keep the privileges isoated in the
service (b/195554831).

Bug: 194717985
Bug: 195554831
Test: Start the service from init, use a test executable to call the
      service API. Only observed denial from the test executable.
Change-Id: Ie53aa9e2796433fc3182357039d0b7ba1c0848ef
2021-08-06 09:16:48 -07:00
Jooyung Han
2ac60775e0 microdroid_manager: allow to read dm_device
Microdroid_manager should verify payloads(APK/APEXes). APK is mounted to
dm_device first and then verified. So, microdroid_manager needs to read
it.

Bug: 190343842
Test: MicrodroidHostTestCases
Change-Id: I530fb8d2394952486f0bad7fb3bed770611cd311
2021-08-07 00:52:00 +09:00
Andrew Walbran
c0b4a91a90 crosvm now takes all files by FD.
Bug: 192256642
Test: `atest VirtualizationTestCases MicrodroidHostTestCases` on Cuttlefish
Change-Id: I8de557269ba56095b0264a65035296627fba8145
2021-08-06 13:57:17 +00:00