Skip to contentSkip to conversation

mozilla replace local policy by interface calls.

PATCH In review Dominick Grift 2 participants 2 messages Jul 22, 2008 – Jul 25, 2008 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mozilla replace local policy by interface calls.

This patch replaces local policy by interface calls

home/domg472/Workspace/refpolicy_trunk/policy/modules/apps/mozilla.if +3 -2
Index: /home/domg472/Workspace/refpolicy_trunk/policy/modules/apps/mozilla.if
===================================================================
@@ -78,10 +78,9 @@
 	userdom_search_user_home_dirs($1,$1_mozilla_t)
 
 	# Mozpluggerrc
-	allow $1_mozilla_t mozilla_conf_t:file read_file_perms;
+	read_files_pattern($1_mozilla_t, mozilla_conf_t, mozilla_conf_t)
 
 	allow $1_mozilla_t $2:fd use;
-	allow $1_mozilla_t $2:process sigchld;
 	allow $1_mozilla_t $2:unix_stream_socket connectto;
 	allow $2 $1_mozilla_t:fd use;
 	allow $2 $1_mozilla_t:shm { associate getattr };
@@ -190,6 +189,8 @@
 	userdom_manage_user_tmp_dirs($1,$1_mozilla_t)
 	userdom_manage_user_tmp_files($1,$1_mozilla_t)
 	userdom_manage_user_tmp_sockets($1,$1_mozilla_t)
+
+	userdom_sigchld_all_users($1_mozilla_t)
 	
 	xserver_user_x_domain_template($1,$1_mozilla,$1_mozilla_t,

$1_mozilla_tmpfs_t)
xserver_dontaudit_read_xdm_tmp_files($1_mozilla_t)

Signature · 1 line
Dominick Grift <[email protected]>
#1 lore raw
Quoted 1 line · Dominick Grift

This patch replaces local policy by interface calls

These aren't 1:1 replacements (see below).

home/domg472/Workspace/refpolicy_trunk/policy/modules/apps/mozilla.if line 81

Quoted 10 lines

Index: /home/domg472/Workspace/refpolicy_trunk/policy/modules/apps/mozilla.if
===================================================================

home/domg472/Workspace/refpolicy_trunk/policy/modules/apps/mozilla.if +1 -1
@@ -78,10 +78,9 @@
 	userdom_search_user_home_dirs($1,$1_mozilla_t)
 
 	# Mozpluggerrc
-	allow $1_mozilla_t mozilla_conf_t:file read_file_perms;
+	read_files_pattern($1_mozilla_t, mozilla_conf_t, mozilla_conf_t)

Based on the .fc, there aren't any mozilla_conf_t directories. The pattern adds that permission

home/domg472/Workspace/refpolicy_trunk/policy/modules/apps/mozilla.if line 193

Quoted 11 lines
home/domg472/Workspace/refpolicy_trunk/policy/modules/apps/mozilla.if +2 -1
 	allow $1_mozilla_t $2:fd use;
-	allow $1_mozilla_t $2:process sigchld;
 	allow $1_mozilla_t $2:unix_stream_socket connectto;
 	allow $2 $1_mozilla_t:fd use;
 	allow $2 $1_mozilla_t:shm { associate getattr };
@@ -190,6 +189,8 @@
 	userdom_manage_user_tmp_dirs($1,$1_mozilla_t)
 	userdom_manage_user_tmp_files($1,$1_mozilla_t)
 	userdom_manage_user_tmp_sockets($1,$1_mozilla_t)
+
+	userdom_sigchld_all_users($1_mozilla_t)

The raw rule only allows the mozilla to sigchld the user domain that transitions to the mozilla instance, e.g., user_mozilla_t sigchld'ing user_t. The above rule allows user_mozilla_t to sigchld all user domains, which we don't want.

Quoted 3 lines
home/domg472/Workspace/refpolicy_trunk/policy/modules/apps/mozilla.if +0 -0
 	xserver_user_x_domain_template($1,$1_mozilla,$1_mozilla_t,
 $1_mozilla_tmpfs_t)
 	xserver_dontaudit_read_xdm_tmp_files($1_mozilla_t)
Signature · 7 lines
Chris PeBenito
<[email protected]>
Developer,
Hardened Gentoo Linux
 
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
Key fingerprint = B0E6 877A 883F A57A 8E6A  CB00 BC8E E42D E6AF 9243