diff --git a/policy/modules/apps/qemu.if b/policy/modules/apps/qemu.if index 95bb89d..8d8d961 100644 --- a/policy/modules/apps/qemu.if +++ b/policy/modules/apps/qemu.if @@ -157,6 +157,24 @@ interface(`qemu_domtrans',` ######################################## ## +## Execute a qemu in the callers domain +## +## +## +## Domain allowed access. +## +## +# +interface(`qemu_exec',` + gen_require(` + type qemu_exec_t; + ') + + can_exec($1, qemu_exec_t) +') + +######################################## +## ## Execute qemu in the qemu domain. ## ## diff --git a/policy/modules/services/virt.te b/policy/modules/services/virt.te index 8f0fac9..5a77c23 100644 --- a/policy/modules/services/virt.te +++ b/policy/modules/services/virt.te @@ -43,6 +43,13 @@ gen_tunable(virt_use_sysfs, false) ## ## +## Allow virtual machine to interact with the xserver +## +## +gen_tunable(virt_use_xserver, false) + +## +## ## Allow virt to use usb devices ## ## @@ -178,6 +185,12 @@ tunable_policy(`virt_use_usb',` ') optional_policy(` + tunable_policy(`virt_use_xserver',` + xserver_stream_connect(svirt_t) + ') +') + +optional_policy(` xen_rw_image_files(svirt_t) ') @@ -426,6 +439,7 @@ optional_policy(` qemu_kill(virtd_t) qemu_setsched(virtd_t) qemu_entry_type(virt_domain) + qemu_exec(virt_domain) ') optional_policy(`
+## Allow virtual machine to interact with the xserver +##
## Allow virt to use usb devices ##