From d8e6ff6a5656b268bf0605fe8259fbf3b242aa9d Mon Sep 17 00:00:00 2001 From: Miroslav Date: Nov 21 2011 13:10:30 +0000 Subject: - Allow mcelog_t to create dir and file in /var/run and label it cor - Allow dbus to manage fusefs - Mount needs to read process state when mounting gluster file syste - Allow collectd-web to read collectd lib files - Allow daemons and system processes started by init to read/write t - Allow colord to get the attributes of tmpfs filesystem - Add sanlock_use_nfs and sanlock_use_samba booleans - Add bin_t label for /usr/lib/virtualbox/VBoxManage --- diff --git a/policy-F16.patch b/policy-F16.patch index cc3ea48..26c8f60 100644 --- a/policy-F16.patch +++ b/policy-F16.patch @@ -1546,7 +1546,7 @@ index 75ce30f..63310a1 100644 + cron_use_system_job_fds(logwatch_mail_t) +') diff --git a/policy/modules/admin/mcelog.fc b/policy/modules/admin/mcelog.fc -index 56c43c0..0641226 100644 +index 56c43c0..409bbfc 100644 --- a/policy/modules/admin/mcelog.fc +++ b/policy/modules/admin/mcelog.fc @@ -1 +1,5 @@ @@ -1554,9 +1554,9 @@ index 56c43c0..0641226 100644 + +/var/log/mcelog.* -- gen_context(system_u:object_r:mcelog_log_t,s0) + -+/var/run/mcelog-client -s gen_context(system_u:object_r:mcelog_var_run_t,s0) ++/var/run/mcelog.* gen_context(system_u:object_r:mcelog_var_run_t,s0) diff --git a/policy/modules/admin/mcelog.te b/policy/modules/admin/mcelog.te -index 5671977..ef8bc09 100644 +index 5671977..034908d 100644 --- a/policy/modules/admin/mcelog.te +++ b/policy/modules/admin/mcelog.te @@ -7,8 +7,14 @@ policy_module(mcelog, 1.1.0) @@ -1586,7 +1586,7 @@ index 5671977..ef8bc09 100644 +manage_files_pattern(mcelog_t, mcelog_var_run_t, mcelog_var_run_t) +manage_dirs_pattern(mcelog_t, mcelog_var_run_t, mcelog_var_run_t) +manage_sock_files_pattern(mcelog_t, mcelog_var_run_t, mcelog_var_run_t) -+files_pid_filetrans(mcelog_t, mcelog_var_run_t, sock_file ) ++files_pid_filetrans(mcelog_t, mcelog_var_run_t, { dir file sock_file } ) + kernel_read_system_state(mcelog_t) @@ -12678,7 +12678,7 @@ index 223ad43..d95e720 100644 rsync_exec(yam_t) ') diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc -index 3fae11a..0b0896b 100644 +index 3fae11a..5808202 100644 --- a/policy/modules/kernel/corecommands.fc +++ b/policy/modules/kernel/corecommands.fc @@ -97,8 +97,6 @@ ifdef(`distro_redhat',` @@ -12904,22 +12904,29 @@ index 3fae11a..0b0896b 100644 /usr/share/apache2/[^/]* -- gen_context(system_u:object_r:bin_t,s0) ') -@@ -375,8 +391,9 @@ ifdef(`distro_suse', ` +@@ -375,8 +391,8 @@ ifdef(`distro_suse', ` /var/ftp/bin(/.*)? gen_context(system_u:object_r:bin_t,s0) /var/lib/asterisk/agi-bin(/.*)? gen_context(system_u:object_r:bin_t,s0) +-/usr/lib/yp/.+ -- gen_context(system_u:object_r:bin_t,s0) +-/usr/lib64/yp/.+ -- gen_context(system_u:object_r:bin_t,s0) +/usr/lib/ruby/gems(/.*)?/helper-scripts(/.*)? gen_context(system_u:object_r:bin_t,s0) + - /usr/lib/yp/.+ -- gen_context(system_u:object_r:bin_t,s0) --/usr/lib64/yp/.+ -- gen_context(system_u:object_r:bin_t,s0) /var/qmail/bin -d gen_context(system_u:object_r:bin_t,s0) /var/qmail/bin(/.*)? gen_context(system_u:object_r:bin_t,s0) -@@ -385,3 +402,4 @@ ifdef(`distro_suse', ` +@@ -385,3 +401,11 @@ ifdef(`distro_suse', ` ifdef(`distro_suse',` /var/lib/samba/bin/.+ gen_context(system_u:object_r:bin_t,s0) ') -+/usr/lib/ruby/gems/.*/agents(/.*)? gen_context(system_u:object_r:bin_t,s0) ++ ++# ++# /usr/lib ++# ++ ++/usr/lib/ruby/gems/.*/agents(/.*)? gen_context(system_u:object_r:bin_t,s0) ++/usr/lib/virtualbox/VBoxManage -- gen_context(system_u:object_r:bin_t,s0) ++/usr/lib/yp/.+ -- gen_context(system_u:object_r:bin_t,s0) diff --git a/policy/modules/kernel/corecommands.if b/policy/modules/kernel/corecommands.if index 9e9263a..650e796 100644 --- a/policy/modules/kernel/corecommands.if @@ -18598,7 +18605,7 @@ index 22821ff..20251b0 100644 ######################################## # diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if -index 97fcdac..e5652a1 100644 +index 97fcdac..50b0acf 100644 --- a/policy/modules/kernel/filesystem.if +++ b/policy/modules/kernel/filesystem.if @@ -631,6 +631,27 @@ interface(`fs_getattr_cgroup',` @@ -18844,7 +18851,33 @@ index 97fcdac..e5652a1 100644 ####################################### ## ## Create, read, write, and delete dirs -@@ -2080,6 +2222,24 @@ interface(`fs_manage_hugetlbfs_dirs',` +@@ -1984,6 +2126,25 @@ interface(`fs_manage_fusefs_files',` + manage_files_pattern($1, fusefs_t, fusefs_t) + ') + ++####################################### ++## ++## Create, read, write, and delete files ++## on a FUSEFS filesystem. ++## ++## ++## ++## Domain allowed access. ++## ++## ++# ++interface(`fs_manage_fusefs_symlinks',` ++ gen_require(` ++ type fusefs_t; ++ ') ++ ++ manage_lnk_files_pattern($1, fusefs_t, fusefs_t) ++') ++ + ######################################## + ## + ## Do not audit attempts to create, +@@ -2080,6 +2241,24 @@ interface(`fs_manage_hugetlbfs_dirs',` ######################################## ## @@ -18869,7 +18902,7 @@ index 97fcdac..e5652a1 100644 ## Read and write hugetlbfs files. ## ## -@@ -2148,6 +2308,7 @@ interface(`fs_list_inotifyfs',` +@@ -2148,6 +2327,7 @@ interface(`fs_list_inotifyfs',` ') allow $1 inotifyfs_t:dir list_dir_perms; @@ -18877,7 +18910,7 @@ index 97fcdac..e5652a1 100644 ') ######################################## -@@ -2480,6 +2641,7 @@ interface(`fs_read_nfs_files',` +@@ -2480,6 +2660,7 @@ interface(`fs_read_nfs_files',` type nfs_t; ') @@ -18885,7 +18918,7 @@ index 97fcdac..e5652a1 100644 allow $1 nfs_t:dir list_dir_perms; read_files_pattern($1, nfs_t, nfs_t) ') -@@ -2518,6 +2680,7 @@ interface(`fs_write_nfs_files',` +@@ -2518,6 +2699,7 @@ interface(`fs_write_nfs_files',` type nfs_t; ') @@ -18893,7 +18926,7 @@ index 97fcdac..e5652a1 100644 allow $1 nfs_t:dir list_dir_perms; write_files_pattern($1, nfs_t, nfs_t) ') -@@ -2544,6 +2707,25 @@ interface(`fs_exec_nfs_files',` +@@ -2544,6 +2726,25 @@ interface(`fs_exec_nfs_files',` ######################################## ## @@ -18919,7 +18952,7 @@ index 97fcdac..e5652a1 100644 ## Append files ## on a NFS filesystem. ## -@@ -2584,6 +2766,42 @@ interface(`fs_dontaudit_append_nfs_files',` +@@ -2584,6 +2785,42 @@ interface(`fs_dontaudit_append_nfs_files',` ######################################## ## @@ -18962,7 +18995,7 @@ index 97fcdac..e5652a1 100644 ## Do not audit attempts to read or ## write files on a NFS filesystem. ## -@@ -2598,7 +2816,7 @@ interface(`fs_dontaudit_rw_nfs_files',` +@@ -2598,7 +2835,7 @@ interface(`fs_dontaudit_rw_nfs_files',` type nfs_t; ') @@ -18971,7 +19004,7 @@ index 97fcdac..e5652a1 100644 ') ######################################## -@@ -2736,7 +2954,7 @@ interface(`fs_search_removable',` +@@ -2736,7 +2973,7 @@ interface(`fs_search_removable',` ## ## ## @@ -18980,7 +19013,7 @@ index 97fcdac..e5652a1 100644 ## ## # -@@ -2772,7 +2990,7 @@ interface(`fs_read_removable_files',` +@@ -2772,7 +3009,7 @@ interface(`fs_read_removable_files',` ## ## ## @@ -18989,7 +19022,7 @@ index 97fcdac..e5652a1 100644 ## ## # -@@ -2965,6 +3183,7 @@ interface(`fs_manage_nfs_dirs',` +@@ -2965,6 +3202,7 @@ interface(`fs_manage_nfs_dirs',` type nfs_t; ') @@ -18997,7 +19030,7 @@ index 97fcdac..e5652a1 100644 allow $1 nfs_t:dir manage_dir_perms; ') -@@ -3005,6 +3224,7 @@ interface(`fs_manage_nfs_files',` +@@ -3005,6 +3243,7 @@ interface(`fs_manage_nfs_files',` type nfs_t; ') @@ -19005,7 +19038,7 @@ index 97fcdac..e5652a1 100644 manage_files_pattern($1, nfs_t, nfs_t) ') -@@ -3045,6 +3265,7 @@ interface(`fs_manage_nfs_symlinks',` +@@ -3045,6 +3284,7 @@ interface(`fs_manage_nfs_symlinks',` type nfs_t; ') @@ -19013,7 +19046,7 @@ index 97fcdac..e5652a1 100644 manage_lnk_files_pattern($1, nfs_t, nfs_t) ') -@@ -3958,6 +4179,42 @@ interface(`fs_dontaudit_list_tmpfs',` +@@ -3958,6 +4198,42 @@ interface(`fs_dontaudit_list_tmpfs',` ######################################## ## @@ -19056,7 +19089,7 @@ index 97fcdac..e5652a1 100644 ## Create, read, write, and delete ## tmpfs directories ## -@@ -4175,6 +4432,24 @@ interface(`fs_dontaudit_use_tmpfs_chr_dev',` +@@ -4175,6 +4451,24 @@ interface(`fs_dontaudit_use_tmpfs_chr_dev',` ######################################## ## @@ -19081,7 +19114,7 @@ index 97fcdac..e5652a1 100644 ## Relabel character nodes on tmpfs filesystems. ## ## -@@ -4251,6 +4526,25 @@ interface(`fs_manage_tmpfs_files',` +@@ -4251,6 +4545,25 @@ interface(`fs_manage_tmpfs_files',` ######################################## ## @@ -19107,7 +19140,7 @@ index 97fcdac..e5652a1 100644 ## Read and write, create and delete symbolic ## links on tmpfs filesystems. ## -@@ -4457,6 +4751,8 @@ interface(`fs_mount_all_fs',` +@@ -4457,6 +4770,8 @@ interface(`fs_mount_all_fs',` ') allow $1 filesystem_type:filesystem mount; @@ -19116,7 +19149,7 @@ index 97fcdac..e5652a1 100644 ') ######################################## -@@ -4503,7 +4799,7 @@ interface(`fs_unmount_all_fs',` +@@ -4503,7 +4818,7 @@ interface(`fs_unmount_all_fs',` ## ##

## Allow the specified domain to @@ -19125,7 +19158,7 @@ index 97fcdac..e5652a1 100644 ## Example attributes: ##

##