Skip to contentSkip to conversation

Many fixes to get xen working - Diff off of strict-targeted-merge-2266

PATCH [email protected] 2 participants 2 messages May 30, 2007 – Jun 21, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw
policy/modules/system/xen.if +45 -0
@@ -72,12 +72,35 @@
 	')
 
 	logging_search_logs($1)
+	allow $1 xend_var_log_t:dir search_dir_perms;
 	allow $1 xend_var_log_t:file { getattr append };
 	dontaudit $1 xend_var_log_t:file write;
 ')
 
 ########################################
 ## <summary>
+##	Allow the specified domain to manage
+##	xend log files.
+## </summary>
+## <param name="domain">
+## 	<summary>
+##	Domain allowed to transition.
+## 	</summary>
+## </param>
+#
+interface(`xen_manage_log',`
+	gen_require(`
+		type var_log_t, xend_var_log_t;
+	')
+
+	logging_search_logs($1)
+	allow $1 xend_var_log_t:dir create_dir_perms;
+	allow $1 xend_var_log_t:file create_file_perms;
+	dontaudit $1 xend_var_log_t:file write;
+')
+
+########################################
+## <summary>
 ##	Do not audit attempts to read and write
 ##	Xen unix domain stream sockets.  These
 ##	are leaked file descriptors.
@@ -151,3 +174,25 @@
 
 	domtrans_pattern($1,xm_exec_t,xm_t)
 ')
+
+########################################
+## <summary>
+##	Allow the specified domain to read
+##	xend image files.
+## </summary>
+## <param name="domain">
+## 	<summary>
+##	Domain allowed to transition.
+## 	</summary>
+## </param>
+#
+interface(`xen_read_image_files',`
+	gen_require(`
+		type xen_image_t, xend_var_lib_t;
+	')
+
+	files_list_var_lib($1)
+	allow $1 xend_var_lib_t:dir search_dir_perms;
+	read_files_pattern($1,xen_image_t,xen_image_t)
+')
+
policy/modules/system/xen.te +40 -2

94 lines not on this page · raw message

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw

Merged.

Quoted 169 lines · On Wed, 2007-05-30 at 08:45 -0400, [email protected] wrote:
policy/modules/system/xen.if +45 -0
@@ -72,12 +72,35 @@
 	')
 
 	logging_search_logs($1)
+	allow $1 xend_var_log_t:dir search_dir_perms;
 	allow $1 xend_var_log_t:file { getattr append };
 	dontaudit $1 xend_var_log_t:file write;
 ')
 
 ########################################
 ## <summary>
+##	Allow the specified domain to manage
+##	xend log files.
+## </summary>
+## <param name="domain">
+## 	<summary>
+##	Domain allowed to transition.
+## 	</summary>
+## </param>
+#
+interface(`xen_manage_log',`
+	gen_require(`
+		type var_log_t, xend_var_log_t;
+	')
+
+	logging_search_logs($1)
+	allow $1 xend_var_log_t:dir create_dir_perms;
+	allow $1 xend_var_log_t:file create_file_perms;
+	dontaudit $1 xend_var_log_t:file write;
+')
+
+########################################
+## <summary>
 ##	Do not audit attempts to read and write
 ##	Xen unix domain stream sockets.  These
 ##	are leaked file descriptors.
@@ -151,3 +174,25 @@
 
 	domtrans_pattern($1,xm_exec_t,xm_t)
 ')
+
+########################################
+## <summary>
+##	Allow the specified domain to read
+##	xend image files.
+## </summary>
+## <param name="domain">
+## 	<summary>
+##	Domain allowed to transition.
+## 	</summary>
+## </param>
+#
+interface(`xen_read_image_files',`
+	gen_require(`
+		type xen_image_t, xend_var_lib_t;
+	')
+
+	files_list_var_lib($1)
+	allow $1 xend_var_lib_t:dir search_dir_perms;
+	read_files_pattern($1,xen_image_t,xen_image_t)
+')
+
policy/modules/system/xen.te +40 -2
@@ -25,6 +25,10 @@
 domain_type(xend_t)
 init_daemon_domain(xend_t, xend_exec_t)
 
+# tmp files
+type xend_tmp_t;
+files_tmp_file(xend_tmp_t)
+
 # var/lib files
 type xend_var_lib_t;
 files_type(xend_var_lib_t)
@@ -88,6 +92,7 @@
 allow xend_t xen_image_t:dir list_dir_perms;
 manage_dirs_pattern(xend_t,xen_image_t,xen_image_t)
 manage_files_pattern(xend_t,xen_image_t,xen_image_t)
+read_lnk_files_pattern(xend_t,xen_image_t,xen_image_t)
 rw_blk_files_pattern(xend_t,xen_image_t,xen_image_t)
 
 allow xend_t xenctl_t:fifo_file manage_file_perms;
@@ -97,7 +102,8 @@
 allow xend_t xend_var_run_t:dir setattr;
 manage_files_pattern(xend_t,xend_var_run_t,xend_var_run_t)
 manage_sock_files_pattern(xend_t,xend_var_run_t,xend_var_run_t)
-files_pid_filetrans(xend_t,xend_var_run_t, { file sock_file })
+manage_fifo_files_pattern(xend_t,xend_var_run_t,xend_var_run_t)
+files_pid_filetrans(xend_t,xend_var_run_t, { file sock_file fifo_file })
 
 # log files
 allow xend_t xend_var_log_t:dir setattr;
@@ -105,6 +111,10 @@
 manage_sock_files_pattern(xend_t,xend_var_log_t,xend_var_log_t)
 logging_log_filetrans(xend_t,xend_var_log_t,{ sock_file file dir })
 
+manage_files_pattern(xend_t,xend_tmp_t,xend_tmp_t)
+manage_dirs_pattern(xend_t,xend_tmp_t,xend_tmp_t)
+files_tmp_filetrans(xend_t, xend_tmp_t, { file dir })
+
 # var/lib files for xend
 manage_dirs_pattern(xend_t,xend_var_lib_t,xend_var_lib_t)
 manage_files_pattern(xend_t,xend_var_lib_t,xend_var_lib_t)
@@ -165,8 +175,13 @@
 files_manage_etc_runtime_files(xend_t)
 files_etc_filetrans_etc_runtime(xend_t,file)
 files_read_usr_files(xend_t)
+files_read_default_symlinks(xend_t)
+
+#tunable_policy(`xen_use_raw_disk',`
+	storage_raw_read_fixed_disk(xend_t)
+	storage_raw_write_fixed_disk(xend_t)
+#')
 
-storage_raw_read_fixed_disk(xend_t)
 storage_raw_read_removable_device(xend_t)
 
 term_getattr_all_user_ptys(xend_t)
@@ -195,6 +210,10 @@
 
 xen_stream_connect_xenstore(xend_t)
 
+lvm_domtrans(xend_t)
+
+mount_domtrans(xend_t)
+
 netutils_domtrans(xend_t)
 
 optional_policy(`
@@ -275,6 +294,12 @@
 
 files_read_usr_files(xenstored_t)
 
+#tunable_policy(`xen_use_raw_disk',`
+	storage_raw_read_fixed_disk(xenstored_t)
+	storage_raw_write_fixed_disk(xenstored_t)
+#')
+storage_raw_read_removable_device(xenstored_t)
+
 term_use_generic_ptys(xenstored_t)
 term_use_console(xenconsoled_t)
 
@@ -308,6 +333,11 @@
 
 allow xm_t xen_image_t:dir rw_dir_perms;
 allow xm_t xen_image_t:file read_file_perms;
+allow xm_t xen_image_t:blk_file r_file_perms;
+
+#tunable_policy(`xen_use_raw_disk',`
+	storage_raw_read_fixed_disk(xm_t)
+#')
 
 kernel_read_system_state(xm_t)
 kernel_read_kernel_sysctls(xm_t)
@@ -343,3 +373,11 @@
 xen_append_log(xm_t)
 xen_stream_connect(xm_t)
 xen_stream_connect_xenstore(xm_t)
+
+#Should have a boolean wrapping these
+fs_list_auto_mountpoints(xend_t)
+files_search_mnt(xend_t)
+fs_write_nfs_files(xend_t)
+fs_read_nfs_files(xend_t)
+fs_getattr_all_fs(xend_t)
+fs_read_dos_files(xend_t)
Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.