Commit graph

32884 commits

Author SHA1 Message Date
Treehugger Robot
62858f1178 Merge "Initial sepolicy for composd" am: 0bbfc68a49
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1824054

Change-Id: I52b316146c7c3c9ee234fcd11f2a80b5abada3ad
2021-09-13 11:59:14 +00:00
Treehugger Robot
0bbfc68a49 Merge "Initial sepolicy for composd" 2021-09-13 11:47:21 +00:00
Alan Stokes
d376e2041f Initial sepolicy for composd
Add what we need to allow composd to run and expose an AIDL service.

Also delete the policy for compsvc; we never access it in the host
now, and the real policy is in microdroid. Retain the compos_exec
type, since it is referenced in the APEX sepolicy.

Bug: 186126194
Test: adb shell cmd -w android.system.composd; no denials.
Change-Id: I5f06b2b01852cdebd2d67009b363ec08b17ce33a
2021-09-13 10:33:53 +01:00
Jooyung Han
55bac72d44 Allow microdroid_manager to create a /apex/* file am: 6e60287a1f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1823813

Change-Id: Ia41ec5bb715be17ae031786fd1de454a0be81e06
2021-09-10 14:58:58 +00:00
Jooyung Han
6e60287a1f Allow microdroid_manager to create a /apex/* file
Microdroid_manager needs to pass APEX pubkeys to APEXd. Since the data
is too big for a system property, it creates a file
/apex/vm-payload-metadata so that APEXd reads/uses it.

Bug: 199371341
Test: MicrodroidHostTestCases
Change-Id: Iaf2b4fc08b36610032d9c339f787e5e34994448b
2021-09-10 17:35:26 +09:00
Jooyung Han
2e80ad5fd9 Merge "make zipfuse a bootstrap process" am: f19cd64a0e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821986

Change-Id: I96cd2336ab637726e900d1760a4ee7d6c143a60d
2021-09-10 08:27:25 +00:00
Jooyung Han
f19cd64a0e Merge "make zipfuse a bootstrap process" 2021-09-10 08:16:31 +00:00
Treehugger Robot
77b9fbf4c0 Merge "Add the 'bdev_type' attribute to all block device types" am: 68e5958902
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821935

Change-Id: Ifb345fe53482c49b370ea71e787601d7ff35769b
2021-09-10 01:41:23 +00:00
Treehugger Robot
68e5958902 Merge "Add the 'bdev_type' attribute to all block device types" 2021-09-10 01:27:48 +00:00
Treehugger Robot
b7f4c1a252 Merge "allow system server to read extcon state and type from sysfs" am: a37bf10692
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821341

Change-Id: Ib1f53e2e731c875ac3d5e78bec28fd958cc7d671
2021-09-10 01:14:37 +00:00
Gregory Montoir
505fc17f35 Merge "Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6}" am: 2881a253da
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821714

Change-Id: I1f8438ef4f5119b63a4b99e4cf8f2026dc4ce5c8
2021-09-10 01:13:52 +00:00
Treehugger Robot
a37bf10692 Merge "allow system server to read extcon state and type from sysfs" 2021-09-10 01:12:49 +00:00
Gregory Montoir
2881a253da Merge "Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6}" 2021-09-10 00:47:09 +00:00
Jooyung Han
53c773a3fd make zipfuse a bootstrap process
Bug: n/a
Test: MicrodroidHostTestCases
Change-Id: Ia2ad615e919f4fcb0452d8458e505ecfbdd5818f
2021-09-10 08:56:08 +09:00
Christopher Ferris
a325b5c195 Merge "Allow crash_dump to read from /data/local/tests." am: adaabe529c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821636

Change-Id: Id23835b202676224eac8c57b1322d55df28cd87f
2021-09-09 23:43:49 +00:00
Christopher Ferris
adaabe529c Merge "Allow crash_dump to read from /data/local/tests." 2021-09-09 23:20:41 +00:00
Christopher Ferris
f2acb20e1b Allow crash_dump to read from /data/local/tests.
Without this change, any crash from an executable in /data/local/tests
is incomplete. Specifically, function names are missing which makes
the crash nearly useless for debugging.

Bug: 197229540

Test: Used the crasher executable and copied it to /data/local/tests
Test: and verified that running it as root and shell results in
Test: tombstones that have full unwinds with function names.
Change-Id: Ic4862ca6ee9b02132a593ccd5fe26508ed5c8510
2021-09-09 14:49:36 -07:00
Bill Yi
9a0413097d [automerger skipped] Merge "Merge RQ3A.210905.001 to aosp-master - DO NOT MERGE" am: a053861726 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Icd035d4da1c121208db96d019dec43a8e1a4f665
2021-09-09 21:39:32 +00:00
Bill Yi
a053861726 Merge "Merge RQ3A.210905.001 to aosp-master - DO NOT MERGE" 2021-09-09 21:27:25 +00:00
Hongguang
8e5d3d469f allow system server to read extcon state and type from sysfs
The target device needs to lable the SoC's extcons to sysfs_extcon in
the device's vendor sepolicy to allow the system_server access.

Bug: 152245127
Bug: 193492798
Bug: 193114615
Test: pressubmit and manual
Change-Id: Ib0a90ac5ce2c9437b19d6dc1e0b2cc50fed41dc3
2021-09-09 14:15:19 -07:00
Gregory Montoir
0e1044ae8f Allow adbd to access /proc/net/{tcp,tcp6,udp,udp6}
File accesses go through com.android.ddmlib.SyncService for CTS
ListeningPortsTest.

Bug: 193151739
Change-Id: I0c66fb5e35cda3b1799cf003402e454d7a951e96
2021-09-09 14:31:15 +08:00
Inseob Kim
a2b2fa2e01 Add vsock permissions to microdroid_payload am: 2f7600920d
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1818016

Change-Id: I1c475f82eb85e1fb531302e3825e4522841fca3c
2021-09-09 06:24:06 +00:00
Alan Stokes
872a6f52aa Restrict VM usage to platform_app. am: f96cd6557e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1820377

Change-Id: I61be7eadb593bef05d1afa7bda448dfb1978bbe0
2021-09-09 04:34:17 +00:00
Inseob Kim
2f7600920d Add vsock permissions to microdroid_payload
microdroid_payload needs to open a vsock server, so this change grants
permissions for that. This change also temporarily grants permissions to
get local CID, which should be removed once the RPC binder API supports
getting CID.

Bug: 195381416
Test: atest MicrodroidHostTestCases
Change-Id: I57a603e74d7552e13a83fa4934621e09e13015fd
2021-09-09 02:30:59 +00:00
Alan Stokes
f96cd6557e Restrict VM usage to platform_app.
Remove access from untrusted apps and instead grant it to platform_app
(but on user builds as well as debug).

Also restrict any app from creating a vsock_socket; using an already
created one is fine.

Bug: 193373841
Test: Microdroid demo app now gets a denial
Test: Rebuild demo with certifcate: platform, adb install, no denial
Change-Id: I7be011e05244767a42d4c56e26de792db4fe599d
2021-09-09 02:30:43 +00:00
Bill Yi
82fd149648 Merge RQ3A.210905.001 to aosp-master - DO NOT MERGE
Merged-In: I637157e5836746048bc597ccc97ad5cb506bf561
Merged-In: I7666150b5e36ef12e4bb4cc0d27bc48dc8bd8449
Merged-In: I7666150b5e36ef12e4bb4cc0d27bc48dc8bd8449
Change-Id: I5e73ddfc69c46aed26cb2a28533d2210c000c635
2021-09-08 17:57:11 -07:00
Bart Van Assche
8a6f8e51bc 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.
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Change-Id: Iee1c984f176eb2752194493999921cb1aa24ac64
2021-09-08 16:13:25 -07:00
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