blob: 706a6ca22a94c95e49d544bc15f2c14db6cefdd1 [file] [log] [blame]
Inseob Kim825056d2023-08-01 11:00:49 +09001# vfio_handler is a helper service for VFIO tasks, like binding platform devices to VFIO driver.
2# vfio_handler is separate from virtualizationservice as VFIO tasks require root.
3type vfio_handler, domain, coredomain;
4type vfio_handler_exec, system_file_type, exec_type, file_type;
5
6# When init runs a file labelled with vfio_handler_exec, run it in the vfio_handler domain.
7init_daemon_domain(vfio_handler)
8
9# Let the vfio_handler domain register the vfio_handler_service with ServiceManager.
10add_service(vfio_handler, vfio_handler_service)
11
12# Let the vfio_handler domain use Binder.
13binder_use(vfio_handler)
14
15# Allow vfio_handler to check if VFIO is supported
16allow vfio_handler vfio_device:chr_file getattr;
17allow vfio_handler vfio_device:dir r_dir_perms;
18
19# Allow vfio_handler to bind/unbind platform devices
20allow vfio_handler sysfs:dir r_dir_perms;
21allow vfio_handler sysfs:file rw_file_perms;
22
23# Only vfio_handler can add vfio_handler_service
24neverallow { domain -vfio_handler } vfio_handler_service:service_manager add;