Andrew Walbran | 4b80a3f | 2021-05-21 13:21:43 +0000 | [diff] [blame^] | 1 | type virtualizationservice, domain, coredomain; |
| 2 | type 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. |
| 6 | init_daemon_domain(virtualizationservice) |
| 7 | |
| 8 | # Let the virtualizationservice domain use Binder. |
| 9 | binder_use(virtualizationservice) |
| 10 | |
| 11 | # Let the virtualizationservice domain register the virtualization_service with ServiceManager. |
| 12 | add_service(virtualizationservice, virtualization_service) |
| 13 | |
| 14 | # When virtualizationservice execs a file with the crosvm_exec label, run it in the crosvm domain. |
| 15 | domain_auto_trans(virtualizationservice, crosvm_exec, crosvm) |
| 16 | |
| 17 | # Let virtualizationservice exec other files (e.g. mk_cdisk) in the same domain. |
| 18 | allow virtualizationservice system_file:file execute_no_trans; |
| 19 | |
| 20 | # Let virtualizationservice kill crosvm. |
| 21 | allow virtualizationservice crosvm:process sigkill; |
| 22 | |
| 23 | # Let virtualizationservice access its data directory. |
| 24 | allow virtualizationservice virtualizationservice_data_file:file create_file_perms; |
| 25 | allow virtualizationservice virtualizationservice_data_file:dir create_dir_perms; |