platform_system_sepolicy/private/vmnic.te
Seungjae Yoo f60a1e0b90 Set sepolicy for vmnic in AVF
Bug: 340376951
Test: Presubmit
Change-Id: I5f48ff4a459805de2f74d160c1b61473c6de0466
2024-05-20 14:15:22 +09:00

18 lines
827 B
Text

is_flag_enabled(RELEASE_AVF_ENABLE_NETWORK, `
# vmnic is a helper service for network tasks, like creating TAP network interface.
# vmnic is separated from virtualizationservice as vmnic requires more permission to do network related tasks.
type vmnic, domain, coredomain;
type vmnic_exec, system_file_type, exec_type, file_type;
# When init runs a file labelled with vmnic_exec, run it in the vmnic domain.
init_daemon_domain(vmnic)
# Let the vmnic domain register the vmnic_service with ServiceManager.
add_service(vmnic, vmnic_service)
# Let the vmnic domain use Binder.
binder_use(vmnic)
# Only virtualizationservice can communicate to vmnic
neverallow { domain -virtualizationservice -servicemanager } vmnic:binder call;
') # is_flag_enabled(RELEASE_AVF_ENABLE_NETWORK)