Commit graph

19 commits

Author SHA1 Message Date
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
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
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
Inseob Kim
7687600c50 Suppress power_supply access inside microdroid
Bug: 193118220
Test: atest MicrodroidHostTestCases
Change-Id: I3dbdcb831c61e9bd24cfdaa10beba9e856e605af
2021-08-05 02:05:16 +00:00
Inseob Kim
2f4b03654a Add servicemanager's service to microdroid policy
Bug: 193118220
Test: atest MicrodroidHostTestCases
Change-Id: I0e57fa913fe857626634f94502b1ad5a0989bdc8
2021-08-04 11:35:57 +00:00
Inseob Kim
0abc4fdf2b Temporarily dontaudit ueventd->tmpfs access
This is the only blocker for SELinux denial test on microdroid. Rather
than consuming more time, this temporarily suppresses the audit message
to turn on the test.

Bug: 193118220
Test: atest MicrodroidHostTestCases -c
Change-Id: Id703107cbaae42352bebe34d0a6373f0701c0f6f
2021-08-04 10:58:22 +00:00
Inseob Kim
ebc11f6a99 Merge "Suppress keystore F2FS related audit" 2021-08-03 02:19:15 +00:00
Inseob Kim
6b5eafedf9 Suppress keystore F2FS related audit
keystore uses sqlite3. sqlite3 calls F2FS_IOC_GET_FEATURES. As
microdroid has nothing to do with that, we just suppress the audit.

Bug: 193118220
Test: atest MicrodroidHostTestCases
Change-Id: I1da00d1fd4b7e208e80a1d9bc5f49c21af684516
2021-07-29 12:18:31 +00:00
Jooyung Han
f9a7dab645 Microdroid_manager is a bootstrap process
Bug: 190343842
Test: MicrodroidHostTestCases
Change-Id: Iaec029726a34f46fd9123d34765a20a1c5dd254a
2021-07-29 17:40:05 +09:00
Alan Stokes
80bb558584 Remove compos_key_cmd from policy
It's a test tool which is generally run as root, and will be deleted
eventually. It doesn't need its own label; system_file works fine.

We never actually allowed it anything, nor defined a transition into
the domain.

Bug: 194474784
Test: Device boots, no denials
Test: compos_key_cmd run from root works
Change-Id: If118798086dae2faadeda658bc02b6eb6e6bf606
2021-07-28 14:36:50 +01:00
Inseob Kim
1f87fbd9fa Add microdroid_payload attribute
microdroid_payload attribute is for processes meant to be run by
microdroid_manager as a payload. Other than microdroid_payload and
crash_dump, transition from microdroid_manager will not be permitted.

Bug: 191263171
Test: atest MicrodroidHostTestCases
Test: atest ComposHostTestCases
Change-Id: I959a8ad8ed83c8de254d7af61fd30bcbffe6b070
2021-07-27 08:30:22 +00:00
Alan Stokes
72cac09097 Add rules for dex2oat.
This is necessary (but not sufficient) to allow CompOsTestCase to
run. Without it we have problems because
system/sepolicy/apex/com.android.art-file_contexts references
dex2oat_exec, and we get an error:

SELinux : Context u:object_r:dex2oat_exec:s0 is not valid (left unmapped).

Bug: 194474784
Test: atest CompOsTestCase (with memory fix patched in)
Change-Id: If229b9891c8fb1acce8d0502675c1712bfed180c
2021-07-23 12:26:26 +01:00
Treehugger Robot
6a4bc81a2b Merge changes I43bf09d8,I1fd35d0e
* changes:
  Disallow microdroid from running arbitrary domains
  Add domain for compos binaries
2021-07-23 09:29:53 +00:00
Inseob Kim
a89d6aa301 Disallow microdroid from running arbitrary domains
Test: atest MicrodroidHostTestCases
Test: atest ComposHostTestCases
Change-Id: I43bf09d85efa4276e929babd854c49ccedfd8058
2021-07-23 06:58:52 +00:00
Jiyong Park
f326072b40 Add more rules around cgroup files in microdroid
The added rules are copied from Android.

Bug: 193118995
Bug: 193118220
Test: adb shell /apex/com.android.virt/bin/vm run-app
/data/local/tmp/virt/MicrodroidDemoApp.apk
/data/local/tmp/virt/MicrodroidDemoApp.apk.idsig
/data/local/tmp/virt/instance.img assets/vm_config.json doesn't show
a selinux denial like the below:
avc:  denied  { create } for  pid=1 comm="init" name="cpus"
scontext=u:r:init:s0 tcontext=u:object_r:cgroup:s0 tclass=file
permissive=0

Change-Id: I3d958e4788fdee5993ff1048e86b81cd93b72b03
2021-07-23 15:48:17 +09:00
Inseob Kim
7560aed40a Add domain for compos binaries
Bug: 191263171
Test: atest MicrodroidHostTestCases
Test: atest ComposHostTestCases
Change-Id: I1fd35d0efe83d2cecaa41580e6d1d0b8f6242b3f
2021-07-23 06:01:39 +00:00
Inseob Kim
e1389977e0 Move microdroid sepolicy to system/sepolicy
Bug: 190511750
Test: boot microdroid
Change-Id: I4aa4a56e9be5103d70469c3508110a973f3e4f12
2021-07-19 07:48:34 +00:00