jantill 684125
diff -ru serefpolicy-2.2.35-orig/policy/modules/system/xen.fc serefpolicy-2.2.35/policy/modules/system/xen.fc
jantill 684125
--- serefpolicy-2.2.35-orig/policy/modules/system/xen.fc	2006-04-24 20:14:54.000000000 -0400
jantill 684125
+++ serefpolicy-2.2.35/policy/modules/system/xen.fc	2006-04-25 11:01:03.000000000 -0400
jantill 684125
@@ -14,3 +14,4 @@
jantill 684125
 /var/run/xend\.pid	--      gen_context(system_u:object_r:xend_var_run_t,s0)
jantill 684125
 /var/run/xenstore\.pid	--	gen_context(system_u:object_r:xenstored_var_run_t,s0)
jantill 684125
 /var/run/xenstored(/.*)?	gen_context(system_u:object_r:xenstored_var_run_t,s0)
jantill 684125
+/usr/sbin/xm		--	gen_context(system_u:object_r:xm_exec_t,s0)
jantill 684125
--- serefpolicy-2.2.35-orig/policy/modules/system/xen.if	2006-04-25 10:27:36.000000000 -0400
jantill 684125
+++ serefpolicy-2.2.35/policy/modules/system/xen.if	2006-04-25 11:03:07.000000000 -0400
jantill 684125
@@ -83,3 +83,66 @@
jantill 684125
 	allow $1 xenstored_var_run_t:sock_file { getattr write };
jantill 684125
 	allow $1 xenstored_t:unix_stream_socket connectto;
jantill 684125
 ')
jantill 684125
+
jantill 684125
+########################################
jantill 684125
+## <summary>
jantill 684125
+##	Connect to xend over an unix stream socket.
jantill 684125
+## </summary>
jantill 684125
+## <param name="domain">
jantill 684125
+##	<summary>
jantill 684125
+##	Domain allowed access.
jantill 684125
+##	</summary>
jantill 684125
+## </param>
jantill 684125
+#
jantill 684125
+interface(`xen_connect',`
jantill 684125
+	gen_require(`
jantill 684125
+		type xend_t, xend_var_run_t;
jantill 684125
+	')
jantill 684125
+
jantill 684125
+	files_search_pids($1)
jantill 684125
+	allow $1 xend_var_run_t:dir search;
jantill 684125
+	allow $1 xend_var_run_t:sock_file getattr;
jantill 684125
+	allow $1 xend_t:unix_stream_socket connectto;
jantill 684125
+')
jantill 684125
+
jantill 684125
+########################################
jantill 684125
+## <summary>
jantill 684125
+##	Write to xend over an unix stream socket.
jantill 684125
+## </summary>
jantill 684125
+## <param name="domain">
jantill 684125
+##	<summary>
jantill 684125
+##	Domain allowed access.
jantill 684125
+##	</summary>
jantill 684125
+## </param>
jantill 684125
+#
jantill 684125
+interface(`xen_writeto',`
jantill 684125
+	gen_require(`
jantill 684125
+		type xend_var_run_t;
jantill 684125
+	')
jantill 684125
+
jantill 684125
+	allow $1 xend_var_run_t:sock_file write;
jantill 684125
+')
jantill 684125
+
jantill 684125
+
jantill 684125
+########################################
jantill 684125
+## <summary>
jantill 684125
+##	Execute a domain transition to run xm.
jantill 684125
+## </summary>
jantill 684125
+## <param name="domain">
jantill 684125
+## <summary>
jantill 684125
+##	Domain allowed to transition.
jantill 684125
+## </summary>
jantill 684125
+## </param>
jantill 684125
+#
jantill 684125
+interface(`xm_domtrans',`
jantill 684125
+	gen_requires(`
jantill 684125
+		type xm_t, xm_exec_t;
jantill 684125
+	')
jantill 684125
+
jantill 684125
+	domain_auto_trans($1,xm_exec_t,xm_t)
jantill 684125
+
jantill 684125
+	allow $1 xm_t:fd use;
jantill 684125
+	allow xm_t $1:fd use;
jantill 684125
+	allow xm_t:$1:fifo_file rw_file_perms;
jantill 684125
+	allow xm_t $1:process sigchld;
jantill 684125
+')
jantill 684125
Only in serefpolicy-2.2.35/policy/modules/system: xen.if~
jantill 684125
--- serefpolicy-2.2.35-orig/policy/modules/system/xen.te	2006-04-25 10:27:36.000000000 -0400
jantill 684125
+++ serefpolicy-2.2.35/policy/modules/system/xen.te	2006-04-25 11:01:03.000000000 -0400
jantill 684125
@@ -224,3 +224,55 @@
jantill 684125
 miscfiles_read_localization(xenstored_t)
jantill 684125
 
jantill 684125
 xen_append_log(xenstored_t)
jantill 684125
+
jantill 684125
+########################################
jantill 684125
+#
jantill 684125
+# Declarations
jantill 684125
+#
jantill 684125
+
jantill 684125
+type xm_t;
jantill 684125
+type xm_exec_t;
jantill 684125
+domain_type(xm_t)
jantill 684125
+init_daemon_domain(xm_t, xm_exec_t)
jantill 684125
+
jantill 684125
+########################################
jantill 684125
+#
jantill 684125
+# xm local policy
jantill 684125
+#
jantill 684125
+# Check in /etc/selinux/refpolicy/include for macros to use instead of allow rules.
jantill 684125
+
jantill 684125
+# Some common macros (you might be able to remove some)
jantill 684125
+files_read_etc_files(xm_t)
jantill 684125
+libs_use_ld_so(xm_t)
jantill 684125
+libs_use_shared_libs(xm_t)
jantill 684125
+miscfiles_read_localization(xm_t)
jantill 684125
+# internal communication is often done using fifo and unix sockets.
jantill 684125
+allow xm_t self:fifo_file { read write };
jantill 684125
+allow xm_t self:unix_stream_socket create_stream_socket_perms;
jantill 684125
+
jantill 684125
+
jantill 684125
+# james -- aujdit2allow
jantill 684125
+
jantill 684125
+corecmd_exec_bin(xm_t)
jantill 684125
+corecmd_exec_sbin(xm_t)
jantill 684125
+
jantill 684125
+kernel_read_system_state(xm_t)
jantill 684125
+kernel_read_kernel_sysctls(xm_t)
jantill 684125
+kernel_read_xen_state(xm_t)
jantill 684125
+kernel_write_xen_state(xm_t)
jantill 684125
+term_use_all_terms(xm_t)
jantill 684125
+
jantill 684125
+dev_read_urand(xm_t)
jantill 684125
+
jantill 684125
+xen_append_log(xm_t)
jantill 684125
+xen_connect(xm_t)
jantill 684125
+xen_writeto(xm_t)
jantill 684125
+
jantill 684125
+xen_stream_connect_xenstore(xm_t)
jantill 684125
+allow xm_t self:capability dac_override;
jantill 684125
+
jantill 684125
+
jantill 684125
+# allow xm_t root_t:dir search;
jantill 684125
+# Need to relabel files for xen
jantill 684125
+auth_read_all_files_except_shadow(xm_t)
jantill 684125
+