blob: 4c6f1f9112eb89f31a22a684a957eb274d0a6c64 [file] [log] [blame]
Andrew Walbran4b80a3f2021-05-21 13:21:43 +00001type virtualizationservice, domain, coredomain;
2type virtualizationservice_exec, system_file_type, exec_type, file_type;
3
4# When init runs a file labelled with virtualizationservice_exec, run it in the
5# virtualizationservice domain.
6init_daemon_domain(virtualizationservice)
7
8# Let the virtualizationservice domain use Binder.
9binder_use(virtualizationservice)
10
11# Let the virtualizationservice domain register the virtualization_service with ServiceManager.
12add_service(virtualizationservice, virtualization_service)
13
14# When virtualizationservice execs a file with the crosvm_exec label, run it in the crosvm domain.
15domain_auto_trans(virtualizationservice, crosvm_exec, crosvm)
16
17# Let virtualizationservice exec other files (e.g. mk_cdisk) in the same domain.
18allow virtualizationservice system_file:file execute_no_trans;
19
20# Let virtualizationservice kill crosvm.
21allow virtualizationservice crosvm:process sigkill;
22
23# Let virtualizationservice access its data directory.
24allow virtualizationservice virtualizationservice_data_file:file create_file_perms;
25allow virtualizationservice virtualizationservice_data_file:dir create_dir_perms;