|
Dan Walsh |
b4b026 |
diff -up serefpolicy-3.10.0/policy/modules/apps/qemu.te.qemu serefpolicy-3.10.0/policy/modules/apps/qemu.te
|
|
Dan Walsh |
38087d |
--- serefpolicy-3.10.0/policy/modules/apps/qemu.te.qemu 2011-10-27 14:01:31.490807653 -0400
|
|
Dan Walsh |
38087d |
+++ serefpolicy-3.10.0/policy/modules/apps/qemu.te 2011-10-27 14:01:33.082806413 -0400
|
|
Dan Walsh |
b4b026 |
@@ -40,9 +40,7 @@ gen_tunable(qemu_use_nfs, true)
|
|
Dan Walsh |
b4b026 |
## </desc>
|
|
Dan Walsh |
b4b026 |
gen_tunable(qemu_use_usb, true)
|
|
Dan Walsh |
b4b026 |
|
|
Dan Walsh |
b4b026 |
-type qemu_exec_t;
|
|
Dan Walsh |
b4b026 |
virt_domain_template(qemu)
|
|
Dan Walsh |
b4b026 |
-application_domain(qemu_t, qemu_exec_t)
|
|
Dan Walsh |
b4b026 |
role system_r types qemu_t;
|
|
Dan Walsh |
b4b026 |
|
|
Dan Walsh |
b4b026 |
########################################
|
|
Dan Walsh |
b4b026 |
diff -up serefpolicy-3.10.0/policy/modules/services/virt.if.qemu serefpolicy-3.10.0/policy/modules/services/virt.if
|
|
Dan Walsh |
38087d |
--- serefpolicy-3.10.0/policy/modules/services/virt.if.qemu 2011-10-27 14:01:33.036806448 -0400
|
|
Dan Walsh |
38087d |
+++ serefpolicy-3.10.0/policy/modules/services/virt.if 2011-10-27 14:01:33.084806412 -0400
|
|
Dan Walsh |
b4b026 |
@@ -16,10 +16,11 @@ template(`virt_domain_template',`
|
|
Dan Walsh |
b4b026 |
attribute virt_image_type, virt_domain;
|
|
Dan Walsh |
b4b026 |
attribute virt_tmpfs_type;
|
|
Dan Walsh |
b4b026 |
attribute virt_ptynode;
|
|
Dan Walsh |
b4b026 |
+ type qemu_exec_t;
|
|
Dan Walsh |
b4b026 |
')
|
|
Dan Walsh |
b4b026 |
|
|
Dan Walsh |
b4b026 |
type $1_t, virt_domain;
|
|
Dan Walsh |
b4b026 |
- domain_type($1_t)
|
|
Dan Walsh |
b4b026 |
+ application_domain($1_t, qemu_exec_t)
|
|
Dan Walsh |
b4b026 |
domain_user_exemption_target($1_t)
|
|
Dan Walsh |
b4b026 |
mls_rangetrans_target($1_t)
|
|
Dan Walsh |
b4b026 |
mcs_untrusted_proc($1_t)
|
|
Dan Walsh |
b4b026 |
@@ -848,3 +849,21 @@ template(`virt_lxc_domain_template',`
|
|
Dan Walsh |
b4b026 |
role system_r types $1_t;
|
|
Dan Walsh |
b4b026 |
')
|
|
Dan Walsh |
b4b026 |
|
|
Dan Walsh |
b4b026 |
+########################################
|
|
Dan Walsh |
b4b026 |
+## <summary>
|
|
Dan Walsh |
b4b026 |
+## Execute a qemu_exec_t in the callers domain
|
|
Dan Walsh |
b4b026 |
+## </summary>
|
|
Dan Walsh |
b4b026 |
+## <param name="domain">
|
|
Dan Walsh |
b4b026 |
+## <summary>
|
|
Dan Walsh |
b4b026 |
+## Domain allowed access.
|
|
Dan Walsh |
b4b026 |
+## </summary>
|
|
Dan Walsh |
b4b026 |
+## </param>
|
|
Dan Walsh |
b4b026 |
+#
|
|
Dan Walsh |
b4b026 |
+interface(`virt_exec_qemu',`
|
|
Dan Walsh |
b4b026 |
+ gen_require(`
|
|
Dan Walsh |
b4b026 |
+ type qemu_exec_t;
|
|
Dan Walsh |
b4b026 |
+ ')
|
|
Dan Walsh |
b4b026 |
+
|
|
Dan Walsh |
b4b026 |
+ can_exec($1, qemu_exec_t)
|
|
Dan Walsh |
b4b026 |
+')
|
|
Dan Walsh |
b4b026 |
+
|
|
Dan Walsh |
b4b026 |
diff -up serefpolicy-3.10.0/policy/modules/services/virt.te.qemu serefpolicy-3.10.0/policy/modules/services/virt.te
|
|
Dan Walsh |
38087d |
--- serefpolicy-3.10.0/policy/modules/services/virt.te.qemu 2011-10-27 14:01:33.038806446 -0400
|
|
Dan Walsh |
38087d |
+++ serefpolicy-3.10.0/policy/modules/services/virt.te 2011-10-27 14:02:18.478770938 -0400
|
|
Dan Walsh |
26536c |
@@ -73,11 +73,14 @@ gen_tunable(virt_use_usb, true)
|
|
Dan Walsh |
26536c |
|
|
Dan Walsh |
26536c |
virt_domain_template(svirt)
|
|
Dan Walsh |
26536c |
role system_r types svirt_t;
|
|
Dan Walsh |
26536c |
+typealias svirt_t alias qemu_t;
|
|
Dan Walsh |
26536c |
|
|
Dan Walsh |
26536c |
attribute virt_domain;
|
|
Dan Walsh |
b4b026 |
attribute virt_image_type;
|
|
Dan Walsh |
b4b026 |
attribute virt_tmpfs_type;
|
|
Dan Walsh |
b4b026 |
|
|
Dan Walsh |
b4b026 |
+type qemu_exec_t;
|
|
Dan Walsh |
b4b026 |
+
|
|
Dan Walsh |
b4b026 |
type virt_cache_t alias svirt_cache_t;
|
|
Dan Walsh |
b4b026 |
files_type(virt_cache_t)
|
|
Dan Walsh |
b4b026 |
|
|
Dan Walsh |
26536c |
@@ -279,6 +282,8 @@ allow virtd_t virt_domain:process { geta
|
|
Dan Walsh |
b4b026 |
allow virt_domain virtd_t:fd use;
|
|
Dan Walsh |
b4b026 |
dontaudit virt_domain virtd_t:unix_stream_socket { read write };
|
|
Dan Walsh |
b4b026 |
|
|
Dan Walsh |
b4b026 |
+can_exec(virt_domain, qemu_exec_t)
|
|
Dan Walsh |
b4b026 |
+
|
|
Dan Walsh |
b4b026 |
allow virtd_t qemu_var_run_t:file relabel_file_perms;
|
|
Dan Walsh |
b4b026 |
manage_dirs_pattern(virtd_t, qemu_var_run_t, qemu_var_run_t)
|
|
Dan Walsh |
b4b026 |
manage_files_pattern(virtd_t, qemu_var_run_t, qemu_var_run_t)
|
|
Dan Walsh |
38087d |
@@ -514,11 +519,6 @@ optional_policy(`
|
|
Dan Walsh |
b4b026 |
')
|
|
Dan Walsh |
b4b026 |
|
|
Dan Walsh |
b4b026 |
optional_policy(`
|
|
Dan Walsh |
b4b026 |
- qemu_entry_type(virt_domain)
|
|
Dan Walsh |
b4b026 |
- qemu_exec(virt_domain)
|
|
Dan Walsh |
b4b026 |
-')
|
|
Dan Walsh |
b4b026 |
-
|
|
Dan Walsh |
b4b026 |
-optional_policy(`
|
|
Dan Walsh |
b4b026 |
sanlock_stream_connect(virtd_t)
|
|
Dan Walsh |
b4b026 |
')
|
|
Dan Walsh |
b4b026 |
|