blob: b139286a4d7b811deacdd37f07e5dc48e71adb0d [file] [log] [blame]
Andrew Walbrana995e842021-03-29 17:19:12 +00001type crosvm, domain, coredomain;
2type crosvm_exec, system_file_type, exec_type, file_type;
3type crosvm_tmpfs, file_type;
4
5# Let crosvm create temporary files.
6tmpfs_domain(crosvm)
7
Andrew Walbran4b80a3f2021-05-21 13:21:43 +00008# Let crosvm receive file descriptors from VirtualizationService.
9allow crosvm virtualizationservice:fd use;
Andrew Walbrana995e842021-03-29 17:19:12 +000010
11# Let crosvm open /dev/kvm.
12allow crosvm kvm_device:chr_file rw_file_perms;
13
14# Most other domains shouldn't access /dev/kvm.
15neverallow { domain -crosvm -ueventd -shell } kvm_device:chr_file getattr;
16neverallow { domain -crosvm -ueventd } kvm_device:chr_file ~getattr;
Andrew Walbran9b2fa1b2021-07-01 15:58:26 +000017
18# Let crosvm read and write files from clients of virtualizationservice, but not open them directly
19# as they must be passed via virtualizationservice.
20allow crosvm apk_data_file:file { getattr read };
21allow crosvm app_data_file:file { getattr read write };
22# shell_data_file is used for automated tests and manual debugging.
23allow crosvm shell_data_file:file { getattr read write };