Skip to contentSkip to conversation

Update for the gnome policy and file contexts

PATCH New Guido Trentalancia 5 participants 73 messages Aug 13, 2016 – Sep 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99 +++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)
policy/modules/contrib/gnome.fc +6 -1
@@ -4,6 +4,7 @@ HOME_DIR/\.gnome(/.*)?	gen_context(syste
 HOME_DIR/\.gnome2(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2/keyrings(/.*)?	gen_context(system_u:object_r:gnome_keyring_home_t,s0)
 HOME_DIR/\.gnome2_private(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
+HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 
 /etc/gconf(/.*)?	gen_context(system_u:object_r:gconf_etc_t,s0)
 
@@ -13,4 +14,8 @@ HOME_DIR/\.gnome2_private(/.*)?	gen_cont
 /usr/bin/mate-keyring-daemon	--	gen_context(system_u:object_r:gkeyringd_exec_t,s0)
 
 /usr/lib/[^/]*/gconf/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
-/usr/libexec/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/usr/libexec/gconfd-2		--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/var/run/user/[^/]*/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
+/var/run/user/%{USERID}/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
policy/modules/contrib/gnome.if +98 -1

123 lines not on this page · raw message

policy/modules/contrib/gnome.te +8 -0
@@ -46,6 +46,9 @@ userdom_user_home_content(gnome_keyring_
 type gnome_keyring_tmp_t;
 userdom_user_tmp_file(gnome_keyring_tmp_t)
 
+type gstreamer_orcexec_t;
+application_executable_file(gstreamer_orcexec_t)
+
 ##############################
 #
 # Common local Policy
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
 
 optional_policy(`
#1 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Quoted 29 lines · Guido Trentalancia

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99 +++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)
policy/modules/contrib/gnome.fc +1 -0
@@ -4,6 +4,7 @@ HOME_DIR/\.gnome(/.*)?	gen_context(syste
 HOME_DIR/\.gnome2(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2/keyrings(/.*)?	gen_context(system_u:object_r:gnome_keyring_home_t,s0)
 HOME_DIR/\.gnome2_private(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
+HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 
 /etc/gconf(/.*)?	gen_context(system_u:object_r:gconf_etc_t,s0)
 

policy/modules/contrib/gnome.fc HOME_DIR/\.gnome2_private(/.*)? gen_cont · line 21

Quoted 9 lines
policy/modules/contrib/gnome.fc +5 -1
@@ -13,4 +14,8 @@ HOME_DIR/\.gnome2_private(/.*)?	gen_cont
 /usr/bin/mate-keyring-daemon	--	gen_context(system_u:object_r:gkeyringd_exec_t,s0)
 
 /usr/lib/[^/]*/gconf/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
-/usr/libexec/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/usr/libexec/gconfd-2		--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/var/run/user/[^/]*/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
+/var/run/user/%{USERID}/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)

these are files so you can be more specific about it:

/var/run/user/[^/]*/orcexec\..* -- gen_context(system_u:object_r:gstreamer_orcexec_t,s0) /var/run/user/%{USERID}/orcexec\..* -- gen_context(system_u:object_r:gstreamer_orcexec_t,s0)

Quoted 9 lines
policy/modules/contrib/gnome.if +1 -1
@@ -1,4 +1,4 @@
-## <summary>GNU network object model environment.</summary>
+
 
 ########################################
 ## <summary>

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 106

Quoted 7 lines
policy/modules/contrib/gnome.if +4 -0
@@ -100,9 +100,15 @@ template(`gnome_role_template',`
 
 	allow $3 gnome_keyring_tmp_t:sock_file { relabel_sock_file_perms manage_sock_file_perms };
 
+	userdom_manage_user_home_content_dirs($1_gkeyringd_t)
+	userdom_manage_user_home_content_files($1_gkeyringd_t)
+	userdom_manage_user_home_content_sockets($1_gkeyringd_t)
+

I don't like this, and I dont understand it

Quoted 99 lines
policy/modules/contrib/gnome.if +82 -0
 	ps_process_pattern($3, $1_gkeyringd_t)
 	allow $3 $1_gkeyringd_t:process { ptrace signal_perms };
 
+	kernel_read_kernel_sysctls($1_gkeyringd_t)
+
 	corecmd_bin_domtrans($1_gkeyringd_t, $3)
 	corecmd_shell_domtrans($1_gkeyringd_t, $3)
 
@@ -569,6 +575,36 @@ interface(`gnome_home_filetrans_gnome_ho
 
 ########################################
 ## <summary>
+##	Create objects in user home
+##	directories with the gstreamer
+##	orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_home_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	userdom_user_home_dir_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+
+########################################
+## <summary>
 ##	Create objects in gnome gconf home
 ##	directories with a private type.
 ## </summary>
@@ -603,6 +639,67 @@ interface(`gnome_gconf_home_filetrans',`
 ')
 
 ########################################
+## <summary>
+##	Create objects in the user
+##	runtime directories with the
+##	gstreamer orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_user_runtime_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	userdom_user_runtime_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+
+
+########################################
+## <summary>
+##	Create objects in the tmp
+##	directories with the gstreamer
+##	orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>

policy/modules/contrib/gnome.if interface(`gnome_gconf_home_filetrans',` · line 701

Quoted 10 lines
policy/modules/contrib/gnome.if +10 -0
+## </param>
+#
+interface(`gnome_tmp_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	files_tmp_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+

If you're not going to support that file in /tmp then this is not needed

policy/modules/contrib/gnome.te userdom_user_home_content(gnome_keyring_ · line 50

Quoted 12 lines
policy/modules/contrib/gnome.if +1 -0
+########################################
 ## <summary>
 ##	Read generic gnome keyring home files.
 ## </summary>
policy/modules/contrib/gnome.te +2 -0
@@ -46,6 +46,9 @@ userdom_user_home_content(gnome_keyring_
 type gnome_keyring_tmp_t;
 userdom_user_tmp_file(gnome_keyring_tmp_t)
 
+type gstreamer_orcexec_t;
+application_executable_file(gstreamer_orcexec_t)

it is not an applications executable file

Quoted 5 lines
policy/modules/contrib/gnome.te +1 -0
+
 ##############################
 #
 # Common local Policy

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 99

Quoted 10 lines
policy/modules/contrib/gnome.te +5 -0
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

Quoted 8 lines
policy/modules/contrib/gnome.te +0 -0
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
 
 optional_policy(`

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160813/d4f48b93/attachment.bin 
#2 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Hello Dominick,

thanks for getting back on this.

Quoted 55 lines

On the 13th of August 2016 at 16.51 Dominick Grift <[email protected]> wrote:

Quoted 44 lines · Guido Trentalancia

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.fc 2016-08-13
16:02:14.949814288 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.fc 2016-08-13
16:30:32.175198600 +0200

(quoted diff) +1 -0
@@ -4,6 +4,7 @@ HOME_DIR/\.gnome(/.*)?	gen_context(syste
 HOME_DIR/\.gnome2(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2/keyrings(/.*)?
 gen_context(system_u:object_r:gnome_keyring_home_t,s0)
 HOME_DIR/\.gnome2_private(/.*)?
 gen_context(system_u:object_r:gnome_home_t,s0)
+HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 

/etc/gconf(/.*)? gen_context(system_u:object_r:gconf_etc_t,s0)

(quoted diff) +0 -0
@@ -13,4 +14,8 @@ HOME_DIR/\.gnome2_private(/.*)?	gen_cont
 /usr/bin/mate-keyring-daemon	--
 gen_context(system_u:object_r:gkeyringd_exec_t,s0)
 
 /usr/lib/[^/]*/gconf/gconfd-2	--

gen_context(system_u:object_r:gconfd_exec_t,s0)

policy/modules/contrib/gnome.fc +4 -1
-/usr/libexec/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/usr/libexec/gconfd-2		--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/var/run/user/[^/]*/orcexec\..*
Quoted 3 lines

gen_context(system_u:object_r:gstreamer_orcexec_t,s0) +/var/run/user/%{USERID}/orcexec\..* gen_context(system_u:object_r:gstreamer_orcexec_t,s0)

these are files so you can be more specific about it:

Quoted 4 lines

/var/run/user/[^/]*/orcexec\..* -- gen_context(system_u:object_r:gstreamer_orcexec_t,s0) /var/run/user/%{USERID}/orcexec\..* -- gen_context(system_u:object_r:gstreamer_orcexec_t,s0)

Thanks for pointing it out, I have now amended it.

Quoted 15 lines
Quoted 15 lines

--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.if 2016-08-13
16:02:14.950814302 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.if 2016-08-13
00:55:24.980149003 +0200

policy/modules/contrib/gnome.if +1 -1
@@ -1,4 +1,4 @@
-## <summary>GNU network object model environment.</summary>
+
 
 ########################################
 ## <summary>
@@ -100,9 +100,15 @@ template(`gnome_role_template',`
 
 	allow $3 gnome_keyring_tmp_t:sock_file { relabel_sock_file_perms
 manage_sock_file_perms };
 
Quoted 6 lines

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 106

Quoted 4 lines
policy/modules/contrib/gnome.if +4 -0
+	userdom_manage_user_home_content_dirs($1_gkeyringd_t)
+	userdom_manage_user_home_content_files($1_gkeyringd_t)
+	userdom_manage_user_home_content_sockets($1_gkeyringd_t)
+

I don't like this, and I dont understand it

I will double check it. Hopefully, I won't forget about that, with the many other modules that are being changed...

Quoted 103 lines
Quoted 103 lines
policy/modules/contrib/gnome.if +86 -0
 	ps_process_pattern($3, $1_gkeyringd_t)
 	allow $3 $1_gkeyringd_t:process { ptrace signal_perms };
 
+	kernel_read_kernel_sysctls($1_gkeyringd_t)
+
 	corecmd_bin_domtrans($1_gkeyringd_t, $3)
 	corecmd_shell_domtrans($1_gkeyringd_t, $3)
@@ -569,6 +575,36 @@ interface(`gnome_home_filetrans_gnome_ho
 
 ########################################
 ## <summary>
+##	Create objects in user home
+##	directories with the gstreamer
+##	orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_home_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	userdom_user_home_dir_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+
+########################################
+## <summary>
 ##	Create objects in gnome gconf home
 ##	directories with a private type.
 ## </summary>
@@ -603,6 +639,67 @@ interface(`gnome_gconf_home_filetrans',`
 ')
 
 ########################################
+## <summary>
+##	Create objects in the user
+##	runtime directories with the
+##	gstreamer orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_user_runtime_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	userdom_user_runtime_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+
+
+########################################
+## <summary>
+##	Create objects in the tmp
+##	directories with the gstreamer
+##	orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_tmp_filetrans_gstreamer_orcexec',`
+	gen_require(`
Quoted 8 lines

policy/modules/contrib/gnome.if interface(`gnome_gconf_home_filetrans',` · line 701

Quoted 6 lines
policy/modules/contrib/gnome.if +6 -0
+		type gstreamer_orcexec_t;
+	')
+
+	files_tmp_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+

If you're not going to support that file in /tmp then this is not needed

Removed.

Quoted 12 lines
Quoted 12 lines
policy/modules/contrib/gnome.if +1 -1
+########################################
 ## <summary>
 ##	Read generic gnome keyring home files.
 ## </summary>
--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.te	2016-08-13

16:02:14.951814316 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.te 2016-08-13
13:45:54.704254788 +0200

policy/modules/contrib/gnome.te +0 -0
@@ -46,6 +46,9 @@ userdom_user_home_content(gnome_keyring_
 type gnome_keyring_tmp_t;
 userdom_user_tmp_file(gnome_keyring_tmp_t)
 
Quoted 4 lines

policy/modules/contrib/gnome.te userdom_user_home_content(gnome_keyring_ · line 50

Quoted 2 lines
policy/modules/contrib/gnome.te +2 -0
+type gstreamer_orcexec_t;
+application_executable_file(gstreamer_orcexec_t)

it is not an applications executable file

It's very similar to it or, in other words, it is equivalent to it. I could find a better interface to describe it.

But if you have other constructive ideas, please let me know and I will test them out...

Quoted 8 lines
Quoted 8 lines
policy/modules/contrib/gnome.te +1 -0
+
 ##############################
 #
 # Common local Policy
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
Quoted 9 lines

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 99

Quoted 7 lines
policy/modules/contrib/gnome.te +5 -0
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

I think it's to support sockets in /tmp/orbit-USER/linc-.*

They are created by ORBit2. It's a library and some gnome components are linked against it.

I am now working on a new revised version of this patch which introduces specific support for ORBit temporary files.

Quoted 4 lines
Quoted 4 lines
policy/modules/contrib/gnome.te +0 -0
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
 
 optional_policy(`

_______________________________________________

Best regards,

Guido

#3 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Quoted 222 lines · Guido Trentalancia

Hello Dominick,

thanks for getting back on this.

Quoted 55 lines

On the 13th of August 2016 at 16.51 Dominick Grift <[email protected]> wrote:

Quoted 44 lines · Guido Trentalancia

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.fc 2016-08-13
16:02:14.949814288 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.fc 2016-08-13
16:30:32.175198600 +0200

(quoted diff) +1 -0
@@ -4,6 +4,7 @@ HOME_DIR/\.gnome(/.*)?	gen_context(syste
 HOME_DIR/\.gnome2(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2/keyrings(/.*)?
 gen_context(system_u:object_r:gnome_keyring_home_t,s0)
 HOME_DIR/\.gnome2_private(/.*)?
 gen_context(system_u:object_r:gnome_home_t,s0)
+HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 

/etc/gconf(/.*)? gen_context(system_u:object_r:gconf_etc_t,s0)

(quoted diff) +0 -0
@@ -13,4 +14,8 @@ HOME_DIR/\.gnome2_private(/.*)?	gen_cont
 /usr/bin/mate-keyring-daemon	--
 gen_context(system_u:object_r:gkeyringd_exec_t,s0)
 
 /usr/lib/[^/]*/gconf/gconfd-2	--

gen_context(system_u:object_r:gconfd_exec_t,s0)

policy/modules/contrib/gnome.fc +4 -1
-/usr/libexec/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/usr/libexec/gconfd-2		--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/var/run/user/[^/]*/orcexec\..*
Quoted 3 lines

gen_context(system_u:object_r:gstreamer_orcexec_t,s0) +/var/run/user/%{USERID}/orcexec\..* gen_context(system_u:object_r:gstreamer_orcexec_t,s0)

these are files so you can be more specific about it:

Quoted 4 lines

/var/run/user/[^/]*/orcexec\..* -- gen_context(system_u:object_r:gstreamer_orcexec_t,s0) /var/run/user/%{USERID}/orcexec\..* -- gen_context(system_u:object_r:gstreamer_orcexec_t,s0)

Thanks for pointing it out, I have now amended it.

Quoted 15 lines
Quoted 15 lines

--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.if 2016-08-13
16:02:14.950814302 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.if 2016-08-13
00:55:24.980149003 +0200

policy/modules/contrib/gnome.if +1 -1
@@ -1,4 +1,4 @@
-## <summary>GNU network object model environment.</summary>
+
 
 ########################################
 ## <summary>
@@ -100,9 +100,15 @@ template(`gnome_role_template',`
 
 	allow $3 gnome_keyring_tmp_t:sock_file { relabel_sock_file_perms
 manage_sock_file_perms };
 
Quoted 6 lines

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 106

Quoted 4 lines
policy/modules/contrib/gnome.if +4 -0
+	userdom_manage_user_home_content_dirs($1_gkeyringd_t)
+	userdom_manage_user_home_content_files($1_gkeyringd_t)
+	userdom_manage_user_home_content_sockets($1_gkeyringd_t)
+

I don't like this, and I dont understand it

I will double check it. Hopefully, I won't forget about that, with the many other modules that are being changed...

Quoted 103 lines
Quoted 103 lines
policy/modules/contrib/gnome.if +86 -0
 	ps_process_pattern($3, $1_gkeyringd_t)
 	allow $3 $1_gkeyringd_t:process { ptrace signal_perms };
 
+	kernel_read_kernel_sysctls($1_gkeyringd_t)
+
 	corecmd_bin_domtrans($1_gkeyringd_t, $3)
 	corecmd_shell_domtrans($1_gkeyringd_t, $3)
@@ -569,6 +575,36 @@ interface(`gnome_home_filetrans_gnome_ho
 
 ########################################
 ## <summary>
+##	Create objects in user home
+##	directories with the gstreamer
+##	orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_home_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	userdom_user_home_dir_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+
+########################################
+## <summary>
 ##	Create objects in gnome gconf home
 ##	directories with a private type.
 ## </summary>
@@ -603,6 +639,67 @@ interface(`gnome_gconf_home_filetrans',`
 ')
 
 ########################################
+## <summary>
+##	Create objects in the user
+##	runtime directories with the
+##	gstreamer orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_user_runtime_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	userdom_user_runtime_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+
+
+########################################
+## <summary>
+##	Create objects in the tmp
+##	directories with the gstreamer
+##	orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_tmp_filetrans_gstreamer_orcexec',`
+	gen_require(`
Quoted 8 lines

policy/modules/contrib/gnome.if interface(`gnome_gconf_home_filetrans',` · line 701

Quoted 6 lines
policy/modules/contrib/gnome.if +6 -0
+		type gstreamer_orcexec_t;
+	')
+
+	files_tmp_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+

If you're not going to support that file in /tmp then this is not needed

Removed.

Quoted 12 lines
Quoted 12 lines
policy/modules/contrib/gnome.if +1 -1
+########################################
 ## <summary>
 ##	Read generic gnome keyring home files.
 ## </summary>
--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.te	2016-08-13

16:02:14.951814316 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.te 2016-08-13
13:45:54.704254788 +0200

policy/modules/contrib/gnome.te +0 -0
@@ -46,6 +46,9 @@ userdom_user_home_content(gnome_keyring_
 type gnome_keyring_tmp_t;
 userdom_user_tmp_file(gnome_keyring_tmp_t)
 
Quoted 4 lines

policy/modules/contrib/gnome.te userdom_user_home_content(gnome_keyring_ · line 50

Quoted 2 lines
policy/modules/contrib/gnome.te +2 -0
+type gstreamer_orcexec_t;
+application_executable_file(gstreamer_orcexec_t)

it is not an applications executable file

Quoted 5 lines

It's very similar to it or, in other words, it is equivalent to it. I could find a better interface to describe it.

But if you have other constructive ideas, please let me know and I will test them out...

It is nothing like an "application executable file". This is a file that gets mmap'd it does not get "executed", its certainly not an application, and only liborc clients mmap this file. In my policy this is just a user temporary file, or alternatively user home content file (i only support this file in $XDG_RUNTIME_DIR and not in ~, so in my policy i can just get away with classifying it user tmp(fs) file)

Quoted 19 lines
Quoted 9 lines
Quoted 9 lines
policy/modules/contrib/gnome.te +1 -0
+
 ##############################
 #
 # Common local Policy
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
Quoted 9 lines

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 99

Quoted 7 lines
policy/modules/contrib/gnome.te +5 -0
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

Quoted 8 lines

I think it's to support sockets in /tmp/orbit-USER/linc-.*

They are created by ORBit2. It's a library and some gnome components are linked against it.

I am now working on a new revised version of this patch which introduces specific support for ORBit temporary files.

I see. for Mate i suppose.

Quoted 9 lines
Quoted 4 lines
Quoted 4 lines
policy/modules/contrib/gnome.te +0 -0
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
 
 optional_policy(`

_______________________________________________

Best regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160813/279d0f2c/attachment.bin 
#4 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

In reply to Guido Trentalancia

Hello Dominick.

I have done some further testing and there are some problems...

Please read on...

Quoted 1 line · Guido Trentalancia
Quoted 1 line · Guido Trentalancia

[....]

Quoted 20 lines
Quoted 9 lines
Quoted 9 lines

+
?##############################
?#
?# Common local Policy

(quoted diff) +0 -0
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 ?manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 ?userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })

?
+kernel_dontaudit_read_system_state(gconfd_t)

Quoted 8 lines
Quoted 6 lines
policy/modules/contrib/gnome.te +3 -0
+
+fs_getattr_xattr_fs(gconfd_t)
+

?userdom_manage_user_tmp_dirs(gconfd_t)
?userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

I think it's to support sockets in /tmp/orbit-USER/linc-.*

Quoted 7 lines

They are created by ORBit2. It's a library and some gnome components are linked
against it.

I am now working on a new revised version of this patch which introduces
specific support for ORBit temporary files.

I have tested the above but met the following problem: the /tmp/orbit- USER directory is shared with other applications that run in the generic user domain !

So, if I change the type of the /tmp/orbit-USER directory to a newly created gnome_orbit_tmp_t type, then the other applications cannot access it...

So, perhaps, the previous implementation which leads to userdom_manage_user_tmp_sockets(gconfd_t)?is the only way.

What do you say ?

Regards,

Guido

#5 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Quoted 35 lines · Guido Trentalancia

Hello Dominick.

I have done some further testing and there are some problems...

Please read on...

Quoted 1 line · Guido Trentalancia
Quoted 1 line · Guido Trentalancia

[....]

Quoted 24 lines
Quoted 8 lines
Quoted 8 lines
policy/modules/contrib/gnome.te +1 -0
+
 ##############################
 #
 # Common local Policy
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
Quoted 9 lines

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 99

Quoted 7 lines
policy/modules/contrib/gnome.te +5 -0
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

I think it's to support sockets in /tmp/orbit-USER/linc-.*

They are created by ORBit2. It's a library and some gnome components are linked
against it.

Quoted 7 lines
Quoted 3 lines

I am now working on a new revised version of this patch which introduces
specific support for ORBit temporary files.

I have tested the above but met the following problem: the /tmp/orbit- USER directory is shared with other applications that run in the generic user domain !

Yes

Quoted 4 lines

So, if I change the type of the /tmp/orbit-USER directory to a newly created gnome_orbit_tmp_t type, then the other applications cannot access it...

You don't have to change the type of the /tmp/orbit-USER directory

Instead just make gconfd_t create sockets in user_tmp_t dirs with an automatic type transition to the existing gconfd_tmp_t type:

manage_sock_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t) userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, sock_file)

Quoted 3 lines

So, perhaps, the previous implementation which leads to userdom_manage_user_tmp_sockets(gconfd_t) is the only way.

I doubt that

Quoted 10 lines

What do you say ?

Regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160814/582be4ce/attachment.bin 
#6 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

In reply to Dominick Grift

Hello Dominick !

Finally I am able to clarify one of the two open questions about the gnome module...

Quoted 23 lines

On the 13th of August 2016 at 16.51 Dominick Grift <[email protected]> wrote:

Quoted 18 lines · Guido Trentalancia

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

[...]

Quoted 15 lines
Quoted 15 lines

--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.if 2016-08-13
16:02:14.950814302 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.if 2016-08-13
00:55:24.980149003 +0200

policy/modules/contrib/gnome.if +1 -1
@@ -1,4 +1,4 @@
-## <summary>GNU network object model environment.</summary>
+
 
 ########################################
 ## <summary>
@@ -100,9 +100,15 @@ template(`gnome_role_template',`
 
 	allow $3 gnome_keyring_tmp_t:sock_file { relabel_sock_file_perms
 manage_sock_file_perms };
 
Quoted 6 lines

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 106

Quoted 4 lines
policy/modules/contrib/gnome.if +4 -0
+	userdom_manage_user_home_content_dirs($1_gkeyringd_t)
+	userdom_manage_user_home_content_files($1_gkeyringd_t)
+	userdom_manage_user_home_content_sockets($1_gkeyringd_t)
+

I don't like this, and I dont understand it

It's needed to write .xsession-errors and the .cache subdirectory in the user home.

It is quite important, as the latter is used, amongst other things, to store user credentials: for example, when the user enters the password in the evolution mail client to retrieve his/her mail, then the password entered is stored in the cache and the user does not need to enter the password again when the mail is received again periodically later.

I hope this clarifies the matter.

I am checking the other issue (socket creation in /tmp) by testing the policy you suggested but unfortunately, I can anticipate that there are issues. Will let you know more precisely when I have finished testing it.

Regards,

Guido

#7 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Quoted 53 lines · Guido Trentalancia

Hello Dominick !

Finally I am able to clarify one of the two open questions about the gnome module...

Quoted 23 lines

On the 13th of August 2016 at 16.51 Dominick Grift <[email protected]> wrote:

Quoted 18 lines · Guido Trentalancia

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

[...]

Quoted 15 lines
Quoted 15 lines

--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.if 2016-08-13
16:02:14.950814302 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.if 2016-08-13
00:55:24.980149003 +0200

policy/modules/contrib/gnome.if +1 -1
@@ -1,4 +1,4 @@
-## <summary>GNU network object model environment.</summary>
+
 
 ########################################
 ## <summary>
@@ -100,9 +100,15 @@ template(`gnome_role_template',`
 
 	allow $3 gnome_keyring_tmp_t:sock_file { relabel_sock_file_perms
 manage_sock_file_perms };
 
Quoted 6 lines

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 106

Quoted 4 lines
policy/modules/contrib/gnome.if +4 -0
+	userdom_manage_user_home_content_dirs($1_gkeyringd_t)
+	userdom_manage_user_home_content_files($1_gkeyringd_t)
+	userdom_manage_user_home_content_sockets($1_gkeyringd_t)
+

I don't like this, and I dont understand it

Quoted 9 lines

It's needed to write .xsession-errors and the .cache subdirectory in the user home.

It is quite important, as the latter is used, amongst other things, to store user credentials: for example, when the user enters the password in the evolution mail client to retrieve his/her mail, then the password entered is stored in the cache and the user does not need to enter the password again when the mail is received again periodically later.

And the .xsessions_errors file is not mislabeled? (e.g. is that supposed to be user_home_t?)

As for ~/.cache issue. Probably best to hold on to that for now as chances are that refpolicy will soon associate a different type with that directory. Thus that scenario might change again soon.

You did not clarify the userdom_manage_user_home_content_sockets($1_gkeyringd_t)

But i am pretty sure that this socket should not be user_home_t.

Quoted 10 lines

I hope this clarifies the matter.

I am checking the other issue (socket creation in /tmp) by testing the policy you suggested but unfortunately, I can anticipate that there are issues. Will let you know more precisely when I have finished testing it.

Regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160814/6cf053ca/attachment.bin 
#8 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Hello Dominick.

Quoted 69 lines · Guido Trentalancia
Quoted 57 lines

Hello Dominick !

Finally I am able to clarify one of the two open questions about the gnome module...

Quoted 23 lines

On the 13th of August 2016 at 16.51 Dominick Grift <[email protected]> wrote:

Quoted 18 lines · Guido Trentalancia

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

[...]

Quoted 15 lines
Quoted 15 lines

--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.if 2016-08-13
16:02:14.950814302 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.if 2016-08-13
00:55:24.980149003 +0200

policy/modules/contrib/gnome.if +1 -1
@@ -1,4 +1,4 @@
-## <summary>GNU network object model environment.</summary>
+
 
 ########################################
 ## <summary>
@@ -100,9 +100,15 @@ template(`gnome_role_template',`
 
 	allow $3 gnome_keyring_tmp_t:sock_file { relabel_sock_file_perms
 manage_sock_file_perms };
 
Quoted 6 lines

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 106

Quoted 4 lines
policy/modules/contrib/gnome.if +4 -0
+	userdom_manage_user_home_content_dirs($1_gkeyringd_t)
+	userdom_manage_user_home_content_files($1_gkeyringd_t)
+	userdom_manage_user_home_content_sockets($1_gkeyringd_t)
+

I don't like this, and I dont understand it

It's needed to write .xsession-errors and the .cache subdirectory in the user
home.

Quoted 7 lines

It is quite important, as the latter is used, amongst other things, to store user credentials: for example, when the user enters the password in the evolution mail client to retrieve his/her mail, then the password entered is stored in the cache and the user does not need to enter the password again when
the mail is received again periodically later.

And the .xsessions_errors file is not mislabeled? (e.g. is that supposed to be user_home_t?)

Quoted 8 lines

As for ~/.cache issue. Probably best to hold on to that for now as chances are that refpolicy will soon associate a different type with that directory. Thus that scenario might change again soon.

You did not clarify the userdom_manage_user_home_content_sockets($1_gkeyringd_t)

But i am pretty sure that this socket should not be user_home_t.

Might be sensitive sockets, they are named "control", "pkcs11", "ssh", "gpg" and are located in .cache/keyring-*/

They are currently labeled user_home_t.

What do you suggest to do ?

Quoted 7 lines
Quoted 7 lines

I hope this clarifies the matter.

I am checking the other issue (socket creation in /tmp) by testing the policy
you suggested but unfortunately, I can anticipate that there are issues. Will
let you know more precisely when I have finished testing it.

Best regards,

Guido

#9 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Quoted 78 lines · Guido Trentalancia

Hello Dominick.

Quoted 76 lines · Guido Trentalancia
Quoted 57 lines

Hello Dominick !

Finally I am able to clarify one of the two open questions about the gnome module...

Quoted 23 lines

On the 13th of August 2016 at 16.51 Dominick Grift <[email protected]> wrote:

Quoted 18 lines · Guido Trentalancia

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

[...]

Quoted 15 lines
Quoted 15 lines

--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.if 2016-08-13
16:02:14.950814302 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/gnome.if 2016-08-13
00:55:24.980149003 +0200

policy/modules/contrib/gnome.if +1 -1
@@ -1,4 +1,4 @@
-## <summary>GNU network object model environment.</summary>
+
 
 ########################################
 ## <summary>
@@ -100,9 +100,15 @@ template(`gnome_role_template',`
 
 	allow $3 gnome_keyring_tmp_t:sock_file { relabel_sock_file_perms
 manage_sock_file_perms };
 
Quoted 6 lines

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 106

Quoted 4 lines
policy/modules/contrib/gnome.if +4 -0
+	userdom_manage_user_home_content_dirs($1_gkeyringd_t)
+	userdom_manage_user_home_content_files($1_gkeyringd_t)
+	userdom_manage_user_home_content_sockets($1_gkeyringd_t)
+

I don't like this, and I dont understand it

It's needed to write .xsession-errors and the .cache subdirectory in the user
home.

Quoted 7 lines

It is quite important, as the latter is used, amongst other things, to store user credentials: for example, when the user enters the password in the evolution mail client to retrieve his/her mail, then the password entered is stored in the cache and the user does not need to enter the password again when
the mail is received again periodically later.

And the .xsessions_errors file is not mislabeled? (e.g. is that supposed to be user_home_t?)

As for ~/.cache issue. Probably best to hold on to that for now as chances are that refpolicy will soon associate a different type with that directory. Thus that scenario might change again soon.

You did not clarify the userdom_manage_user_home_content_sockets($1_gkeyringd_t)

Quoted 9 lines
Quoted 1 line

But i am pretty sure that this socket should not be user_home_t.

Might be sensitive sockets, they are named "control", "pkcs11", "ssh", "gpg" and are located in .cache/keyring-*/

They are currently labeled user_home_t.

What do you suggest to do ?

I would hold off on this until the XDG spec types are implemented (~/.cache) then create a private gkeyring_cache_home_t type for ~/.cache/keyring

Quoted 12 lines
Quoted 7 lines
Quoted 7 lines

I hope this clarifies the matter.

I am checking the other issue (socket creation in /tmp) by testing the policy
you suggested but unfortunately, I can anticipate that there are issues. Will
let you know more precisely when I have finished testing it.

Best regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160814/b2191f47/attachment-0001.bin 
#10 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

In reply to Dominick Grift

Hello Dominick !

Quoted 19 lines · Guido Trentalancia
Quoted 18 lines

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

[...]

Quoted 8 lines
Quoted 8 lines
policy/modules/contrib/gnome.te +1 -0
+
 ##############################
 #
 # Common local Policy
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
Quoted 9 lines

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 99

Quoted 7 lines
policy/modules/contrib/gnome.te +5 -0
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

Other applications (such as firefox) need to write those sockets, therefore the policy you suggested in a previous message is not feasible.

In other words those sockets should be created as user_tmp_t and not as a private gconf_tmp_t.

Quoted 3 lines

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 102

Quoted 3 lines
policy/modules/contrib/gnome.te +0 -0
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
 
 optional_policy(`

Regards,

Guido

#11 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Quoted 42 lines · Guido Trentalancia

Hello Dominick !

Quoted 19 lines · Guido Trentalancia
Quoted 18 lines

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

[...]

Quoted 8 lines
Quoted 8 lines
policy/modules/contrib/gnome.te +1 -0
+
 ##############################
 #
 # Common local Policy
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
Quoted 9 lines

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 99

Quoted 7 lines
policy/modules/contrib/gnome.te +5 -0
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

Quoted 3 lines

Other applications (such as firefox) need to write those sockets, therefore the policy you suggested in a previous message is not feasible.

How do you figure that?

Quoted 11 lines

In other words those sockets should be created as user_tmp_t and not as a private gconf_tmp_t.

Quoted 3 lines

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 102

Quoted 3 lines
policy/modules/contrib/gnome.te +0 -0
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
 
 optional_policy(`

Regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160815/fbf3e512/attachment.bin 
#12 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Quoted 43 lines · Dominick Grift
Quoted 42 lines · Guido Trentalancia

Hello Dominick !

Quoted 19 lines · Guido Trentalancia
Quoted 18 lines

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

[...]

Quoted 17 lines
Quoted 5 lines
policy/modules/contrib/gnome.te +1 -0
+
 ##############################
 #
 # Common local Policy

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 99

Quoted 10 lines
policy/modules/contrib/gnome.te +5 -0
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

Quoted 6 lines
Quoted 3 lines

Other applications (such as firefox) need to write those sockets, therefore the policy you suggested in a previous message is not feasible.

How do you figure that?

Let me just expand on this a little. I might be wrong on some of the following but i have in the past targeted gnome2 so i do have a little experience with dealing with orbit

There are many sockets in orbit-USER. Every application that relies on that functionality maintains its own socket in there. It is the PRE-dbus way of communications.

gconfd maintains a socket in there. It was in the past decided to target gconfd. We should now also be consistent and just finish what we started.

Besides even if you leave that socket type user_tmp_t that still will leave you with the "gconfd_t:unix_stream_socket connectto" since the gconfd process does have a private type.

If you start saying we will target this part of gconfd but not the other part of gconfd then you might as well not target it at all. It may not be as black-and-white as that, but it essentially boils down to that.

Also beware to not let your desire to "make things work" make you forget about why were doing this in the first place: to enforce integrity.

Things like these are essentially why I can't use refpolicy. Because there are too many compromises like these in there. Where it was forgotten what the purpose is of confined user domains, and where the desire to just produce something that "works" basically blurred our vision.

Quoted 13 lines
Quoted 11 lines

In other words those sockets should be created as user_tmp_t and not as a private gconf_tmp_t.

Quoted 3 lines

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 102

Quoted 3 lines
policy/modules/contrib/gnome.te +0 -0
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
 
 optional_policy(`

Regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160815/ab0b2be7/attachment.bin 
#13 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Hello Dominick.

Late reply to this...

Quoted 61 lines · Dominick Grift
Quoted 47 lines · Dominick Grift
Quoted 46 lines · Guido Trentalancia

Hello Dominick !

Quoted 22 lines · Guido Trentalancia
Quoted 21 lines

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced
? to support the OIL Runtime Compiler (ORC) optimized code ? execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome
? keyring domains;
- add support for a few needed fs and kernel permissions.?

This patch should be applied before applying the pulseaudio patch.

---
?policy/modules/contrib/gnome.fc |????7 ++ ?policy/modules/contrib/gnome.if |???99
+++++++++++++++++++++++++++++++++++++++-
?policy/modules/contrib/gnome.te |????8 +++ ?3 files changed, 112 insertions(+), 2 deletions(-)

[...]

Quoted 18 lines
Quoted 13 lines

+
?##############################
?#
?# Common local Policy

(quoted diff) +0 -0
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 ?manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)

?userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
?

policy/modules/contrib/gnome.te +4 -0
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
Quoted 3 lines

?userdom_manage_user_tmp_dirs(gconfd_t)
?userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

Quoted 7 lines
Quoted 4 lines

Other applications (such as firefox) need to write those sockets, therefore the
policy you suggested in a previous message is not feasible.

How do you figure that?

Let me just expand on this a little. I might be wrong on some of the following but i have in the past targeted gnome2 so i do have a little
experience with dealing with orbit

Quoted 5 lines

There are many sockets in orbit-USER. Every application that relies on
that functionality maintains its own socket in there. It is the PRE- dbus
way of communications.

I have now dropped the support for ORBit-2 in the latest version of this patch. At the end, it is an obsolete library/framework.

Sooner or later, we shall remove any remaining support for GConf and the rest of the Gnome2 file contexts and stuff. It's pointless and risky to keep obsolete stuff for long. In general, security goes hand in hand with keeping software up to date.

Quoted 15 lines

gconfd maintains a socket in there. It was in the past decided to target
gconfd. We should now also be consistent and just finish what we started.

Besides even if you leave that socket type user_tmp_t that still will leave you with the "gconfd_t:unix_stream_socket connectto" since the gconfd process does have a private type.

If you start saying we will target this part of gconfd but not the other
part of gconfd then you might as well not target it at all. It may not
be as black-and-white as that, but it essentially boils down to that.

Quoted 6 lines

Also beware to not let your desire to "make things work" make you forget
about why were doing this in the first place: to enforce integrity.

Things like these are essentially why I can't use refpolicy. Because there are too many compromises like these in there. Where it was

I am not following you anymore...

What compromises are you talking about ? The system needs to be usable, at least to a minimum level. Otherwise, the policy itself is useless.

If there are permissions or interfaces that are dangerous from a security standpoint and removing them does not affect a minimum level of usability, then we should surely make any effort to remove them from the policy !

Please be more specific !

If there is something that is of your concern in the actual policy, please let me know and I will try to test if removing it affects usability, then we can proceed to get rid of it. This is very important. We need an updated tight policy that provides a minimum (eventually tunable) level of usability.

Quoted 3 lines

forgotten what the purpose is of confined user domains, and where the desire to just produce something that "works" basically blurred our vision.

Well, it needs to work in the first place, otherwise there is no point of supporting a given module, we can just remove the support instead of providing a broken one.

Something of my concern, for example, is too much unnecessary freedom for applications to read or manage the user_home_t files when they can be assigned their own private types instead (see for example, my recent pulseaudio patch).

What specifically concerns you most ?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

In other words those sockets should be created as user_tmp_t and not as a
private gconf_tmp_t.

Quoted 3 lines
Quoted 3 lines

?userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir) ?
?optional_policy(`

Regards,

Guido

#14 lore raw

PATCH 1/1 Update for the gnome policy and file contexts

Quoted 128 lines · Guido Trentalancia

Hello Dominick.

Late reply to this...

Quoted 61 lines · Dominick Grift
Quoted 47 lines · Dominick Grift
Quoted 46 lines · Guido Trentalancia

Hello Dominick !

Quoted 22 lines · Guido Trentalancia
Quoted 21 lines

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced
to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome
keyring domains;
- add support for a few needed fs and kernel permissions.

This patch should be applied before applying the pulseaudio patch.

---
 policy/modules/contrib/gnome.fc |    7 ++
 policy/modules/contrib/gnome.if |   99
+++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |    8 +++
 3 files changed, 112 insertions(+), 2 deletions(-)

[...]

Quoted 18 lines
Quoted 6 lines
policy/modules/contrib/gnome.te +1 -0
+
 ##############################
 #
 # Common local Policy
@@ -87,8 +90,13 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)

policy/modules/contrib/gnome.te manage_dirs_pattern(gconfd_t, gconf_tmp_ · line 100

Quoted 10 lines
policy/modules/contrib/gnome.te +5 -0
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file
 })
 
+kernel_dontaudit_read_system_state(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
+userdom_manage_user_tmp_sockets(gconfd_t)

What is going on there and why did you choose this?

Quoted 7 lines
Quoted 4 lines

Other applications (such as firefox) need to write those sockets, therefore the
policy you suggested in a previous message is not feasible.

How do you figure that?

Let me just expand on this a little. I might be wrong on some of the following but i have in the past targeted gnome2 so i do have a little
experience with dealing with orbit

Quoted 5 lines

There are many sockets in orbit-USER. Every application that relies on
that functionality maintains its own socket in there. It is the PRE- dbus
way of communications.

I have now dropped the support for ORBit-2 in the latest version of this patch. At the end, it is an obsolete library/framework.

Sooner or later, we shall remove any remaining support for GConf and the rest of the Gnome2 file contexts and stuff. It's pointless and risky to keep obsolete stuff for long. In general, security goes hand in hand with keeping software up to date.

Quoted 15 lines

gconfd maintains a socket in there. It was in the past decided to target
gconfd. We should now also be consistent and just finish what we started.

Besides even if you leave that socket type user_tmp_t that still will leave you with the "gconfd_t:unix_stream_socket connectto" since the gconfd process does have a private type.

If you start saying we will target this part of gconfd but not the other
part of gconfd then you might as well not target it at all. It may not
be as black-and-white as that, but it essentially boils down to that.

Quoted 6 lines

Also beware to not let your desire to "make things work" make you forget
about why were doing this in the first place: to enforce integrity.

Things like these are essentially why I can't use refpolicy. Because there are too many compromises like these in there. Where it was

I am not following you anymore...

What compromises are you talking about ? The system needs to be usable, at least to a minimum level. Otherwise, the policy itself is useless.

If there are permissions or interfaces that are dangerous from a security standpoint and removing them does not affect a minimum level of usability, then we should surely make any effort to remove them from the policy !

Please be more specific !

If there is something that is of your concern in the actual policy, please let me know and I will try to test if removing it affects usability, then we can proceed to get rid of it. This is very important. We need an updated tight policy that provides a minimum (eventually tunable) level of usability.

Quoted 3 lines

forgotten what the purpose is of confined user domains, and where the desire to just produce something that "works" basically blurred our vision.

Well, it needs to work in the first place, otherwise there is no point of supporting a given module, we can just remove the support instead of providing a broken one.

Quoted 7 lines

Something of my concern, for example, is too much unnecessary freedom for applications to read or manage the user_home_t files when they can be assigned their own private types instead (see for example, my recent pulseaudio patch).

What specifically concerns you most ?

I can't be much more specific. I think that allowing a process associated with type gconfd_t to maintain a socket with type user_tmp_t is a bad idea.

Anyway's, I will leave this to others to decide.

Quoted 12 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

In other words those sockets should be created as user_tmp_t and not as a
private gconf_tmp_t.

Quoted 3 lines
Quoted 3 lines
policy/modules/contrib/gnome.te +0 -0
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
 

optional_policy(`

Regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160816/73f3ff93/attachment.bin 
#15 lore raw

PATCH v2 1/1 Update for the gnome policy and file contexts

In reply to Guido Trentalancia

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for chat over dbus in the gconfd domain;
- add support for a few needed fs and kernel permissions.

Compared to the previous version of this patch, the support for Gnome2/ORBit-2 has been dropped.

Recent changes to the pulseaudio module depends on this patch !

---
 policy/modules/contrib/gnome.fc |    9 +++
 policy/modules/contrib/gnome.if |  100 +++++++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te |   12 ++++
 3 files changed, 118 insertions(+), 3 deletions(-)
policy/modules/contrib/gnome.fc +8 -1
@@ -4,6 +4,9 @@ HOME_DIR/\.gnome(/.*)?	gen_context(syste
 HOME_DIR/\.gnome2(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2/keyrings(/.*)?	gen_context(system_u:object_r:gnome_keyring_home_t,s0)
 HOME_DIR/\.gnome2_private(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
+HOME_DIR/\.cache/keyring[^/]+(/.*)?	gen_context(system_u:object_r:gnome_keyring_cache_home_t,s0)
+
+HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 
 /etc/gconf(/.*)?	gen_context(system_u:object_r:gconf_etc_t,s0)
 
@@ -13,4 +16,8 @@ HOME_DIR/\.gnome2_private(/.*)?	gen_cont
 /usr/bin/mate-keyring-daemon	--	gen_context(system_u:object_r:gkeyringd_exec_t,s0)
 
 /usr/lib/[^/]*/gconf/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
-/usr/libexec/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/usr/libexec/gconfd-2		--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/var/run/user/[^/]*/orcexec\..*		--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
+/var/run/user/%{USERID}/orcexec\..*	--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
policy/modules/contrib/gnome.if +98 -2

142 lines not on this page · raw message

policy/modules/contrib/gnome.te +12 -0
@@ -43,9 +43,15 @@ application_executable_file(gkeyringd_ex
 type gnome_keyring_home_t;
 userdom_user_home_content(gnome_keyring_home_t)
 
+type gnome_keyring_cache_home_t;
+userdom_user_home_content(gnome_keyring_cache_home_t)
+
 type gnome_keyring_tmp_t;
 userdom_user_tmp_file(gnome_keyring_tmp_t)
 
+type gstreamer_orcexec_t;
+application_executable_file(gstreamer_orcexec_t)
+
 ##############################
 #
 # Common local Policy
@@ -87,6 +93,12 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
+kernel_dontaudit_read_system_state(gconfd_t)
+
+files_search_tmp(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
#16 lore raw

PATCH v2 1/1 Update for the gnome policy and file contexts

Quoted 14 lines · Guido Trentalancia

Update for the gnome module:

- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for chat over dbus in the gconfd domain;
- add support for a few needed fs and kernel permissions.

Compared to the previous version of this patch, the support for Gnome2/ORBit-2 has been dropped.

Recent changes to the pulseaudio module depends on this patch !

[...]

policy/modules/contrib/gnome.if line 1

Quoted 5 lines
policy/modules/contrib/gnome.if +1 -1
@@ -1,4 +1,4 @@
-## <summary>GNU network object model environment.</summary>
+

This was probably a mistake, but please don't remove the XML.

Quoted 12 lines
policy/modules/contrib/gnome.if +1 -1
 ########################################
 ## <summary>
@@ -44,7 +44,7 @@ template(`gnome_role_template',`
 	gen_require(`
 		attribute gnomedomain, gkeyringd_domain;
 		attribute_role gconfd_roles;
-		type gkeyringd_exec_t, gnome_keyring_home_t, gnome_keyring_tmp_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t, gnome_keyring_cache_home_t, gnome_keyring_tmp_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
 	')

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 104

Quoted 5 lines
policy/modules/contrib/gnome.if +2 -0
@@ -100,9 +100,23 @@ template(`gnome_role_template',`
 
 	allow $3 gnome_keyring_tmp_t:sock_file { relabel_sock_file_perms manage_sock_file_perms };
 
+	userdom_manage_user_home_content_dirs($1_gkeyringd_t)
+	userdom_manage_user_home_content_files($1_gkeyringd_t)

This is discussed in another thread, I am concerned about these permissions for the same reason Dominick is.

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 113

Quoted 8 lines
policy/modules/contrib/gnome.if +8 -0
+	manage_dirs_pattern($1_gkeyringd_t, gnome_keyring_cache_home_t, gnome_keyring_cache_home_t)
+	userdom_user_home_content_filetrans($1_gkeyringd_t, gnome_keyring_cache_home_t, dir)
+
+	manage_sock_files_pattern($1_gkeyringd_t, gnome_keyring_cache_home_t, gnome_keyring_cache_home_t)
+	userdom_user_home_content_filetrans($1_gkeyringd_t, gnome_keyring_cache_home_t, sock_file, "control")
+	userdom_user_home_content_filetrans($1_gkeyringd_t, gnome_keyring_cache_home_t, sock_file, "gpg")
+	userdom_user_home_content_filetrans($1_gkeyringd_t, gnome_keyring_cache_home_t, sock_file, "pkcs11")
+	userdom_user_home_content_filetrans($1_gkeyringd_t, gnome_keyring_cache_home_t, sock_file, "ssh")

I suspect putting the socket names is unnecessary. It doesn't appear to create different types of sockets in the same directory.

Quoted 31 lines
policy/modules/contrib/gnome.if +14 -0
 	ps_process_pattern($3, $1_gkeyringd_t)
 	allow $3 $1_gkeyringd_t:process { ptrace signal_perms };
 
+	kernel_read_kernel_sysctls($1_gkeyringd_t)
+
 	corecmd_bin_domtrans($1_gkeyringd_t, $3)
 	corecmd_shell_domtrans($1_gkeyringd_t, $3)
 
@@ -112,6 +126,7 @@ template(`gnome_role_template',`
 		dbus_spec_session_domain($1, $1_gkeyringd_t, gkeyringd_exec_t)
 
 		optional_policy(`
+			gnome_dbus_chat_gconfd($3)
 			gnome_dbus_chat_gkeyringd($1, $3)
 		')
 	')
@@ -569,6 +584,36 @@ interface(`gnome_home_filetrans_gnome_ho
 
 ########################################
 ## <summary>
+##	Create objects in user home
+##	directories with the gstreamer
+##	orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>

policy/modules/contrib/gnome.if interface(`gnome_home_filetrans_gnome_ho · line 607

Quoted 10 lines
policy/modules/contrib/gnome.if +10 -0
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_home_filetrans_gstreamer_orcexec',`

This should be gnome_user_home_dir_filetrans_orcexec() or gnome_user_home_dir_filetrans_gstreamer() orcexec

[...]

policy/modules/contrib/gnome.if interface(`gnome_gconf_home_filetrans',` · line 678

Quoted 7 lines
policy/modules/contrib/gnome.if +7 -0
+interface(`gnome_user_runtime_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	userdom_user_runtime_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')

Right naming scheme, but if you drop the "gstreamer" out of the previous interface name, do the same here.

Signature · 1 line
Chris PeBenito
#17 lore raw

PATCH v3 1/1 Update for the gnome policy and file contexts

In reply to Guido Trentalancia

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the gnome-settings-daemon and the at-spi daemon with all the needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for chat over dbus in the gconfd domain and in the new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home directories (such as the ICC EDID profiles): requires the recent colord patch;
- add support for for reading the colord related files in the home directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home directories;
- includes minor modifications to the consolekit, dbus and policykit modules to support the new targeted gnome daemons and applications;
- modifies the pulseaudio module to introduce new interfaces to read and write pulseaudio tmpfs files and to use the pulseaudio file descriptor.

The support for Gnome2/ORBit-2 (version 2) has been dropped.

This patch depends on the recent colord patch.

Recent changes to the pulseaudio module depends on this patch !

---
 policy/modules/contrib/colord.if     |   41 +++
 policy/modules/contrib/colord.te     |    4
 policy/modules/contrib/consolekit.te |    4
 policy/modules/contrib/dbus.te       |    9
 policy/modules/contrib/gnome.fc      |   19 +
 policy/modules/contrib/gnome.if      |  426 ++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te      |  267 +++++++++++++++++++++
 policy/modules/contrib/policykit.fc  |    2
 policy/modules/contrib/policykit.if  |   20 +
 policy/modules/contrib/policykit.te  |    1
 policy/modules/contrib/pulseaudio.if |   77 ++++++
 policy/modules/contrib/pulseaudio.te |    5
 policy/modules/system/userdomain.if  |    4
 13 files changed, 876 insertions(+), 3 deletions(-)
policy/modules/contrib/colord.if +41 -0
@@ -58,3 +58,44 @@ interface(`colord_read_lib_files',`
 	files_search_var_lib($1)
 	read_files_pattern($1, colord_var_lib_t, colord_var_lib_t)
 ')
+
+######################################
+## <summary>
+##	Read colord home files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`colord_read_home_files',`
+	gen_require(`
+		type colord_home_t;
+	')
+
+	userdom_search_user_home_dirs($1)
+	userdom_list_user_home_content($1)
+	read_files_pattern($1, colord_home_t, colord_home_t)
+')
+
+######################################
+## <summary>
+##	Create, read, write, and delete
+##	colord home content.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`colord_manage_home_files',`
+	gen_require(`
+		type colord_home_t;
+	')
+
+	userdom_search_user_home_dirs($1)
+	userdom_list_user_home_content($1)
+	manage_files_pattern($1, colord_home_t, colord_home_t)
+')
policy/modules/contrib/colord.te +4 -0
@@ -123,6 +136,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	gnome_settings_daemon_use_fds(colord_t)
+')
+
+optional_policy(`
 	policykit_dbus_chat(colord_t)
 	policykit_domtrans_auth(colord_t)
 	policykit_read_lib(colord_t)--- refpolicy-git-06082016-orig/policy/modules/contrib/consolekit.te	2016-08-07 23:05:57.060018494 +0200

+++ refpolicy-git-06082016/policy/modules/contrib/consolekit.te 2016-08-19 22:13:01.508709501 +0200
@@ -104,6 +101,10 @@ tunable_policy(use_samba_home_dirs',
')

optional_policy(`
+ gnome_read_settings_daemon_files(consolekit_t)
+')
+
+optional_policy(`
dbus_read_lib_files(consolekit_t) dbus_system_domain(consolekit_t, consolekit_exec_t)

policy/modules/contrib/dbus.te +9 -0
@@ -148,6 +148,15 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_read_home_files(system_dbusd_t)
+')
+
+optional_policy(`
+	gnome_read_settings_daemon_files(system_dbusd_t)
+	gnome_settings_daemon_use_fds(system_dbusd_t)
+')
+
+optional_policy(`
 	policykit_read_lib(system_dbusd_t)
 ')
 
policy/modules/contrib/gnome.fc +18 -1
@@ -1,16 +1,33 @@
+HOME_DIR/\.cache/dconf(/.*)?		gen_context(system_u:object_r:dconf_home_t,s0)
+HOME_DIR/\.cache/keyring[^/]+(/.*)?	gen_context(system_u:object_r:gnome_keyring_cache_home_t,s0)
+HOME_DIR/\.config/dconf(/.*)?		gen_context(system_u:object_r:dconf_home_t,s0)
 HOME_DIR/\.gconf(/.*)?	gen_context(system_u:object_r:gconf_home_t,s0)
 HOME_DIR/\.gconfd(/.*)?	gen_context(system_u:object_r:gconf_home_t,s0)
 HOME_DIR/\.gnome(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2/keyrings(/.*)?	gen_context(system_u:object_r:gnome_keyring_home_t,s0)
 HOME_DIR/\.gnome2_private(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
+HOME_DIR/\.local/share/mime(/.*)?	gen_context(system_u:object_r:mime_info_t,s0)
+
+HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 
 /etc/gconf(/.*)?	gen_context(system_u:object_r:gconf_etc_t,s0)
 
 /tmp/gconfd-USER/.*	--	gen_context(system_u:object_r:gconf_tmp_t,s0)
 
 /usr/bin/gnome-keyring-daemon	--	gen_context(system_u:object_r:gkeyringd_exec_t,s0)
+/usr/bin/gsettings		--	gen_context(system_u:object_r:gnome_settings_exec_t,s0)
 /usr/bin/mate-keyring-daemon	--	gen_context(system_u:object_r:gkeyringd_exec_t,s0)
 
 /usr/lib/[^/]*/gconf/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
-/usr/libexec/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/usr/libexec/at-spi-bus-launcher	--	gen_context(system_u:object_r:at_spi_exec_t,s0)
+/usr/libexec/dconf-service	--	gen_context(system_u:object_r:dconf_exec_t,s0)
+/usr/libexec/gconfd-2		--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+/usr/libexec/gnome-settings-daemon	--	gen_context(system_u:object_r:gnome_settings_daemon_exec_t,s0)
+/usr/libexec/gsd-[^/]*		--	gen_context(system_u:object_r:gnome_settings_daemon_exec_t,s0)
+
+/usr/share/glib-[^/]*/schemas(/.*)?	gen_context(system_u:object_r:gnome_settings_schemas_t,s0)
+
+/var/run/user/[^/]*/orcexec\..*		--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
+/var/run/user/%{USERID}/orcexec\..*	--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
policy/modules/contrib/gnome.if +425 -1

501 lines not on this page · raw message

policy/modules/contrib/gnome.te +266 -1

307 lines not on this page · raw message

policy/modules/contrib/policykit.fc +2 -0
@@ -1,3 +1,5 @@
+/usr/bin/pkexec		--	gen_context(system_u:object_r:policykit_exec_t,s0)
+
 /usr/lib/polkit-1/polkitd	--	gen_context(system_u:object_r:policykit_exec_t,s0)
 /usr/lib/polkit-1/polkit-agent-helper-1	--	gen_context(system_u:object_r:policykit_auth_exec_t,s0)
 
policy/modules/contrib/policykit.if +20 -0
@@ -44,6 +44,26 @@ interface(`policykit_dbus_chat_auth',`
 
 ########################################
 ## <summary>
+##	Execute a domain transition to
+##	run polkit.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+#
+interface(`policykit_domtrans',`
+	gen_require(`
+		type policykit_t, policykit_exec_t;
+	')
+
+	corecmd_search_bin($1)
+	domtrans_pattern($1, policykit_exec_t, policykit_t)
+')
+
+########################################
+## <summary>
 ##	Execute a domain transition to run polkit_auth.
 ## </summary>
 ## <param name="domain">
policy/modules/contrib/policykit.te +1 -0
@@ -117,6 +118,7 @@ optional_policy(`
 
 optional_policy(`
 	gnome_read_generic_home_content(policykit_t)
+	gnome_read_settings_daemon_files(policykit_t)
 ')
 
 optional_policy(`
policy/modules/contrib/pulseaudio.if +77 -0

80 lines not on this page · raw message

policy/modules/contrib/pulseaudio.te +5 -0
@@ -193,6 +193,11 @@ optional_policy(`
 
 optional_policy(`
 	gnome_stream_connect_gconf(pulseaudio_t)
+
+	# OIL Runtime Compiler (ORC) optimized code execution
+	allow pulseaudio_t gstreamer_orcexec_t:file { manage_file_perms mmap_file_perms };
+	gnome_user_runtime_filetrans_gstreamer_orcexec(pulseaudio_t, file)
+	gnome_user_home_dir_filetrans_gstreamer_orcexec(pulseaudio_t, file)
 ')
 
 optional_policy(`--- refpolicy-git-06082016-orig/policy/modules/system/userdomain.if	2016-08-20 04:02:51.687901531 +0200

+++ refpolicy-git-06082016/policy/modules/system/userdomain.if 2016-08-19 23:44:30.690540547 +0200
@@ -593,6 +593,10 @@ template(`userdom_common_user_template',
')

optional_policy(`
+ colord_manage_home_files($1_t)
+ ')
+
+ optional_policy(`
dbus_system_bus_client($1_t)

optional_policy(`

#18 lore raw

PATCH v3 1/1 Update for the gnome policy and file contexts

Quoted 27 lines · Guido Trentalancia via refpolicy

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the gnome-settings-daemon and the at-spi daemon with all the needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for chat over dbus in the gconfd domain and in the new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home directories (such as the ICC EDID profiles): requires the recent colord patch;
- add support for for reading the colord related files in the home directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home directories;
- includes minor modifications to the consolekit, dbus and policykit modules to support the new targeted gnome daemons and applications;
- modifies the pulseaudio module to introduce new interfaces to read and write pulseaudio tmpfs files and to use the pulseaudio file descriptor.

Quoted 1 line

The support for Gnome2/ORBit-2 (version 2) has been dropped.

if you want me to review this then you have to split this patch into smaller patches

Quoted 1,137 lines

This patch depends on the recent colord patch.

Recent changes to the pulseaudio module depends on this patch !

---
 policy/modules/contrib/colord.if     |   41 +++
 policy/modules/contrib/colord.te     |    4
 policy/modules/contrib/consolekit.te |    4
 policy/modules/contrib/dbus.te       |    9
 policy/modules/contrib/gnome.fc      |   19 +
 policy/modules/contrib/gnome.if      |  426 ++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te      |  267 +++++++++++++++++++++
 policy/modules/contrib/policykit.fc  |    2
 policy/modules/contrib/policykit.if  |   20 +
 policy/modules/contrib/policykit.te  |    1
 policy/modules/contrib/pulseaudio.if |   77 ++++++
 policy/modules/contrib/pulseaudio.te |    5
 policy/modules/system/userdomain.if  |    4
 13 files changed, 876 insertions(+), 3 deletions(-)
policy/modules/contrib/colord.if +41 -0
@@ -58,3 +58,44 @@ interface(`colord_read_lib_files',`
 	files_search_var_lib($1)
 	read_files_pattern($1, colord_var_lib_t, colord_var_lib_t)
 ')
+
+######################################
+## <summary>
+##	Read colord home files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`colord_read_home_files',`
+	gen_require(`
+		type colord_home_t;
+	')
+
+	userdom_search_user_home_dirs($1)
+	userdom_list_user_home_content($1)
+	read_files_pattern($1, colord_home_t, colord_home_t)
+')
+
+######################################
+## <summary>
+##	Create, read, write, and delete
+##	colord home content.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`colord_manage_home_files',`
+	gen_require(`
+		type colord_home_t;
+	')
+
+	userdom_search_user_home_dirs($1)
+	userdom_list_user_home_content($1)
+	manage_files_pattern($1, colord_home_t, colord_home_t)
+')
policy/modules/contrib/colord.te +9 -0
@@ -123,6 +136,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	gnome_settings_daemon_use_fds(colord_t)
+')
+
+optional_policy(`
 	policykit_dbus_chat(colord_t)
 	policykit_domtrans_auth(colord_t)
 	policykit_read_lib(colord_t)--- refpolicy-git-06082016-orig/policy/modules/contrib/consolekit.te	2016-08-07 23:05:57.060018494 +0200
+++ refpolicy-git-06082016/policy/modules/contrib/consolekit.te	2016-08-19 22:13:01.508709501 +0200
@@ -104,6 +101,10 @@ tunable_policy(`use_samba_home_dirs',`
 ')
 
 optional_policy(`
+	gnome_read_settings_daemon_files(consolekit_t)
+')
+
+optional_policy(`
 	dbus_read_lib_files(consolekit_t)
 	dbus_system_domain(consolekit_t, consolekit_exec_t)
 
policy/modules/contrib/dbus.te +9 -0
@@ -148,6 +148,15 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_read_home_files(system_dbusd_t)
+')
+
+optional_policy(`
+	gnome_read_settings_daemon_files(system_dbusd_t)
+	gnome_settings_daemon_use_fds(system_dbusd_t)
+')
+
+optional_policy(`
 	policykit_read_lib(system_dbusd_t)
 ')
 
policy/modules/contrib/gnome.fc +18 -1
@@ -1,16 +1,33 @@
+HOME_DIR/\.cache/dconf(/.*)?		gen_context(system_u:object_r:dconf_home_t,s0)
+HOME_DIR/\.cache/keyring[^/]+(/.*)?	gen_context(system_u:object_r:gnome_keyring_cache_home_t,s0)
+HOME_DIR/\.config/dconf(/.*)?		gen_context(system_u:object_r:dconf_home_t,s0)
 HOME_DIR/\.gconf(/.*)?	gen_context(system_u:object_r:gconf_home_t,s0)
 HOME_DIR/\.gconfd(/.*)?	gen_context(system_u:object_r:gconf_home_t,s0)
 HOME_DIR/\.gnome(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2/keyrings(/.*)?	gen_context(system_u:object_r:gnome_keyring_home_t,s0)
 HOME_DIR/\.gnome2_private(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
+HOME_DIR/\.local/share/mime(/.*)?	gen_context(system_u:object_r:mime_info_t,s0)
+
+HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 
 /etc/gconf(/.*)?	gen_context(system_u:object_r:gconf_etc_t,s0)
 
 /tmp/gconfd-USER/.*	--	gen_context(system_u:object_r:gconf_tmp_t,s0)
 
 /usr/bin/gnome-keyring-daemon	--	gen_context(system_u:object_r:gkeyringd_exec_t,s0)
+/usr/bin/gsettings		--	gen_context(system_u:object_r:gnome_settings_exec_t,s0)
 /usr/bin/mate-keyring-daemon	--	gen_context(system_u:object_r:gkeyringd_exec_t,s0)
 
 /usr/lib/[^/]*/gconf/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
-/usr/libexec/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/usr/libexec/at-spi-bus-launcher	--	gen_context(system_u:object_r:at_spi_exec_t,s0)
+/usr/libexec/dconf-service	--	gen_context(system_u:object_r:dconf_exec_t,s0)
+/usr/libexec/gconfd-2		--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+/usr/libexec/gnome-settings-daemon	--	gen_context(system_u:object_r:gnome_settings_daemon_exec_t,s0)
+/usr/libexec/gsd-[^/]*		--	gen_context(system_u:object_r:gnome_settings_daemon_exec_t,s0)
+
+/usr/share/glib-[^/]*/schemas(/.*)?	gen_context(system_u:object_r:gnome_settings_schemas_t,s0)
+
+/var/run/user/[^/]*/orcexec\..*		--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
+/var/run/user/%{USERID}/orcexec\..*	--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
policy/modules/contrib/gnome.if +425 -1
@@ -43,14 +43,40 @@ interface(`gnome_role',`
 template(`gnome_role_template',`
 	gen_require(`
 		attribute gnomedomain, gkeyringd_domain;
+		attribute_role dconf_roles;
+		attribute_role at_spi_roles;
 		attribute_role gconfd_roles;
-		type gkeyringd_exec_t, gnome_keyring_home_t, gnome_keyring_tmp_t;
+		attribute_role gnome_settings_roles;
+		attribute_role gnome_settings_daemon_roles;
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t, gnome_settings_daemon_exec_t;
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t, gnome_keyring_cache_home_t, gnome_keyring_tmp_t;
+		type mime_info_t;
+		type user_dbusd_t;
+		type dbusd_exec_t;
 	')
 
 	########################################
 	#
+	# Dconf declarations
+	#
+
+	roleattribute $2 dconf_roles;
+
+	########################################
+	#
+	# At-spi declarations
+	#
+
+	roleattribute $2 at_spi_roles;
+
+	########################################
+	#
 	# Gconf declarations
 	#
 
@@ -58,6 +84,20 @@ template(`gnome_role_template',`
 
 	########################################
 	#
+	# Gnome-settings declarations
+	#
+
+	roleattribute $2 gnome_settings_roles;
+
+	########################################
+	#
+	# Gnome-settings-daemon declarations
+	#
+
+	roleattribute $2 gnome_settings_daemon_roles;
+
+	########################################
+	#
 	# Gkeyringd declarations
 	#
 
@@ -69,6 +109,70 @@ template(`gnome_role_template',`
 
 	########################################
 	#
+	# Common policy
+	#
+
+	allow $3 dconf_home_t:dir manage_dir_perms;
+	allow $3 dconf_home_t:file manage_file_perms;
+	allow $3 dconf_home_t:lnk_file manage_lnk_file_perms;
+
+	allow $3 gnome_settings_schemas_t:dir list_dir_perms;
+	allow $3 gnome_settings_schemas_t:file read_file_perms;
+	allow $3 gnome_settings_schemas_t:lnk_file read_lnk_file_perms;
+
+	allow $3 mime_info_t:dir list_dir_perms;
+	allow $3 mime_info_t:file read_file_perms;
+
+	allow at_spi_t user_dbusd_t:process signal;
+
+	allow user_dbusd_t self:process signal;
+
+	allow user_dbusd_t bin_t:file entrypoint;
+
+	allow user_dbusd_t dbusd_exec_t:file exec_file_perms;
+
+	gnome_read_settings_files(user_dbusd_t)
+	gnome_read_settings_daemon_files(user_dbusd_t)
+
+	files_read_usr_files($3)
+
+	kernel_read_system_state(user_dbusd_t)
+
+	optional_policy(`
+		xserver_read_user_xauth(user_dbusd_t)
+		xserver_stream_connect(user_dbusd_t)
+	')
+
+	########################################
+	#
+	# Dconf policy
+	#
+
+	allow dconf_t user_dbusd_t:unix_stream_socket connectto;
+
+	allow user_dbusd_t dconf_exec_t:file { entrypoint exec_file_perms };
+
+	domtrans_pattern(user_dbusd_t, dconf_exec_t, dconf_t)
+
+	########################################
+	#
+	# At-spi policy
+	#
+
+	allow at_spi_t user_dbusd_t:unix_stream_socket connectto;
+
+	allow at_spi_t dbusd_exec_t:file { entrypoint exec_file_perms };
+
+	allow user_dbusd_t at_spi_exec_t:file { entrypoint exec_file_perms };
+
+	allow $3 at_spi_t:fd use;
+
+	domtrans_pattern(at_spi_t, dbusd_exec_t, user_dbusd_t)
+
+	domtrans_pattern(user_dbusd_t, at_spi_exec_t, at_spi_t)
+
+	########################################
+	#
 	# Gconf policy
 	#
 
@@ -84,6 +188,38 @@ template(`gnome_role_template',`
 
 	########################################
 	#
+	# Gnome-settings policy
+	#
+
+	domtrans_pattern($3, gnome_settings_exec_t, gnome_settings_t)
+
+	allow $3 gnome_settings_t:process { ptrace signal_perms };
+	ps_process_pattern($3, gnome_settings_t)
+
+	allow gnome_settings_t user_dbusd_t:unix_stream_socket connectto;
+
+	allow gnome_settings_t bin_t:file entrypoint;
+	allow gnome_settings_t dbusd_exec_t:file { entrypoint exec_file_perms };
+
+	# for dbus-launch
+	corecmd_bin_domtrans(gnome_settings_t, user_dbusd_t)
+
+	domtrans_pattern(gnome_settings_t, dbusd_exec_t, user_dbusd_t)
+
+	########################################
+	#
+	# Gnome-settings-daemon policy
+	#
+
+	domtrans_pattern($3, gnome_settings_daemon_exec_t, gnome_settings_daemon_t)
+
+	allow gnome_settings_daemon_t user_dbusd_t:unix_stream_socket connectto;
+
+	allow $3 gnome_settings_daemon_t:process { ptrace signal_perms };
+	ps_process_pattern($3, gnome_settings_daemon_t)
+
+	########################################
+	#
 	# Gkeyringd policy
 	#
 
@@ -100,23 +236,85 @@ template(`gnome_role_template',`
 
 	allow $3 gnome_keyring_tmp_t:sock_file { relabel_sock_file_perms manage_sock_file_perms };
 
+	userdom_manage_user_home_content_dirs($1_gkeyringd_t)
+	userdom_manage_user_home_content_files($1_gkeyringd_t)
+
+	manage_dirs_pattern($1_gkeyringd_t, gnome_keyring_cache_home_t, gnome_keyring_cache_home_t)
+	userdom_user_home_content_filetrans($1_gkeyringd_t, gnome_keyring_cache_home_t, dir)
+
+	manage_sock_files_pattern($1_gkeyringd_t, gnome_keyring_cache_home_t, gnome_keyring_cache_home_t)
+	userdom_user_home_content_filetrans($1_gkeyringd_t, gnome_keyring_cache_home_t, sock_file)
+
 	ps_process_pattern($3, $1_gkeyringd_t)
 	allow $3 $1_gkeyringd_t:process { ptrace signal_perms };
 
+	kernel_read_kernel_sysctls($1_gkeyringd_t)
+
 	corecmd_bin_domtrans($1_gkeyringd_t, $3)
 	corecmd_shell_domtrans($1_gkeyringd_t, $3)
 
 	gnome_stream_connect_gkeyringd($1, $3)
 
 	optional_policy(`
+		dbus_connect_spec_session_bus(user, dconf_t)
+		dbus_connect_spec_session_bus(user, at_spi_t)
+		dbus_connect_spec_session_bus(user, gnome_settings_daemon_t)
+		dbus_connect_system_bus(gnome_settings_daemon_t)
+		dbus_send_spec_session_bus(user, dconf_t)
+		dbus_send_spec_session_bus(user, at_spi_t)
+		dbus_send_spec_session_bus(user, gnome_settings_daemon_t)
 		dbus_spec_session_domain($1, $1_gkeyringd_t, gkeyringd_exec_t)
 
 		optional_policy(`
+			gnome_dbus_chat_dconf($3)
+			gnome_dbus_chat_dconf(gnome_settings_t)
+			gnome_dbus_chat_at_spi($3)
+			gnome_dbus_chat_gconfd($3)
+			gnome_dbus_chat_gnome_settings(user_dbusd_t)
+			gnome_dbus_chat_gnome_settings_daemon($3)
+			gnome_dbus_chat_gnome_settings_daemon(at_spi_t)
 			gnome_dbus_chat_gkeyringd($1, $3)
 		')
 	')
 ')
 
+#######################################
+## <summary>
+##	Read gnome-settings files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_read_settings_files',`
+	gen_require(`
+		type gnome_settings_t;
+	')
+
+	read_files_pattern($1, gnome_settings_t, gnome_settings_t)
+')
+
+#######################################
+## <summary>
+##	Read gnome-settings-daemon
+##	files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_read_settings_daemon_files',`
+	gen_require(`
+		type gnome_settings_daemon_t;
+	')
+
+	read_files_pattern($1, gnome_settings_daemon_t, gnome_settings_daemon_t)
+')
+
 ########################################
 ## <summary>
 ##	Execute gconf in the caller domain.
@@ -569,6 +767,36 @@ interface(`gnome_home_filetrans_gnome_ho
 
 ########################################
 ## <summary>
+##	Create objects in user home
+##	directories with the gstreamer
+##	orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_user_home_dir_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	userdom_user_home_dir_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+
+########################################
+## <summary>
 ##	Create objects in gnome gconf home
 ##	directories with a private type.
 ## </summary>
@@ -604,6 +832,36 @@ interface(`gnome_gconf_home_filetrans',`
 
 ########################################
 ## <summary>
+##	Create objects in the user
+##	runtime directories with the
+##	gstreamer orcexec type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+## <param name="object_class">
+##	<summary>
+##	Class of the object being created.
+##	</summary>
+## </param>
+## <param name="name" optional="true">
+##	<summary>
+##	The name of the object being created.
+##	</summary>
+## </param>
+#
+interface(`gnome_user_runtime_filetrans_gstreamer_orcexec',`
+	gen_require(`
+		type gstreamer_orcexec_t;
+	')
+
+	userdom_user_runtime_filetrans($1, gstreamer_orcexec_t, $2, $3)
+')
+
+########################################
+## <summary>
 ##	Read generic gnome keyring home files.
 ## </summary>
 ## <param name="domain">
@@ -623,6 +881,133 @@ interface(`gnome_read_keyring_home_files
 
 ########################################
 ## <summary>
+##	Read mime info files in the home
+##	directory.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_read_mime_info_home_files',`
+	gen_require(`
+		type mime_info_t;
+	')
+
+	userdom_search_user_home_dirs($1)
+	userdom_list_user_home_content($1)
+	read_files_pattern($1, mime_info_t, mime_info_t)
+')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	the dconf daemon over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_dbus_chat_dconf',`
+	gen_require(`
+		type dconf_t;
+		class dbus send_msg;
+	')
+
+	allow $1 dconf_t:dbus send_msg;
+	allow dconf_t $1:dbus send_msg;
+')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	the at-spi daemon over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_dbus_chat_at_spi',`
+	gen_require(`
+		type at_spi_t;
+		class dbus send_msg;
+	')
+
+	allow $1 at_spi_t:dbus send_msg;
+	allow at_spi_t $1:dbus send_msg;
+')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	the gconf daemon over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_dbus_chat_gconfd',`
+	gen_require(`
+		type gconfd_t;
+		class dbus send_msg;
+	')
+
+	allow $1 gconfd_t:dbus send_msg;
+	allow gconfd_t $1:dbus send_msg;
+')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	gnome-settings over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_dbus_chat_gnome_settings',`
+	gen_require(`
+		type gnome_settings_t;
+		class dbus send_msg;
+	')
+
+	allow $1 gnome_settings_t:dbus send_msg;
+	allow gnome_settings_t $1:dbus send_msg;
+')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	the gnome-settings-daemon over
+##	dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_dbus_chat_gnome_settings_daemon',`
+	gen_require(`
+		type gnome_settings_daemon_t;
+		class dbus send_msg;
+	')
+
+	allow $1 gnome_settings_daemon_t:dbus send_msg;
+	allow gnome_settings_daemon_t $1:dbus send_msg;
+')
+
+########################################
+## <summary>
 ##	Send and receive messages from
 ##	gnome keyring daemon over dbus.
 ## </summary>
@@ -735,3 +1120,42 @@ interface(`gnome_stream_connect_all_gkey
 	files_search_tmp($1)
 	stream_connect_pattern($1, gnome_keyring_tmp_t, gnome_keyring_tmp_t, gkeyringd_domain)
 ')
+
+########################################
+## <summary>
+##	Use file descriptors for
+##	the gnome settings daemon.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_settings_daemon_use_fds',`
+	gen_require(`
+		type gnome_settings_daemon_t;
+	')
+
+	allow $1 gnome_settings_daemon_t:fd use;
+')
+
+########################################
+## <summary>
+##	Do not audit attempts to use the
+##	file descriptors for the gnome
+##	settings daemon.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`gnome_dontaudit_settings_daemon_use_fds',`
+	gen_require(`
+		type gnome_settings_daemon_t;
+	')
+
+	dontaudit $1 gnome_settings_daemon_t:fd use;
+')
policy/modules/contrib/gnome.te +266 -1
@@ -7,7 +7,24 @@ policy_module(gnome, 2.5.1)
 
 attribute gkeyringd_domain;
 attribute gnomedomain;
+attribute_role dconf_roles;
+attribute_role at_spi_roles;
 attribute_role gconfd_roles;
+attribute_role gnome_settings_roles;
+attribute_role gnome_settings_daemon_roles;
+
+type dconf_t;
+type dconf_exec_t;
+userdom_user_application_domain(dconf_t, dconf_exec_t)
+role dconf_roles types dconf_t;
+
+type dconf_home_t;
+userdom_user_home_content(dconf_home_t)
+
+type at_spi_t;
+type at_spi_exec_t;
+userdom_user_application_domain(at_spi_t, at_spi_exec_t)
+role at_spi_roles types at_spi_t;
 
 type gconf_etc_t;
 files_config_file(gconf_etc_t)
@@ -31,6 +48,19 @@ typealias gconfd_t alias { auditadm_gcon
 userdom_user_application_domain(gconfd_t, gconfd_exec_t)
 role gconfd_roles types gconfd_t;
 
+type gnome_settings_t;
+type gnome_settings_exec_t;
+userdom_user_application_domain(gnome_settings_exec_t, gnome_settings_exec_t)
+role gnome_settings_roles types gnome_settings_t;
+
+type gnome_settings_daemon_t;
+type gnome_settings_daemon_exec_t;
+userdom_user_application_domain(gnome_settings_daemon_exec_t, gnome_settings_daemon_exec_t)
+role gnome_settings_daemon_roles types gnome_settings_daemon_t;
+
+type gnome_settings_schemas_t;
+files_config_file(gnome_settings_schemas_t)
+
 type gnome_home_t;
 typealias gnome_home_t alias { user_gnome_home_t staff_gnome_home_t sysadm_gnome_home_t };
 typealias gnome_home_t alias { auditadm_gnome_home_t secadm_gnome_home_t };
@@ -43,9 +73,18 @@ application_executable_file(gkeyringd_ex
 type gnome_keyring_home_t;
 userdom_user_home_content(gnome_keyring_home_t)
 
+type gnome_keyring_cache_home_t;
+userdom_user_home_content(gnome_keyring_cache_home_t)
+
 type gnome_keyring_tmp_t;
 userdom_user_tmp_file(gnome_keyring_tmp_t)
 
+type mime_info_t;
+files_config_file(mime_info_t)
+
+type gstreamer_orcexec_t;
+application_executable_file(gstreamer_orcexec_t)
+
 ##############################
 #
 # Common local Policy
@@ -73,7 +112,62 @@ optional_policy(`
 
 ##############################
 #
-# Conf daemon local Policy
+# DConf daemon local policy (Gnome3)
+#
+
+allow dconf_t self:process signal;
+
+allow dconf_t dconf_home_t:dir manage_dir_perms;
+allow dconf_t dconf_home_t:file manage_file_perms;
+allow dconf_t dconf_home_t:lnk_file manage_lnk_file_perms;
+
+userdom_search_user_home_content(dconf_t)
+
+fs_getattr_xattr_fs(dconf_t)
+
+kernel_read_system_state(dconf_t)
+
+selinux_getattr_fs(dconf_t)
+
+##############################
+#
+# At-spi local policy
+#
+
+allow at_spi_t self:process signal;
+
+allow at_spi_t dconf_home_t:dir manage_dir_perms;
+allow at_spi_t dconf_home_t:file manage_file_perms;
+allow at_spi_t dconf_home_t:lnk_file manage_lnk_file_perms;
+
+allow at_spi_t gnome_settings_schemas_t:dir list_dir_perms;
+allow at_spi_t gnome_settings_schemas_t:file read_file_perms;
+allow at_spi_t gnome_settings_schemas_t:lnk_file read_lnk_file_perms;
+
+rw_fifo_files_pattern(at_spi_t, at_spi_t, at_spi_t)
+
+corecmd_search_bin(at_spi_t)
+
+files_read_usr_files(at_spi_t)
+
+fs_getattr_xattr_fs(at_spi_t)
+
+kernel_read_system_state(at_spi_t)
+
+selinux_getattr_fs(at_spi_t)
+
+# search in .cache
+userdom_search_user_home_dirs(at_spi_t)
+userdom_search_user_home_content(at_spi_t)
+
+optional_policy(`
+	xserver_read_user_xauth(at_spi_t)
+	xserver_stream_connect(at_spi_t)
+')
+
+##############################
+#
+# GConf daemon local Policy (Gnome2)
 #
 
 allow gconfd_t gconf_etc_t:dir list_dir_perms;
@@ -87,6 +181,12 @@ manage_dirs_pattern(gconfd_t, gconf_tmp_
 manage_files_pattern(gconfd_t, gconf_tmp_t, gconf_tmp_t)
 userdom_user_tmp_filetrans(gconfd_t, gconf_tmp_t, { dir file })
 
+kernel_dontaudit_read_system_state(gconfd_t)
+
+files_search_tmp(gconfd_t)
+
+fs_getattr_xattr_fs(gconfd_t)
+
 userdom_manage_user_tmp_dirs(gconfd_t)
 userdom_tmp_filetrans_user_tmp(gconfd_t, dir)
 userdom_user_runtime_filetrans_user_tmp(gconfd_t, dir)
@@ -102,6 +202,171 @@ optional_policy(`
 ')
 
 ##############################
+#
+# Gnome-settings local policy
+#
+
+allow gnome_settings_t self:dir list_dir_perms;
+allow gnome_settings_t self:file rw_file_perms;
+allow gnome_settings_t self:process { fork sigchld };
+allow gnome_settings_t self:unix_stream_socket create_stream_socket_perms;
+
+allow gnome_settings_t dconf_home_t:dir manage_dir_perms;
+allow gnome_settings_t dconf_home_t:file manage_file_perms;
+allow gnome_settings_t dconf_home_t:lnk_file manage_lnk_file_perms;
+
+allow gnome_settings_t gnome_settings_schemas_t:dir list_dir_perms;
+allow gnome_settings_t gnome_settings_schemas_t:file read_file_perms;
+allow gnome_settings_t gnome_settings_schemas_t:lnk_file read_lnk_file_perms;
+
+allow gnome_settings_t gnome_settings_exec_t:file entrypoint;
+
+rw_fifo_files_pattern(gnome_settings_t, gnome_settings_t, gnome_settings_t)
+
+corecmd_exec_bin(gnome_settings_t)
+corecmd_search_bin(gnome_settings_t)
+
+dev_dontaudit_search_sysfs(gnome_settings_t)
+dev_list_all_dev_nodes(gnome_settings_t)
+dev_rw_null(gnome_settings_t)
+dev_search_sysfs(gnome_settings_t)
+
+files_list_root(gnome_settings_t)
+files_read_etc_files(gnome_settings_t)
+files_read_usr_files(gnome_settings_t)
+files_search_pids(gnome_settings_t)
+
+fs_getattr_xattr_fs(gnome_settings_t)
+
+init_sigchld(gnome_settings_t)
+
+kernel_read_system_state(gnome_settings_t)
+
+libs_use_ld_so(gnome_settings_t)
+libs_use_shared_libs(gnome_settings_t)
+
+miscfiles_read_localization(gnome_settings_t)
+
+selinux_getattr_fs(gnome_settings_t)
+selinux_dontaudit_search_fs(gnome_settings_t)
+
+### should create an xserver interface for writing .xsession-errors
+userdom_dontaudit_write_user_home_content_files(gnome_settings_t)
+
+# search in .cache
+userdom_search_user_home_dirs(gnome_settings_t)
+userdom_search_user_home_content(gnome_settings_t)
+
+optional_policy(`
+	dbus_read_lib_files(gnome_settings_t)
+')
+
+optional_policy(`
+	xserver_use_xdm_fds(gnome_settings_t)
+')
+
+##############################
+#
+# Gnome-settings-daemon local policy
+#
+
+allow gnome_settings_daemon_t self:dir list_dir_perms;
+allow gnome_settings_daemon_t self:file rw_file_perms;
+allow gnome_settings_daemon_t self:lnk_file read_lnk_file_perms;
+
+allow gnome_settings_daemon_t self:process { fork sigchld signal };
+allow gnome_settings_daemon_t self:unix_stream_socket create_stream_socket_perms;
+allow gnome_settings_daemon_t self:netlink_kobject_uevent_socket create_socket_perms;
+
+allow gnome_settings_daemon_t dconf_home_t:dir manage_dir_perms;
+allow gnome_settings_daemon_t dconf_home_t:file manage_file_perms;
+allow gnome_settings_daemon_t dconf_home_t:lnk_file manage_lnk_file_perms;
+
+allow gnome_settings_daemon_t gnome_settings_schemas_t:dir list_dir_perms;
+allow gnome_settings_daemon_t gnome_settings_schemas_t:file read_file_perms;
+allow gnome_settings_daemon_t gnome_settings_schemas_t:lnk_file read_lnk_file_perms;
+
+allow gnome_settings_daemon_t gnome_settings_daemon_exec_t:file { entrypoint exec_file_perms };
+
+rw_fifo_files_pattern(gnome_settings_daemon_t, gnome_settings_daemon_t, gnome_settings_daemon_t)
+
+read_files_pattern(gnome_settings_daemon_t, mime_info_t, mime_info_t)
+
+cups_read_config(gnome_settings_daemon_t)
+cups_stream_connect(gnome_settings_daemon_t)
+
+dev_dontaudit_search_sysfs(gnome_settings_daemon_t)
+dev_read_urand(gnome_settings_daemon_t)
+dev_read_sysfs(gnome_settings_daemon_t)
+dev_rw_null(gnome_settings_daemon_t)
+
+files_list_root(gnome_settings_daemon_t)
+files_list_tmp(gnome_settings_daemon_t)
+files_read_etc_files(gnome_settings_daemon_t)
+files_read_usr_files(gnome_settings_daemon_t)
+files_search_tmp(gnome_settings_daemon_t)
+
+fs_getattr_tmpfs(gnome_settings_daemon_t)
+fs_getattr_xattr_fs(gnome_settings_daemon_t)
+fs_list_tmpfs(gnome_settings_daemon_t)
+fs_rw_tmpfs_files(gnome_settings_daemon_t)
+
+init_sigchld(gnome_settings_daemon_t)
+
+kernel_read_system_state(gnome_settings_daemon_t)
+
+libs_use_ld_so(gnome_settings_daemon_t)
+libs_use_shared_libs(gnome_settings_daemon_t)
+
+logging_search_logs(gnome_settings_daemon_t)
+
+miscfiles_read_fonts(gnome_settings_daemon_t)
+miscfiles_read_generic_certs(gnome_settings_daemon_t)
+miscfiles_read_localization(gnome_settings_daemon_t)
+
+selinux_getattr_fs(gnome_settings_daemon_t)
+selinux_dontaudit_search_fs(gnome_settings_daemon_t)
+
+### should create an xserver interface for writing .xsession-errors
+userdom_dontaudit_write_user_home_content_files(gnome_settings_daemon_t)
+
+userdom_list_user_home_dirs(gnome_settings_daemon_t)
+userdom_list_user_tmp(gnome_settings_daemon_t)
+userdom_search_user_home_dirs(gnome_settings_daemon_t)
+userdom_search_user_home_content(gnome_settings_daemon_t)
+
+optional_policy(`
+	colord_dbus_chat(gnome_settings_daemon_t)
+	colord_manage_home_files(gnome_settings_daemon_t)
+')
+
+optional_policy(`
+	dbus_system_bus_client(gnome_settings_daemon_t)
+')
+
+optional_policy(`
+	devicekit_dbus_chat_power(gnome_settings_daemon_t)
+')
+
+optional_policy(`
+	policykit_dbus_chat(gnome_settings_daemon_t)
+	policykit_domtrans(gnome_settings_daemon_t)
+')
+
+optional_policy(`
+	pulseaudio_read_home(gnome_settings_daemon_t)
+	pulseaudio_rw_tmpfs_files(gnome_settings_daemon_t)
+	pulseaudio_signull(gnome_settings_daemon_t)
+	pulseaudio_stream_connect(gnome_settings_daemon_t)
+	pulseaudio_use_fds(gnome_settings_daemon_t)
+')
+
+optional_policy(`
+	xserver_read_user_xauth(gnome_settings_daemon_t)
+	xserver_stream_connect(gnome_settings_daemon_t)
+')
+
+##############################
 #
 # Keyring-daemon local policy
 #
policy/modules/contrib/policykit.fc +2 -0
@@ -1,3 +1,5 @@
+/usr/bin/pkexec		--	gen_context(system_u:object_r:policykit_exec_t,s0)
+
 /usr/lib/polkit-1/polkitd	--	gen_context(system_u:object_r:policykit_exec_t,s0)
 /usr/lib/polkit-1/polkit-agent-helper-1	--	gen_context(system_u:object_r:policykit_auth_exec_t,s0)
 
policy/modules/contrib/policykit.if +20 -0
@@ -44,6 +44,26 @@ interface(`policykit_dbus_chat_auth',`
 
 ########################################
 ## <summary>
+##	Execute a domain transition to
+##	run polkit.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+#
+interface(`policykit_domtrans',`
+	gen_require(`
+		type policykit_t, policykit_exec_t;
+	')
+
+	corecmd_search_bin($1)
+	domtrans_pattern($1, policykit_exec_t, policykit_t)
+')
+
+########################################
+## <summary>
 ##	Execute a domain transition to run polkit_auth.
 ## </summary>
 ## <param name="domain">
policy/modules/contrib/policykit.te +1 -0
@@ -117,6 +118,7 @@ optional_policy(`
 
 optional_policy(`
 	gnome_read_generic_home_content(policykit_t)
+	gnome_read_settings_daemon_files(policykit_t)
 ')
 
 optional_policy(`
policy/modules/contrib/pulseaudio.if +77 -0
@@ -347,3 +347,80 @@ interface(`pulseaudio_tmpfs_content',`
 
 	typeattribute $1 pulseaudio_tmpfsfile;
 ')
+
+#######################################
+## <summary>
+##	Read pulseaudio tmpfs files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`pulseaudio_read_tmpfs_files',`
+	gen_require(`
+		type pulseaudio_tmpfs_t;
+	')
+
+	fs_search_tmpfs($1)
+	read_files_pattern($1, pulseaudio_tmpfs_t, pulseaudio_tmpfs_t)
+')
+
+#######################################
+## <summary>
+##	Read and write pulseaudio tmpfs
+##	files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`pulseaudio_rw_tmpfs_files',`
+	gen_require(`
+		type pulseaudio_tmpfs_t;
+	')
+
+	fs_search_tmpfs($1)
+	rw_files_pattern($1, pulseaudio_tmpfs_t, pulseaudio_tmpfs_t)
+')
+
+########################################
+## <summary>
+##	Use file descriptors for
+##	pulseaudio.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`pulseaudio_use_fds',`
+	gen_require(`
+		type pulseaudio_t;
+	')
+
+	allow $1 pulseaudio_t:fd use;
+')
+
+########################################
+## <summary>
+##	Do not audit attempts to use the
+##	file descriptors for pulseaudio.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      Domain allowed access.
+##      </summary>
+## </param>
+#
+interface(`pulseaudio_dontaudit_use_fds',`
+	gen_require(`
+		type pulseaudio_t;
+	')
+
+	dontaudit $1 pulseaudio_t:fd use;
+')
policy/modules/contrib/pulseaudio.te +10 -0
@@ -193,6 +193,11 @@ optional_policy(`
 
 optional_policy(`
 	gnome_stream_connect_gconf(pulseaudio_t)
+
+	# OIL Runtime Compiler (ORC) optimized code execution
+	allow pulseaudio_t gstreamer_orcexec_t:file { manage_file_perms mmap_file_perms };
+	gnome_user_runtime_filetrans_gstreamer_orcexec(pulseaudio_t, file)
+	gnome_user_home_dir_filetrans_gstreamer_orcexec(pulseaudio_t, file)
 ')
 
 optional_policy(`--- refpolicy-git-06082016-orig/policy/modules/system/userdomain.if	2016-08-20 04:02:51.687901531 +0200
+++ refpolicy-git-06082016/policy/modules/system/userdomain.if	2016-08-19 23:44:30.690540547 +0200
@@ -593,6 +593,10 @@ template(`userdom_common_user_template',
 	')
 
 	optional_policy(`
+		colord_manage_home_files($1_t)
+	')
+
+	optional_policy(`
 		dbus_system_bus_client($1_t)
 
 		optional_policy(`

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160821/4d08999f/attachment-0001.bin 
#19 lore raw

PATCH v3 1/1 Update for the gnome policy and file contexts

Hello.

Quoted 29 lines · Dominick Grift via refpolicy
Quoted 28 lines · Guido Trentalancia via refpolicy

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the ? gnome-settings-daemon and the at-spi daemon with all the ? needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced ? to support the OIL Runtime Compiler (ORC) optimized code ? execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome ? keyring domains;
- add support for chat over dbus in the gconfd domain and in the ? new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home ? directories (such as the ICC EDID profiles): requires the ? recent colord patch;
- add support for for reading the colord related files in the home ? directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home ? directories;
- includes minor modifications to the consolekit, dbus and ? policykit modules to support the new targeted gnome daemons ? and applications;
- modifies the pulseaudio module to introduce new interfaces to ? read and write pulseaudio tmpfs files and to use the pulseaudio ? file descriptor.

Quoted 4 lines
Quoted 1 line

The support for Gnome2/ORBit-2 (version 2) has been dropped.

if you want me to review this then you have to split this patch into smaller patches

You already reviewed the initial patch. However this new version is much different from it, so you might want to review it again.

If you want, I can split it in separate patches, one for each module (colord, consolekit, dbus, gnome, policykit, pulseaudio and userdomain). However, they would be all interdependent, so I can't see much gain in doing that...

Is that all right for you ?

Regards,

Guido

#20 lore raw

PATCH v3 1/1 Update for the gnome policy and file contexts

Quoted 40 lines · Guido Trentalancia

Hello.

Quoted 29 lines · Dominick Grift via refpolicy
Quoted 28 lines · Guido Trentalancia via refpolicy

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the gnome-settings-daemon and the at-spi daemon with all the needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for chat over dbus in the gconfd domain and in the new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home directories (such as the ICC EDID profiles): requires the recent colord patch;
- add support for for reading the colord related files in the home directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home directories;
- includes minor modifications to the consolekit, dbus and policykit modules to support the new targeted gnome daemons and applications;
- modifies the pulseaudio module to introduce new interfaces to read and write pulseaudio tmpfs files and to use the pulseaudio file descriptor.

Quoted 4 lines
Quoted 1 line

The support for Gnome2/ORBit-2 (version 2) has been dropped.

if you want me to review this then you have to split this patch into smaller patches

You already reviewed the initial patch. However this new version is much different from it, so you might want to review it again.

Quoted 6 lines

If you want, I can split it in separate patches, one for each module (colord, consolekit, dbus, gnome, policykit, pulseaudio and userdomain). However, they would be all interdependent, so I can't see much gain in doing that...

Is that all right for you ?

I can't review this as-is. So if you want my feedback then you will have to find a way to split this into smaller but sensible patches.

Quoted 5 lines

Regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160821/74ce28f6/attachment.bin 
#21 lore raw

PATCH v3 1/1 Update for the gnome policy and file contexts

Quoted 56 lines · Dominick Grift
Quoted 55 lines · Guido Trentalancia

Hello.

Quoted 34 lines · Dominick Grift via refpolicy
Quoted 32 lines · Guido Trentalancia via refpolicy

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the ? gnome-settings-daemon and the at-spi daemon with all the ? needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced ? to support the OIL Runtime Compiler (ORC) optimized code ? execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome ? keyring domains;
- add support for chat over dbus in the gconfd domain and in the
? new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home ? directories (such as the ICC EDID profiles): requires the ? recent colord patch;
- add support for for reading the colord related files in the home
? directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home ? directories;
- includes minor modifications to the consolekit, dbus and ? policykit modules to support the new targeted gnome daemons ? and applications;
- modifies the pulseaudio module to introduce new interfaces to ? read and write pulseaudio tmpfs files and to use the pulseaudio
? file descriptor.

Quoted 5 lines
Quoted 1 line

The support for Gnome2/ORBit-2 (version 2) has been dropped.

if you want me to review this then you have to split this patch into
smaller patches

You already reviewed the initial patch. However this new version is much different from it, so you might want to review it again.

If you want, I can split it in separate patches, one for each module
(colord, consolekit, dbus, gnome, policykit, pulseaudio and userdomain). However, they would be all interdependent, so I can't see
much gain in doing that...

Quoted 5 lines
Quoted 1 line

Is that all right for you ?

I can't review this as-is. So if you want my feedback then you will have
to find a way to split this into smaller but sensible patches.

It can't be really split.

It doesn't matter, if you don't want or don't have time to review it...

Regards,

Guido

#22 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Guido Trentalancia

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the gnome-settings-daemon and the at-spi daemon with all the needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for chat over dbus in the gconfd domain and in the new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home directories (such as the ICC EDID profiles): requires the recent colord patch;
- add support for for reading the colord related files in the home directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home directories;
- includes minor modifications to the consolekit, dbus and policykit modules to support the new targeted gnome daemons and applications;
- modifies the pulseaudio module to introduce new interfaces to read and write pulseaudio tmpfs files and to use the pulseaudio file descriptor;
- provides better module encapsulation (i.e. dbus module).

The support for Gnome2/ORBit-2 (version 2) has been dropped.

This patch depends on the recent colord patch.

Recent changes to the pulseaudio module depends on this patch !

---
 policy/modules/contrib/colord.if     |   41 +++
 policy/modules/contrib/colord.te     |    4
 policy/modules/contrib/consolekit.te |    4
 policy/modules/contrib/dbus.if       |   22 +
 policy/modules/contrib/dbus.te       |    9
 policy/modules/contrib/gnome.fc      |   19 +
 policy/modules/contrib/gnome.if      |  418 ++++++++++++++++++++++++++++++++++-
 policy/modules/contrib/gnome.te      |  267 ++++++++++++++++++++++
 policy/modules/contrib/policykit.fc  |    2
 policy/modules/contrib/policykit.if  |   20 +
 policy/modules/contrib/policykit.te  |    1
 policy/modules/contrib/pulseaudio.if |   77 ++++++
 policy/modules/contrib/pulseaudio.te |    5
 policy/modules/system/userdomain.if  |    4
 14 files changed, 890 insertions(+), 3 deletions(-)
policy/modules/contrib/colord.if +41 -0
@@ -58,3 +58,44 @@ interface(`colord_read_lib_files',`
 	files_search_var_lib($1)
 	read_files_pattern($1, colord_var_lib_t, colord_var_lib_t)
 ')
+
+######################################
+## <summary>
+##	Read colord home files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`colord_read_home_files',`
+	gen_require(`
+		type colord_home_t;
+	')
+
+	userdom_search_user_home_dirs($1)
+	userdom_list_user_home_content($1)
+	read_files_pattern($1, colord_home_t, colord_home_t)
+')
+
+######################################
+## <summary>
+##	Create, read, write, and delete
+##	colord home content.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`colord_manage_home_files',`
+	gen_require(`
+		type colord_home_t;
+	')
+
+	userdom_search_user_home_dirs($1)
+	userdom_list_user_home_content($1)
+	manage_files_pattern($1, colord_home_t, colord_home_t)
+')
policy/modules/contrib/colord.te +4 -0
@@ -123,6 +136,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	gnome_settings_daemon_use_fds(colord_t)
+')
+
+optional_policy(`
 	policykit_dbus_chat(colord_t)
 	policykit_domtrans_auth(colord_t)
 	policykit_read_lib(colord_t)--- refpolicy-git-06082016-orig/policy/modules/contrib/consolekit.te	2016-08-07 23:05:57.060018494 +0200

+++ refpolicy-git-06082016/policy/modules/contrib/consolekit.te 2016-08-19 22:13:01.508709501 +0200
@@ -104,6 +101,10 @@ tunable_policy(use_samba_home_dirs',
')

optional_policy(`
+ gnome_read_settings_daemon_files(consolekit_t)
+')
+
+optional_policy(`
dbus_read_lib_files(consolekit_t) dbus_system_domain(consolekit_t, consolekit_exec_t)

policy/modules/contrib/dbus.if +22 -0
@@ -626,3 +626,25 @@ interface(`dbus_unconfined',`
 
 	typeattribute $1 dbusd_unconfined;
 ')
+
+########################################
+## <summary>
+##	Make a domain transition from a
+##	given source domain to another
+##	specified target domain using
+##	the DBUS executable file type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Source domain.
+##	</summary>
+## </param>
+#
+interface(`dbus_domain_transition',`
+	gen_require(`
+		type dbusd_exec_t;
+	')
+
+	allow $1 dbusd_exec_t:file { entrypoint exec_file_perms };
+	domtrans_pattern($1, dbusd_exec_t, $2)
+')--- refpolicy-git-06082016-orig/policy/modules/contrib/dbus.te	2016-08-06 21:27:11.344094223 +0200

+++ refpolicy-git-06082016/policy/modules/contrib/dbus.te 2016-08-20 00:27:48.730380843 +0200
@@ -148,6 +148,15 @@ optional_policy(`
')

optional_policy(`
+ colord_read_home_files(system_dbusd_t)
+')
+
+optional_policy(`
+ gnome_read_settings_daemon_files(system_dbusd_t)
+ gnome_settings_daemon_use_fds(system_dbusd_t)
+')
+
+optional_policy(`
policykit_read_lib(system_dbusd_t)
')

policy/modules/contrib/gnome.fc +18 -1
@@ -1,16 +1,33 @@
+HOME_DIR/\.cache/dconf(/.*)?		gen_context(system_u:object_r:dconf_home_t,s0)
+HOME_DIR/\.cache/keyring[^/]+(/.*)?	gen_context(system_u:object_r:gnome_keyring_cache_home_t,s0)
+HOME_DIR/\.config/dconf(/.*)?		gen_context(system_u:object_r:dconf_home_t,s0)
 HOME_DIR/\.gconf(/.*)?	gen_context(system_u:object_r:gconf_home_t,s0)
 HOME_DIR/\.gconfd(/.*)?	gen_context(system_u:object_r:gconf_home_t,s0)
 HOME_DIR/\.gnome(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
 HOME_DIR/\.gnome2/keyrings(/.*)?	gen_context(system_u:object_r:gnome_keyring_home_t,s0)
 HOME_DIR/\.gnome2_private(/.*)?	gen_context(system_u:object_r:gnome_home_t,s0)
+HOME_DIR/\.local/share/mime(/.*)?	gen_context(system_u:object_r:mime_info_t,s0)
+
+HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 
 /etc/gconf(/.*)?	gen_context(system_u:object_r:gconf_etc_t,s0)
 
 /tmp/gconfd-USER/.*	--	gen_context(system_u:object_r:gconf_tmp_t,s0)
 
 /usr/bin/gnome-keyring-daemon	--	gen_context(system_u:object_r:gkeyringd_exec_t,s0)
+/usr/bin/gsettings		--	gen_context(system_u:object_r:gnome_settings_exec_t,s0)
 /usr/bin/mate-keyring-daemon	--	gen_context(system_u:object_r:gkeyringd_exec_t,s0)
 
 /usr/lib/[^/]*/gconf/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
-/usr/libexec/gconfd-2	--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+
+/usr/libexec/at-spi-bus-launcher	--	gen_context(system_u:object_r:at_spi_exec_t,s0)
+/usr/libexec/dconf-service	--	gen_context(system_u:object_r:dconf_exec_t,s0)
+/usr/libexec/gconfd-2		--	gen_context(system_u:object_r:gconfd_exec_t,s0)
+/usr/libexec/gnome-settings-daemon	--	gen_context(system_u:object_r:gnome_settings_daemon_exec_t,s0)
+/usr/libexec/gsd-[^/]*		--	gen_context(system_u:object_r:gnome_settings_daemon_exec_t,s0)
+
+/usr/share/glib-[^/]*/schemas(/.*)?	gen_context(system_u:object_r:gnome_settings_schemas_t,s0)
+
+/var/run/user/[^/]*/orcexec\..*		--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
+/var/run/user/%{USERID}/orcexec\..*	--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
policy/modules/contrib/gnome.if +417 -1

493 lines not on this page · raw message

policy/modules/contrib/gnome.te +266 -1

307 lines not on this page · raw message

+++ refpolicy-git-06082016/policy/modules/contrib/policykit.fc 2016-08-20 01:03:29.139150710 +0200
@@ -1,3 +1,5 @@
+/usr/bin/pkexec -- gen_context(system_u:object_r:policykit_exec_t,s0)
+
/usr/lib/polkit-1/polkitd -- gen_context(system_u:object_r:policykit_exec_t,s0)
/usr/lib/polkit-1/polkit-agent-helper-1 -- gen_context(system_u:object_r:policykit_auth_exec_t,s0)

policy/modules/contrib/policykit.if +20 -0
@@ -44,6 +44,26 @@ interface(`policykit_dbus_chat_auth',`
 
 ########################################
 ## <summary>
+##	Execute a domain transition to
+##	run polkit.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+#
+interface(`policykit_domtrans',`
+	gen_require(`
+		type policykit_t, policykit_exec_t;
+	')
+
+	corecmd_search_bin($1)
+	domtrans_pattern($1, policykit_exec_t, policykit_t)
+')
+
+########################################
+## <summary>
 ##	Execute a domain transition to run polkit_auth.
 ## </summary>
 ## <param name="domain">
policy/modules/contrib/policykit.te +1 -0
@@ -117,6 +118,7 @@ optional_policy(`
 
 optional_policy(`
 	gnome_read_generic_home_content(policykit_t)
+	gnome_read_settings_daemon_files(policykit_t)
 ')
 
 optional_policy(`
policy/modules/contrib/pulseaudio.if +77 -0

80 lines not on this page · raw message

policy/modules/contrib/pulseaudio.te +5 -0
@@ -193,6 +193,11 @@ optional_policy(`
 
 optional_policy(`
 	gnome_stream_connect_gconf(pulseaudio_t)
+
+	# OIL Runtime Compiler (ORC) optimized code execution
+	allow pulseaudio_t gstreamer_orcexec_t:file { manage_file_perms mmap_file_perms };
+	gnome_user_runtime_filetrans_gstreamer_orcexec(pulseaudio_t, file)
+	gnome_user_home_dir_filetrans_gstreamer_orcexec(pulseaudio_t, file)
 ')
 
 optional_policy(`--- refpolicy-git-06082016-orig/policy/modules/system/userdomain.if	2016-08-20 04:02:51.687901531 +0200

+++ refpolicy-git-06082016/policy/modules/system/userdomain.if 2016-08-19 23:44:30.690540547 +0200
@@ -593,6 +593,10 @@ template(`userdom_common_user_template',
')

optional_policy(`
+ colord_manage_home_files($1_t)
+ ')
+
+ optional_policy(`
dbus_system_bus_client($1_t)

optional_policy(`

#23 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 28 lines · Guido Trentalancia

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the gnome-settings-daemon and the at-spi daemon with all the needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for chat over dbus in the gconfd domain and in the new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home directories (such as the ICC EDID profiles): requires the recent colord patch;
- add support for for reading the colord related files in the home directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home directories;
- includes minor modifications to the consolekit, dbus and policykit modules to support the new targeted gnome daemons and applications;
- modifies the pulseaudio module to introduce new interfaces to read and write pulseaudio tmpfs files and to use the pulseaudio file descriptor;
- provides better module encapsulation (i.e. dbus module).

Quoted 5 lines

The support for Gnome2/ORBit-2 (version 2) has been dropped.

This patch depends on the recent colord patch.

Recent changes to the pulseaudio module depends on this patch !

Unfortunately, as Dominick pointed out, you've gone to the other end of the patch organization spectrum and made too large of a patch. If you split it up into individual commits, git format-patch and git send-email will make it easy to send a series of patches in commit order. So all you have to do is create reasonably-sized and logically-organized commits.

I did not review everything, but here are a few things I noticed:

Quoted 4 lines
policy/modules/contrib/dbus.if +4 -0
+########################################
+## <summary>
+##	Make a domain transition from a
+##	given source domain to another

policy/modules/contrib/dbus.if interface(`dbus_unconfined',` · line 643

Quoted 10 lines
policy/modules/contrib/dbus.if +10 -0
+##	specified target domain using
+##	the DBUS executable file type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Source domain.
+##	</summary>
+## </param>
+#
+interface(`dbus_domain_transition',`

I'm not clear why this is necessary.

policy/modules/contrib/dbus.if interface(`dbus_unconfined',` · line 648

Quoted 5 lines
policy/modules/contrib/dbus.if +5 -0
+	gen_require(`
+		type dbusd_exec_t;
+	')
+
+	allow $1 dbusd_exec_t:file { entrypoint exec_file_perms };

Entrypoint should not be included here.

Quoted 5 lines
policy/modules/contrib/dbus.if +1 -0
+	domtrans_pattern($1, dbusd_exec_t, $2)

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 50

Quoted 9 lines
policy/modules/contrib/gnome.if +4 -1
@@ -43,14 +43,39 @@ interface(`gnome_role',`
 template(`gnome_role_template',`
 	gen_require(`
 		attribute gnomedomain, gkeyringd_domain;
+		attribute_role dconf_roles;
+		attribute_role at_spi_roles;
 		attribute_role gconfd_roles;
-		type gkeyringd_exec_t, gnome_keyring_home_t, gnome_keyring_tmp_t;
+		attribute_role gnome_settings_roles;
+		attribute_role gnome_settings_daemon_roles;

Are all of these role attributes really necessary? Typically these are only needed when there are long chains of transitions where the original domain doesn't have any relation to latter domains. For example:

user_t -> domain1_t -> domain2_t

In this case, there is no link in the sources between user_t and domain2_t, but domain2_t needs to be allowed user_r. Domain1_t's interfaces can collect up all the roles that run domain1 in a role attribute, and then use that attribute when running domain2.

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 10 lines
policy/modules/contrib/gnome.if +8 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t, gnome_settings_daemon_exec_t;
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t, gnome_keyring_cache_home_t, gnome_keyring_tmp_t;
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

policy/modules/contrib/gnome.if template(`gnome_role_template',` · line 251

Quoted 4 lines
policy/modules/contrib/gnome.if +3 -0
 	optional_policy(`
+		dbus_connect_spec_session_bus(user, dconf_t)
+		dbus_connect_spec_session_bus(user, at_spi_t)
+		dbus_connect_spec_session_bus(user, gnome_settings_daemon_t)

Prefixes can't be hardcoded like this.

Quoted 7 lines
policy/modules/contrib/gnome.if +6 -0
+		dbus_connect_system_bus(gnome_settings_daemon_t)
+		dbus_domain_transition(at_spi_t, user_dbusd_t)
+		dbus_domain_transition(gnome_settings_t, user_dbusd_t)
+		dbus_send_spec_session_bus(user, dconf_t)
+		dbus_send_spec_session_bus(user, at_spi_t)
+		dbus_send_spec_session_bus(user, gnome_settings_daemon_t)
 		dbus_spec_session_domain($1, $1_gkeyringd_t, gkeyringd_exec_t)
Signature · 1 line
Chris PeBenito
#24 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 51 lines · Chris PeBenito
Quoted 29 lines · Guido Trentalancia

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the ? gnome-settings-daemon and the at-spi daemon with all the ? needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced ? to support the OIL Runtime Compiler (ORC) optimized code ? execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome ? keyring domains;
- add support for chat over dbus in the gconfd domain and in the ? new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home ? directories (such as the ICC EDID profiles): requires the ? recent colord patch;
- add support for for reading the colord related files in the home ? directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home ? directories;
- includes minor modifications to the consolekit, dbus and ? policykit modules to support the new targeted gnome daemons ? and applications;
- modifies the pulseaudio module to introduce new interfaces to ? read and write pulseaudio tmpfs files and to use the pulseaudio ? file descriptor;
- provides better module encapsulation (i.e. dbus module).

Quoted 5 lines

The support for Gnome2/ORBit-2 (version 2) has been dropped.

This patch depends on the recent colord patch.

Recent changes to the pulseaudio module depends on this patch !

Unfortunately, as Dominick pointed out, you've gone to the other end of?
the patch organization spectrum and made too large of a patch.??If you?
split it up into individual commits, git format-patch and git send- email?
will make it easy to send a series of patches in commit order.??So all?
you have to do is create reasonably-sized and logically-organized commits.

I did not review everything, but here are a few things I noticed:

Quoted 1 line
Quoted 16 lines
Quoted 4 lines
policy/modules/contrib/dbus.if +4 -0
+########################################
+## <summary>
+##	Make a domain transition from a
+##	given source domain to another

policy/modules/contrib/dbus.if interface(`dbus_unconfined',` · line 643

Quoted 10 lines
policy/modules/contrib/dbus.if +10 -0
+##	specified target domain using
+##	the DBUS executable file type.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Source domain.
+##	</summary>
+## </param>
+#
+interface(`dbus_domain_transition',`

I'm not clear why this is necessary.

To encapsulate dbus related types in their own module (i.e. the dbus module).

Quoted 7 lines

policy/modules/contrib/dbus.if interface(`dbus_unconfined',` · line 648

Quoted 5 lines
policy/modules/contrib/dbus.if +5 -0
+	gen_require(`
+		type dbusd_exec_t;
+	')
+
+	allow $1 dbusd_exec_t:file { entrypoint exec_file_perms };

Entrypoint should not be included here.

I will check if this does not break the transition...

Quoted 25 lines
Quoted 16 lines
(quoted diff) +1 -1
+	domtrans_pattern($1, dbusd_exec_t, $2)
 
 
--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.if	
2016-08-06 21:27:11.354094337 +0200

+++ refpolicy-git-06082016/policy/modules/contrib/gnome.if 2
016-08-22 21:24:49.634876147 +0200

(quoted diff) +0 -0
@@ -43,14 +43,39 @@ interface(`gnome_role',`

?template(gnome_role_template',
? gen_require(`
? attribute gnomedomain, gkeyringd_domain;

(quoted diff) +2 -0
+		attribute_role dconf_roles;
+		attribute_role at_spi_roles;

? attribute_role gconfd_roles;

(quoted diff) +0 -1
-		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_tmp_t;

Review

Quoted 2 lines
(quoted diff) +2 -0
+		attribute_role gnome_settings_roles;
+		attribute_role gnome_settings_daemon_roles;

Are all of these role attributes really necessary???Typically these are?
only needed when there are long chains of transitions where the original?
domain doesn't have any relation to latter domains.??For example:

Quoted 6 lines

user_t ->??domain1_t -> domain2_t

In this case, there is no link in the sources between user_t and? domain2_t, but domain2_t needs to be allowed user_r.??Domain1_t's? interfaces can collect up all the roles that run domain1 in a role? attribute, and then use that attribute when running domain2.

I will remove the roles which are not needed.

Quoted 15 lines

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 13 lines
policy/modules/contrib/gnome.if +2 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;

? type gconfd_t, gconfd_exec_t, gconf_tmp_t;
? type gconf_home_t;

(quoted diff) +2 -0
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

policy/modules/contrib/gnome.if +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

If $1_dbusd_t is used to get the role/type prefix from the caller, then it doesn't compile for some reason which is not yet clear to me.

Any idea ?

Quoted 8 lines
Quoted 6 lines

? optional_policy(`

policy/modules/contrib/gnome.if +3 -0
+		dbus_connect_spec_session_bus(user, dconf_t)
+		dbus_connect_spec_session_bus(user, at_spi_t)
+		dbus_connect_spec_session_bus(user,

gnome_settings_daemon_t)

Prefixes can't be hardcoded like this.

See above.

Quoted 11 lines
Quoted 11 lines
policy/modules/contrib/gnome.if +3 -0
+		dbus_connect_system_bus(gnome_settings_daemon_t)
+		dbus_domain_transition(at_spi_t, user_dbusd_t)
+		dbus_domain_transition(gnome_settings_t,

user_dbusd_t)

policy/modules/contrib/gnome.if +3 -0
+		dbus_send_spec_session_bus(user, dconf_t)
+		dbus_send_spec_session_bus(user, at_spi_t)
+		dbus_send_spec_session_bus(user,

gnome_settings_daemon_t)
? dbus_spec_session_domain($1, $1_gkeyringd_t,
gkeyringd_exec_t)

Best regards,

Guido

#25 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 43 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 38 lines · Chris PeBenito
Quoted 36 lines · Guido Trentalancia

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the ? gnome-settings-daemon and the at-spi daemon with all the ? needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced ? to support the OIL Runtime Compiler (ORC) optimized code ? execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome ? keyring domains;
- add support for chat over dbus in the gconfd domain and in the ? new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home ? directories (such as the ICC EDID profiles): requires the ? recent colord patch;
- add support for for reading the colord related files in the home
? directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home ? directories;
- includes minor modifications to the consolekit, dbus and ? policykit modules to support the new targeted gnome daemons ? and applications;
- modifies the pulseaudio module to introduce new interfaces to ? read and write pulseaudio tmpfs files and to use the pulseaudio ? file descriptor;
- provides better module encapsulation (i.e. dbus module).

The support for Gnome2/ORBit-2 (version 2) has been dropped.

This patch depends on the recent colord patch.

Recent changes to the pulseaudio module depends on this patch !

[...]

Quoted 23 lines
Quoted 23 lines
Quoted 14 lines

--- refpolicy-git-06082016-orig/policy/modules/contrib/gnome.if

2016-08-06 21:27:11.354094337 +0200

+++ refpolicy-git-06082016/policy/modules/contrib/gnome.if 2
016-08-22 21:24:49.634876147 +0200

(quoted diff) +0 -0
@@ -43,14 +43,39 @@ interface(`gnome_role',`

?template(gnome_role_template',
? gen_require(`
? attribute gnomedomain, gkeyringd_domain;

(quoted diff) +2 -0
+		attribute_role dconf_roles;
+		attribute_role at_spi_roles;

? attribute_role gconfd_roles;

(quoted diff) +0 -1
-		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_tmp_t;

Review

Quoted 2 lines
(quoted diff) +2 -0
+		attribute_role gnome_settings_roles;
+		attribute_role gnome_settings_daemon_roles;

Are all of these role attributes really necessary???Typically these are?
only needed when there are long chains of transitions where the original?
domain doesn't have any relation to latter domains.??For example:

Quoted 8 lines
Quoted 6 lines

user_t ->??domain1_t -> domain2_t

In this case, there is no link in the sources between user_t and? domain2_t, but domain2_t needs to be allowed user_r.??Domain1_t's? interfaces can collect up all the roles that run domain1 in a role? attribute, and then use that attribute when running domain2.

I will remove the roles which are not needed.

I have tested the above and the conclusion is that only the dconf attribute can be removed without breaking the functionality.

Regards,

Guido

#26 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Guido Trentalancia
Quoted 22 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 16 lines · Chris PeBenito

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 13 lines · Guido Trentalancia
policy/modules/contrib/gnome.if +4 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

policy/modules/contrib/gnome.if +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

Quoted 4 lines

If $1_dbusd_t is used to get the role/type prefix from the caller, then it doesn't compile for some reason which is not yet clear to me.

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the gnome module. Beyond that, it's tough to say what the problem is, without knowing the error messages.

Signature · 1 line
Chris PeBenito
#27 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

The error is: "Conflicting type rules".

Unfortunately, the cil temporary file is destroyed before make gives the shell prompt back, so it is not possible to inspect the location of the problem.

Guido

Quoted 32 lines · Chris PeBenito
Quoted 22 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 16 lines · Chris PeBenito

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 13 lines · Guido Trentalancia
policy/modules/contrib/gnome.if +4 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

policy/modules/contrib/gnome.if +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

Quoted 1 line

If $1_dbusd_t is used to get the role/type prefix from the caller,

then

Quoted 3 lines

it doesn't compile for some reason which is not yet clear to me.

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the gnome module. Beyond that, it's tough to say what the problem is, without knowing the error messages.

#28 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Chris PeBenito

Hello Christopher.

I have more detailed information about this problem...

Quoted 30 lines · Chris PeBenito
Quoted 29 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 4 lines · Chris PeBenito
Quoted 2 lines · Guido Trentalancia
Quoted 14 lines

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 12 lines
policy/modules/contrib/gnome.if +2 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;

? type gconfd_t, gconfd_exec_t, gconf_tmp_t;
? type gconf_home_t;

(quoted diff) +2 -0
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

policy/modules/contrib/gnome.if +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

If $1_dbusd_t is used to get the role/type prefix from the caller, then
it doesn't compile for some reason which is not yet clear to me.

Quoted 6 lines
Quoted 1 line

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the?
gnome module.??Beyond that, it's tough to say what the problem is,? without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>

##      Make a domain transition from a
##      given source domain to the
##      DBUS session bus domain using
##      the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##      <summary>
##      The prefix of the user role (e.g., user
##      is the prefix for user_r).
##      </summary>
## </param>
## <param name="domain">
##      <summary>
##      Domain allowed access.
##      </summary>
## </param>
#
interface(`dbus_domain_transition_session_bus',`
        gen_require(`
                type dbusd_exec_t;
                type $1_dbusd_t;
        ')

        allow $2 dbusd_exec_t:file exec_file_perms;
        domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t)

')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary
/usr/sbin/semodule: Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

I hope it is clear now...

Do you have an idea ? It's the only thing missing before all the dbus rules are moved from the gnome to the dbus module and I can create a new version of this important patch.

Regards,

Guido

#29 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 87 lines · Guido Trentalancia

Hello Christopher.

I have more detailed information about this problem...

Quoted 30 lines · Chris PeBenito
Quoted 29 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 4 lines · Chris PeBenito
Quoted 2 lines · Guido Trentalancia
Quoted 14 lines

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 12 lines
policy/modules/contrib/gnome.if +4 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

policy/modules/contrib/gnome.if +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

If $1_dbusd_t is used to get the role/type prefix from the caller, then
it doesn't compile for some reason which is not yet clear to me.

Quoted 6 lines
Quoted 1 line

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the
gnome module. Beyond that, it's tough to say what the problem is, without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>

##      Make a domain transition from a
##      given source domain to the
##      DBUS session bus domain using
##      the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##      <summary>
##      The prefix of the user role (e.g., user
##      is the prefix for user_r).
##      </summary>
## </param>
## <param name="domain">
##      <summary>
##      Domain allowed access.
##      </summary>
## </param>
#
interface(`dbus_domain_transition_session_bus',`
        gen_require(`
                type dbusd_exec_t;
                type $1_dbusd_t;
        ')

        allow $2 dbusd_exec_t:file exec_file_perms;
        domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t)

')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary
/usr/sbin/semodule: Failed!
make: *** [Rules.modular:58: load] Error 1

Quoted 7 lines

The temporary file is deleted automatically and cannot be inspected.

I hope it is clear now...

Do you have an idea ? It's the only thing missing before all the dbus rules are moved from the gnome to the dbus module and I can create a new version of this important patch.

It's not so helpful unfortunately. My guess is that it is a conflicting type_transition. Unfortunately the compiler error message isn't helpful.

Signature · 1 line
Chris PeBenito
#30 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

It works fine in the latest version of this patch (from within the gnome module)!!

So, why does it stop working when I create a dbus interface and call it from the gnome module?

I am stuck with this unfortunately...

How about the other missing patch for the "module_load" permission in the kernel and files modules? Have you found an alternative name for that interface?

The patch for the kernel is waiting to get committed, along with the testcase and a small Makefile patch for the testsuite.

I have also posted here a patch for the Reference Policy Makefile so that it integrates better with the SELinux testsuite (which at the moment works out of the box only on Red Hat).

Best regards,

Guido

Quoted 101 lines · Chris PeBenito
Quoted 75 lines · Guido Trentalancia

Hello Christopher.

I have more detailed information about this problem...

Quoted 30 lines · Chris PeBenito
Quoted 29 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 4 lines · Chris PeBenito
Quoted 2 lines · Guido Trentalancia
Quoted 14 lines

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 12 lines
policy/modules/contrib/gnome.if +4 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

policy/modules/contrib/gnome.if +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

If $1_dbusd_t is used to get the role/type prefix from the caller, then
it doesn't compile for some reason which is not yet clear to me.

Quoted 6 lines
Quoted 1 line

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the
gnome module. Beyond that, it's tough to say what the problem is, without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>

##      Make a domain transition from a
##      given source domain to the
##      DBUS session bus domain using
##      the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##      <summary>
##      The prefix of the user role (e.g., user
##      is the prefix for user_r).
##      </summary>
## </param>
## <param name="domain">
##      <summary>
##      Domain allowed access.
##      </summary>
## </param>
#
interface(`dbus_domain_transition_session_bus',`
        gen_require(`
                type dbusd_exec_t;
                type $1_dbusd_t;
        ')

        allow $2 dbusd_exec_t:file exec_file_perms;
        domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t)

')

and suppose that it is called by the following statement:

Quoted 8 lines

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of

/var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil

Quoted 11 lines

Failed to generate binary
/usr/sbin/semodule: Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

I hope it is clear now...

Do you have an idea ? It's the only thing missing before all the dbus rules are moved from the gnome to the dbus module and I can create a new version of this important patch.

It's not so helpful unfortunately. My guess is that it is a conflicting
type_transition. Unfortunately the compiler error message isn't helpful.

#31 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 6 lines · Guido Trentalancia via refpolicy

It works fine in the latest version of this patch (from within the gnome module)!!

So, why does it stop working when I create a dbus interface and call it from the gnome module?

I am stuck with this unfortunately...

I have been there before. I have attempted to confined desktops for years. Facing all kinds of limitations of the reference policy. I am not saying that the issue you are facing is related to limitations to the refpolicy, because I do not know for sure. What I do feel i know is that confining complex desktops with reference policy is difficult if not impossible.

The CIL policy was designed to deal with complex requirements. My DSSP policy demonstrates that with CIL , complex desktops can be confined.

Besides the techinical issues there is also the issue of design with confining complex desktops. There are many patterns that become visible later in the process. Causing one to have to refactor the policy. I already see things in your patch where I personally would have done things differently taking into account the bigger picture.

Basically a good approach would be to first confine the desktop fully. then look at that from a distance, and then write it again with in mind all the things you've learned.

Quoted 118 lines

How about the other missing patch for the "module_load" permission in the kernel and files modules? Have you found an alternative name for that interface?

The patch for the kernel is waiting to get committed, along with the testcase and a small Makefile patch for the testsuite.

I have also posted here a patch for the Reference Policy Makefile so that it integrates better with the SELinux testsuite (which at the moment works out of the box only on Red Hat).

Best regards,

Guido

Quoted 93 lines · Chris PeBenito
Quoted 75 lines · Guido Trentalancia

Hello Christopher.

I have more detailed information about this problem...

Quoted 30 lines · Chris PeBenito
Quoted 29 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 4 lines · Chris PeBenito
Quoted 2 lines · Guido Trentalancia
Quoted 14 lines

Review

Quoted 12 lines
(quoted diff) +4 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

(quoted diff) +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

If $1_dbusd_t is used to get the role/type prefix from the caller, then
it doesn't compile for some reason which is not yet clear to me.

Quoted 6 lines
Quoted 1 line

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the
gnome module. Beyond that, it's tough to say what the problem is, without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>

##      Make a domain transition from a
##      given source domain to the
##      DBUS session bus domain using
##      the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##      <summary>
##      The prefix of the user role (e.g., user
##      is the prefix for user_r).
##      </summary>
## </param>
## <param name="domain">
##      <summary>
##      Domain allowed access.
##      </summary>
## </param>
#
interface(`dbus_domain_transition_session_bus',`
        gen_require(`
                type dbusd_exec_t;
                type $1_dbusd_t;
        ')

        allow $2 dbusd_exec_t:file exec_file_perms;
        domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t)

')

and suppose that it is called by the following statement:

Quoted 8 lines

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of

/var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil

Quoted 8 lines

Failed to generate binary
/usr/sbin/semodule: Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

I hope it is clear now...

Quoted 8 lines
Quoted 3 lines

Do you have an idea ? It's the only thing missing before all the dbus rules are moved from the gnome to the dbus module and I can create a new version of this important patch.

It's not so helpful unfortunately. My guess is that it is a conflicting
type_transition. Unfortunately the compiler error message isn't helpful.

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160825/7c684dac/attachment.bin 
#32 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Chris PeBenito

Hello Christopher.

I have more information on this problem.

Quoted 110 lines · Chris PeBenito
Quoted 101 lines · Guido Trentalancia

Hello Christopher.

I have more detailed information about this problem...

Quoted 38 lines · Chris PeBenito
Quoted 36 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 6 lines · Chris PeBenito
Quoted 3 lines · Guido Trentalancia
Quoted 16 lines
Quoted 12 lines
policy/modules/contrib/gnome.if +2 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;

? type gconfd_t, gconfd_exec_t, gconf_tmp_t;
? type gconf_home_t;

(quoted diff) +1 -0
+		type gnome_settings_t,

gnome_settings_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t,

gnome_keyring_home_t,
gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 2 lines
policy/modules/contrib/gnome.if +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

If $1_dbusd_t is used to get the role/type prefix from the caller,
then
it doesn't compile for some reason which is not yet clear to me.

Quoted 7 lines
Quoted 1 line

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the
gnome module.??Beyond that, it's tough to say what the problem is,
without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>
##??????Make a domain transition from a
##??????given source domain to the
##??????DBUS session bus domain using
##??????the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##??????<summary>
##??????The prefix of the user role (e.g., user
##??????is the prefix for user_r).
##??????</summary>
## </param>
## <param name="domain">
##??????<summary>
##??????Domain allowed access.
##??????</summary>
## </param>
#
interface(dbus_domain_transition_session_bus',
????????gen_require(`
????????????????type dbusd_exec_t;
????????????????type $1_dbusd_t;
????????')

????????allow $2 dbusd_exec_t:file exec_file_perms; ????????domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t) ')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary /usr/sbin/semodule:??Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

Quoted 7 lines

I hope it is clear now...

Do you have an idea ? It's the only thing missing before all the dbus
rules are moved from the gnome to the dbus module and I can create a
new version of this important patch.

Quoted 4 lines

It's not so helpful unfortunately.??My guess is that it is a conflicting?
type_transition.??Unfortunately the compiler error message isn't helpful.

I have tested and your guess is correct !

The above interface expands as follows:

interface(dbus_domain_transition_session_bus',

        allow $1_dbusd_t dbusd_exec_t:file exec_file_perms;

        domain_transition_pattern($2,dbusd_exec_t,$1_dbusd_t)

# type_transition $2 dbusd_exec_t:process $1_dbusd_t;

        allow $1_dbusd_t $2:fd use;
        allow $1_dbusd_t $2:fifo_file rw_fifo_file_perms;
        allow $1_dbusd_t $2:process sigchld;

')

The line that has been commented out (type_transition) is the problematic rule which leads to the "conflicting type rules" error upon loading the policy.

Such rule comes from the domain_auto_transition_pattern provided by support/misc_patterns.spt.

However, if I hardcode "user" instead of "$1", the type_transition works fine. I suspect, it stops functioning when $1 is replaced by "sysadm" or "staff".

If I do manually substitute the two and try to recompile, the following happens:

$1=sysadm ==> staff.te doesn't compile (unknown type error)

$1=staff ==> sysadm.te doesn't compile (unknown type error)

In some way, it sounds like a bug or some sort of limitation of the actual policy... Can you shed some light ?

Best regards,

Guido

#33 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 149 lines · Guido Trentalancia

Hello Christopher.

I have more information on this problem.

Quoted 110 lines · Chris PeBenito
Quoted 101 lines · Guido Trentalancia

Hello Christopher.

I have more detailed information about this problem...

Quoted 38 lines · Chris PeBenito
Quoted 36 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 6 lines · Chris PeBenito
Quoted 3 lines · Guido Trentalancia
Quoted 16 lines
Quoted 12 lines
(quoted diff) +3 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
+		type gnome_settings_t,

gnome_settings_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t,

gnome_keyring_home_t,
gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

Review

Quoted 2 lines
(quoted diff) +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

If $1_dbusd_t is used to get the role/type prefix from the caller,
then
it doesn't compile for some reason which is not yet clear to me.

Quoted 7 lines
Quoted 1 line

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the
gnome module. Beyond that, it's tough to say what the problem is,
without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>

##      Make a domain transition from a
##      given source domain to the
##      DBUS session bus domain using
##      the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##      <summary>
##      The prefix of the user role (e.g., user
##      is the prefix for user_r).
##      </summary>
## </param>
## <param name="domain">
##      <summary>
##      Domain allowed access.
##      </summary>
## </param>
#
interface(`dbus_domain_transition_session_bus',`
        gen_require(`
                type dbusd_exec_t;
                type $1_dbusd_t;
        ')

        allow $2 dbusd_exec_t:file exec_file_perms;
        domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t)

')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary
/usr/sbin/semodule: Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

Quoted 7 lines

I hope it is clear now...

Do you have an idea ? It's the only thing missing before all the dbus
rules are moved from the gnome to the dbus module and I can create a
new version of this important patch.

Quoted 4 lines

It's not so helpful unfortunately. My guess is that it is a conflicting
type_transition. Unfortunately the compiler error message isn't helpful.

I have tested and your guess is correct !

The above interface expands as follows:

interface(dbus_domain_transition_session_bus',

        allow $1_dbusd_t dbusd_exec_t:file exec_file_perms;

        domain_transition_pattern($2,dbusd_exec_t,$1_dbusd_t)

# type_transition $2 dbusd_exec_t:process $1_dbusd_t;

        allow $1_dbusd_t $2:fd use;
        allow $1_dbusd_t $2:fifo_file rw_fifo_file_perms;
        allow $1_dbusd_t $2:process sigchld;

')

The line that has been commented out (type_transition) is the problematic rule which leads to the "conflicting type rules" error upon loading the policy.

Such rule comes from the domain_auto_transition_pattern provided by support/misc_patterns.spt.

However, if I hardcode "user" instead of "$1", the type_transition works fine. I suspect, it stops functioning when $1 is replaced by "sysadm" or "staff".

If I do manually substitute the two and try to recompile, the following happens:

Quoted 6 lines

$1=sysadm ==> staff.te doesn't compile (unknown type error)

$1=staff ==> sysadm.te doesn't compile (unknown type error)

In some way, it sounds like a bug or some sort of limitation of the actual policy... Can you shed some light ?

I'm not clear why you would see unknown types. You have to inspect the intermediate files. I believe if you add them to a .SECONDARY entry in the Makefile/Rules.*, it will not delete them when they're done. I'd be fine taking that patch too, so intermediate files are never deleted.

Signature · 1 line
Chris PeBenito
#34 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Hello Christopher.

On Thu, 25/08/2016 at 18.49 -0400, Chris PeBenito wrote:

[...]

Quoted 144 lines
Quoted 137 lines
Quoted 101 lines
Quoted 93 lines
Quoted 34 lines
Quoted 25 lines
Quoted 16 lines · Guido Trentalancia
Quoted 15 lines
(quoted diff) +1 -0
+		type dconf_t, dconf_exec_t,

dconf_home_t;

(quoted diff) +1 -0
+		type at_spi_t, at_spi_exec_t;

? type gconfd_t, gconfd_exec_t,
gconf_tmp_t;
? type gconf_home_t;

(quoted diff) +1 -0
+		type gnome_settings_t,

gnome_settings_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_schemas_t;
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +1 -0
+		type gkeyringd_exec_t,

gnome_keyring_home_t,
gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

(quoted diff) +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

Quoted 8 lines

If $1_dbusd_t is used to get the role/type prefix from the caller,
then
it doesn't compile for some reason which is not yet clear to
me.

Any idea ?

Quoted 7 lines

The $1_dbusd_t rules need to be contained in the dbus module, not
the
gnome module.??Beyond that, it's tough to say what the problem
is,
without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>
##??????Make a domain transition from a
##??????given source domain to the
##??????DBUS session bus domain using
##??????the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##??????<summary>
##??????The prefix of the user role (e.g., user
##??????is the prefix for user_r).
##??????</summary>
## </param>
## <param name="domain">
##??????<summary>
##??????Domain allowed access.
##??????</summary>
## </param>
#
interface(dbus_domain_transition_session_bus',
????????gen_require(`
????????????????type dbusd_exec_t;
????????????????type $1_dbusd_t;
????????')

????????allow $2 dbusd_exec_t:file exec_file_perms; ????????domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t) ')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary /usr/sbin/semodule:??Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

I hope it is clear now...

Quoted 7 lines

Do you have an idea ? It's the only thing missing before all the
dbus
rules are moved from the gnome to the dbus module and I can create
a
new version of this important patch.

Quoted 4 lines

It's not so helpful unfortunately.??My guess is that it is a conflicting
type_transition.??Unfortunately the compiler error message isn't helpful.

I have tested and your guess is correct !

The above interface expands as follows:

interface(dbus_domain_transition_session_bus', ????????allow $1_dbusd_t dbusd_exec_t:file exec_file_perms;

????????domain_transition_pattern($2,dbusd_exec_t,$1_dbusd_t) #????????type_transition $2 dbusd_exec_t:process $1_dbusd_t;

????????allow $1_dbusd_t $2:fd use; ????????allow $1_dbusd_t $2:fifo_file rw_fifo_file_perms; ????????allow $1_dbusd_t $2:process sigchld;
')

The line that has been commented out (type_transition) is the problematic rule which leads to the "conflicting type rules" error upon
loading the policy.

Such rule comes from the domain_auto_transition_pattern provided by support/misc_patterns.spt.

However, if I hardcode "user" instead of "$1", the type_transition works fine. I suspect, it stops functioning when $1 is replaced by "sysadm" or "staff".

If I do manually substitute the two and try to recompile, the following
happens:

Quoted 6 lines

$1=sysadm ==> staff.te doesn't compile (unknown type error)

$1=staff ==> sysadm.te doesn't compile (unknown type error)

In some way, it sounds like a bug or some sort of limitation of the actual policy... Can you shed some light ?

Quoted 7 lines

I'm not clear why you would see unknown types.??You have to inspect the?
intermediate files.??I believe if you add them to a .SECONDARY entry in?
the Makefile/Rules.*, it will not delete them when they're done.??I'd be?
fine taking that patch too, so intermediate files are never deleted.

I think the files that you mention are stored in the "tmp" subdirectory of the policy source.

I don't think there is a need to modify the Makefile or Rules.* files.

The "Conflicting type rules" error comes from libsepol when one tries to load the policy using semodule (called by the policy Makefile).

What semodule deleted (/var/lib/selinux/refpolicy- 06082016/tmp/modules/400/sysadm/cil) might be a binary file generated by libsepol. In any case, it has nothing to do with the policy Makefile.

Unfortunately, I have checked the temporary files in the "tmp" subdirectory of the build tree, but the only difference between the working version and the non-working version is that the static hardcoded "user" string ("user_dbusd_t") in the type_transition rule is replaced by "staff", "sysadm" or "xguest" ("staff_dbusd_t" and so on).

I noticed that the dbus_role_template is also using that variable type ($1_dbusd_t, where $1 is normally either "user", "staff", "sysadm" or "xguest").

The problem seems to be that the $1_dbusd_t type defined by the dbus_role_template conflicts with the type defined by the new interface that is required by gnome (it conflicts with the type_transition rule).

I believe this is a bug or some sort of limitation of the existing policy... Do you know how to fix it ?

Regards,

Guido

#35 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 181 lines · Guido Trentalancia

Hello Christopher.

On Thu, 25/08/2016 at 18.49 -0400, Chris PeBenito wrote:

[...]

Quoted 144 lines
Quoted 137 lines
Quoted 101 lines
Quoted 93 lines
Quoted 34 lines
Quoted 25 lines
Quoted 16 lines · Guido Trentalancia
Quoted 15 lines
(quoted diff) +1 -0
+		type dconf_t, dconf_exec_t,

dconf_home_t;

(quoted diff) +1 -0
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t,

gconf_tmp_t;

(quoted diff) +1 -0
 		type gconf_home_t;
+		type gnome_settings_t,

gnome_settings_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_schemas_t;
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +1 -0
+		type gkeyringd_exec_t,

gnome_keyring_home_t,
gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

(quoted diff) +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

Quoted 8 lines

If $1_dbusd_t is used to get the role/type prefix from the caller,
then
it doesn't compile for some reason which is not yet clear to
me.

Any idea ?

Quoted 7 lines

The $1_dbusd_t rules need to be contained in the dbus module, not
the
gnome module. Beyond that, it's tough to say what the problem
is,
without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>

##      Make a domain transition from a
##      given source domain to the
##      DBUS session bus domain using
##      the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##      <summary>
##      The prefix of the user role (e.g., user
##      is the prefix for user_r).
##      </summary>
## </param>
## <param name="domain">
##      <summary>
##      Domain allowed access.
##      </summary>
## </param>
#
interface(`dbus_domain_transition_session_bus',`
        gen_require(`
                type dbusd_exec_t;
                type $1_dbusd_t;
        ')

        allow $2 dbusd_exec_t:file exec_file_perms;
        domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t)

')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary
/usr/sbin/semodule: Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

I hope it is clear now...

Quoted 7 lines

Do you have an idea ? It's the only thing missing before all the
dbus
rules are moved from the gnome to the dbus module and I can create
a
new version of this important patch.

Quoted 4 lines

It's not so helpful unfortunately. My guess is that it is a conflicting
type_transition. Unfortunately the compiler error message isn't helpful.

I have tested and your guess is correct !

The above interface expands as follows:

interface(dbus_domain_transition_session_bus',

        allow $1_dbusd_t dbusd_exec_t:file exec_file_perms;

        domain_transition_pattern($2,dbusd_exec_t,$1_dbusd_t)

# type_transition $2 dbusd_exec_t:process $1_dbusd_t;

        allow $1_dbusd_t $2:fd use;
        allow $1_dbusd_t $2:fifo_file rw_fifo_file_perms;
        allow $1_dbusd_t $2:process sigchld;

')

The line that has been commented out (type_transition) is the problematic rule which leads to the "conflicting type rules" error upon
loading the policy.

Such rule comes from the domain_auto_transition_pattern provided by support/misc_patterns.spt.

However, if I hardcode "user" instead of "$1", the type_transition works fine. I suspect, it stops functioning when $1 is replaced by "sysadm" or "staff".

If I do manually substitute the two and try to recompile, the following
happens:

Quoted 6 lines

$1=sysadm ==> staff.te doesn't compile (unknown type error)

$1=staff ==> sysadm.te doesn't compile (unknown type error)

In some way, it sounds like a bug or some sort of limitation of the actual policy... Can you shed some light ?

Quoted 7 lines

I'm not clear why you would see unknown types. You have to inspect the
intermediate files. I believe if you add them to a .SECONDARY entry in
the Makefile/Rules.*, it will not delete them when they're done. I'd be
fine taking that patch too, so intermediate files are never deleted.

I think the files that you mention are stored in the "tmp" subdirectory of the policy source.

I don't think there is a need to modify the Makefile or Rules.* files.

The "Conflicting type rules" error comes from libsepol when one tries to load the policy using semodule (called by the policy Makefile).

What semodule deleted (/var/lib/selinux/refpolicy- 06082016/tmp/modules/400/sysadm/cil) might be a binary file generated by libsepol. In any case, it has nothing to do with the policy Makefile.

Unfortunately, I have checked the temporary files in the "tmp" subdirectory of the build tree, but the only difference between the working version and the non-working version is that the static hardcoded "user" string ("user_dbusd_t") in the type_transition rule is replaced by "staff", "sysadm" or "xguest" ("staff_dbusd_t" and so on).

I noticed that the dbus_role_template is also using that variable type ($1_dbusd_t, where $1 is normally either "user", "staff", "sysadm" or "xguest").

Quoted 6 lines

The problem seems to be that the $1_dbusd_t type defined by the dbus_role_template conflicts with the type defined by the new interface that is required by gnome (it conflicts with the type_transition rule).

I believe this is a bug or some sort of limitation of the existing policy... Do you know how to fix it ?

The dbus module is where *_dbusd_t should be declared, so *_dbusd_t declarations in a gnome module are incorrect. The only other issue that I can think of is in the past, if you required a type and then later declared it in the same file, that would hit a compiler limitation/bug that would (incorrectly) call it a duplicate type declaration.

In terms of type_transition you'd have to inspect the intermediate file that is used to compile the binary to try to see where the conflict is. It may also be a conflict across multiple modules, which would make it more difficult to uncover.

Signature · 1 line
Chris PeBenito
#36 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Chris PeBenito

Hello Christopher.

Quoted 110 lines · Chris PeBenito
Quoted 101 lines · Guido Trentalancia

Hello Christopher.

I have more detailed information about this problem...

Quoted 38 lines · Chris PeBenito
Quoted 36 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 6 lines · Chris PeBenito
Quoted 3 lines · Guido Trentalancia
Quoted 16 lines
Quoted 12 lines
policy/modules/contrib/gnome.if +2 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;

? type gconfd_t, gconfd_exec_t, gconf_tmp_t;
? type gconf_home_t;

(quoted diff) +1 -0
+		type gnome_settings_t,

gnome_settings_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t,

gnome_keyring_home_t,
gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 2 lines
policy/modules/contrib/gnome.if +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

If $1_dbusd_t is used to get the role/type prefix from the caller,
then
it doesn't compile for some reason which is not yet clear to me.

Quoted 7 lines
Quoted 1 line

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the
gnome module.??Beyond that, it's tough to say what the problem is,
without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>
##??????Make a domain transition from a
##??????given source domain to the
##??????DBUS session bus domain using
##??????the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##??????<summary>
##??????The prefix of the user role (e.g., user
##??????is the prefix for user_r).
##??????</summary>
## </param>
## <param name="domain">
##??????<summary>
##??????Domain allowed access.
##??????</summary>
## </param>
#
interface(dbus_domain_transition_session_bus',
????????gen_require(`
????????????????type dbusd_exec_t;
????????????????type $1_dbusd_t;
????????')

????????allow $2 dbusd_exec_t:file exec_file_perms; ????????domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t) ')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary /usr/sbin/semodule:??Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

Quoted 7 lines

I hope it is clear now...

Do you have an idea ? It's the only thing missing before all the dbus
rules are moved from the gnome to the dbus module and I can create a
new version of this important patch.

Quoted 4 lines

It's not so helpful unfortunately.??My guess is that it is a conflicting?
type_transition.??Unfortunately the compiler error message isn't helpful.

I have just posted a patch on the SELinux mailing list to produce a more meaningful error message for conflicting type rules, see the following thread:

[PATCH] libsepol: Produce more meaningful error messages for conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the type transition for each of user, staff, sysadm and xguest, thus leading to conflicting rules.

Therefore, the solution might be to use a common static name for the domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Regards,

Guido

#37 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 135 lines · Guido Trentalancia via refpolicy

Hello Christopher.

Quoted 110 lines · Chris PeBenito
Quoted 101 lines · Guido Trentalancia

Hello Christopher.

I have more detailed information about this problem...

Quoted 38 lines · Chris PeBenito
Quoted 36 lines · Guido Trentalancia

Hello Christopher !

Thanks for providing your valuable feedback.

Quoted 6 lines · Chris PeBenito
Quoted 3 lines · Guido Trentalancia
Quoted 16 lines
Quoted 12 lines
(quoted diff) +3 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t, gconf_tmp_t;
 		type gconf_home_t;
+		type gnome_settings_t,

gnome_settings_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t,

gnome_keyring_home_t,
gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

Review

Quoted 2 lines
(quoted diff) +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

If $1_dbusd_t is used to get the role/type prefix from the caller,
then
it doesn't compile for some reason which is not yet clear to me.

Quoted 7 lines
Quoted 1 line

Any idea ?

The $1_dbusd_t rules need to be contained in the dbus module, not the
gnome module. Beyond that, it's tough to say what the problem is,
without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>

##      Make a domain transition from a
##      given source domain to the
##      DBUS session bus domain using
##      the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##      <summary>
##      The prefix of the user role (e.g., user
##      is the prefix for user_r).
##      </summary>
## </param>
## <param name="domain">
##      <summary>
##      Domain allowed access.
##      </summary>
## </param>
#
interface(`dbus_domain_transition_session_bus',`
        gen_require(`
                type dbusd_exec_t;
                type $1_dbusd_t;
        ')

        allow $2 dbusd_exec_t:file exec_file_perms;
        domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t)

')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary
/usr/sbin/semodule: Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

Quoted 7 lines

I hope it is clear now...

Do you have an idea ? It's the only thing missing before all the dbus
rules are moved from the gnome to the dbus module and I can create a
new version of this important patch.

Quoted 4 lines

It's not so helpful unfortunately. My guess is that it is a conflicting
type_transition. Unfortunately the compiler error message isn't helpful.

I have just posted a patch on the SELinux mailing list to produce a more meaningful error message for conflicting type rules, see the following thread:

[PATCH] libsepol: Produce more meaningful error messages for conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition rule).

Quoted 8 lines

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the type transition for each of user, staff, sysadm and xguest, thus leading to conflicting rules.

Therefore, the solution might be to use a common static name for the domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

and that will introduce other issues. because the session bus must be able to run things on behalf of the caller

Quoted 10 lines

Regards,

Guido

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160827/ba98bb1b/attachment.bin 
#38 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Hello Dominick.

Quoted 1 line · Dominick Grift via refpolicy

On 08/27/2016 07:08 PM, Guido Trentalancia via refpolicy wrote:

[...]

Quoted 131 lines
Quoted 131 lines
Quoted 101 lines
Quoted 93 lines
Quoted 34 lines
Quoted 25 lines
Quoted 16 lines · Guido Trentalancia
Quoted 15 lines
(quoted diff) +1 -0
+		type dconf_t, dconf_exec_t,

dconf_home_t;

(quoted diff) +1 -0
+		type at_spi_t, at_spi_exec_t;

? type gconfd_t, gconfd_exec_t,
gconf_tmp_t;
? type gconf_home_t;

(quoted diff) +1 -0
+		type gnome_settings_t,

gnome_settings_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_schemas_t;
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +1 -0
+		type gkeyringd_exec_t,

gnome_keyring_home_t,
gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

(quoted diff) +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

Quoted 8 lines

If $1_dbusd_t is used to get the role/type prefix from the caller,
then
it doesn't compile for some reason which is not yet clear to
me.

Any idea ?

Quoted 7 lines

The $1_dbusd_t rules need to be contained in the dbus module, not
the
gnome module.??Beyond that, it's tough to say what the problem
is,
without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>
##??????Make a domain transition from a
##??????given source domain to the
##??????DBUS session bus domain using
##??????the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##??????<summary>
##??????The prefix of the user role (e.g., user
##??????is the prefix for user_r).
##??????</summary>
## </param>
## <param name="domain">
##??????<summary>
##??????Domain allowed access.
##??????</summary>
## </param>
#
interface(dbus_domain_transition_session_bus',
????????gen_require(`
????????????????type dbusd_exec_t;
????????????????type $1_dbusd_t;
????????')

????????allow $2 dbusd_exec_t:file exec_file_perms; ????????domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t) ')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary /usr/sbin/semodule:??Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

I hope it is clear now...

Quoted 7 lines

Do you have an idea ? It's the only thing missing before all the
dbus
rules are moved from the gnome to the dbus module and I can create
a
new version of this important patch.

Quoted 4 lines

It's not so helpful unfortunately.??My guess is that it is a conflicting?
type_transition.??Unfortunately the compiler error message isn't helpful.

I have just posted a patch on the SELinux mailing list to produce a more meaningful error message for conflicting type rules, see the following thread:

[PATCH] libsepol: Produce more meaningful error messages for conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the type transition for each of user, staff, sysadm and xguest, thus leading to
conflicting rules.

Quoted 6 lines
Quoted 3 lines

Therefore, the solution might be to use a common static name for the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

and that will introduce other issues. because the session bus must be able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

So, what's the way out of this damn loop ?

I am almost getting lost...

Regards,

Guido

#39 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 142 lines · Guido Trentalancia

Hello Dominick.

Quoted 1 line · Dominick Grift via refpolicy

On 08/27/2016 07:08 PM, Guido Trentalancia via refpolicy wrote:

[...]

Quoted 135 lines
Quoted 134 lines
Quoted 101 lines
Quoted 93 lines
Quoted 34 lines
Quoted 25 lines
Quoted 16 lines · Guido Trentalancia
Quoted 15 lines
(quoted diff) +1 -0
+		type dconf_t, dconf_exec_t,

dconf_home_t;

(quoted diff) +1 -0
+		type at_spi_t, at_spi_exec_t;
 		type gconfd_t, gconfd_exec_t,

gconf_tmp_t;

(quoted diff) +1 -0
 		type gconf_home_t;
+		type gnome_settings_t,

gnome_settings_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +1 -0
+		type gnome_settings_schemas_t;
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +1 -0
+		type gkeyringd_exec_t,

gnome_keyring_home_t,
gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

(quoted diff) +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

Quoted 8 lines

If $1_dbusd_t is used to get the role/type prefix from the caller,
then
it doesn't compile for some reason which is not yet clear to
me.

Any idea ?

Quoted 7 lines

The $1_dbusd_t rules need to be contained in the dbus module, not
the
gnome module. Beyond that, it's tough to say what the problem
is,
without knowing the error messages.

Suppose to have the following additional dbus interface:

#######################################
## <summary>

##      Make a domain transition from a
##      given source domain to the
##      DBUS session bus domain using
##      the DBUS executable file type.
## </summary>
## <param name="role_prefix">
##      <summary>
##      The prefix of the user role (e.g., user
##      is the prefix for user_r).
##      </summary>
## </param>
## <param name="domain">
##      <summary>
##      Domain allowed access.
##      </summary>
## </param>
#
interface(`dbus_domain_transition_session_bus',`
        gen_require(`
                type dbusd_exec_t;
                type $1_dbusd_t;
        ')

        allow $2 dbusd_exec_t:file exec_file_perms;
        domtrans_pattern($2, dbusd_exec_t, $1_dbusd_t)

')

and suppose that it is called by the following statement:

dbus_domain_transition_session_bus($1, at_spi_t)

where $1 = "user".

During policy load, the following error is generated:

Conflicting type rules
Binary policy creation failed at line 29393 of /var/lib/selinux/refpolicy-06082016/tmp/modules/400/sysadm/cil Failed to generate binary
/usr/sbin/semodule: Failed!
make: *** [Rules.modular:58: load] Error 1

The temporary file is deleted automatically and cannot be inspected.

I hope it is clear now...

Quoted 7 lines

Do you have an idea ? It's the only thing missing before all the
dbus
rules are moved from the gnome to the dbus module and I can create
a
new version of this important patch.

Quoted 4 lines

It's not so helpful unfortunately. My guess is that it is a conflicting
type_transition. Unfortunately the compiler error message isn't helpful.

I have just posted a patch on the SELinux mailing list to produce a more meaningful error message for conflicting type rules, see the following thread:

[PATCH] libsepol: Produce more meaningful error messages for conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the type transition for each of user, staff, sysadm and xguest, thus leading to
conflicting rules.

Therefore, the solution might be to use a common static name for the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 9 lines
Quoted 2 lines

and that will introduce other issues. because the session bus must be able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

So, what's the way out of this damn loop ?

I am almost getting lost...

I dont know.

Quoted 4 lines

Regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160827/5446cd68/attachment-0001.bin 
#40 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 1 line · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 45 lines
Quoted 45 lines
Quoted 44 lines
Quoted 35 lines
Quoted 5 lines

It's not so helpful unfortunately.??My guess is that it is a conflicting?
type_transition.??Unfortunately the compiler error message isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 5 lines

Therefore, the solution might be to use a common static name for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Quoted 8 lines
Quoted 6 lines

Thanks for providing a forecast of other issues.

So, what's the way out of this damn loop ?

I am almost getting lost...

I dont know.

We need to find a cure for this !!

What prevents it from running things on behalf of the caller ? And what do you mean exactly for running things on behalf of the caller ?

I have the following interface:

allow $1 dbusd_exec_t:file exec_file_perms; domtrans_pattern($1, dbusd_exec_t, session_dbusd_t)

which is called with $1=at_spi_t and $1=gnome_settings_t but goes completely ignored !

If I search for "execute" or "transition" permissions using sesearch, it doesn't find anything, so for some strange reason the interface goes
completely ignored !

Is that what you meant earlier ? Why is it happening ??

Regards,

Guido

#41 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 52 lines · Guido Trentalancia
Quoted 1 line · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 47 lines
Quoted 47 lines
Quoted 41 lines
Quoted 35 lines
Quoted 5 lines

It's not so helpful unfortunately. My guess is that it is a conflicting
type_transition. Unfortunately the compiler error message isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 5 lines

Therefore, the solution might be to use a common static name for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

So, what's the way out of this damn loop ?

I am almost getting lost...

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues with reference policy unfortunately.

Quoted 3 lines

What prevents it from running things on behalf of the caller ? And what do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login shell domain.

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if theres a single session_dbus_t type.

Quoted 13 lines

I have the following interface:

allow $1 dbusd_exec_t:file exec_file_perms; domtrans_pattern($1, dbusd_exec_t, session_dbusd_t)

which is called with $1=at_spi_t and $1=gnome_settings_t but goes completely ignored !

If I search for "execute" or "transition" permissions using sesearch, it doesn't find anything, so for some strange reason the interface goes
completely ignored !

Quoted 6 lines

Is that what you meant earlier ? Why is it happening ??

Regards,

Guido

Maybe others know a way out. I really don't. Sorry.

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160827/ce13f8cd/attachment.bin 
#42 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Hello Dominick.

Thanks for providing more information.

Quoted 71 lines · Dominick Grift
Quoted 70 lines · Guido Trentalancia
Quoted 2 lines · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 63 lines
Quoted 62 lines
Quoted 52 lines
Quoted 45 lines
Quoted 5 lines
Quoted 7 lines

It's not so helpful unfortunately.??My guess is that it is a
conflicting?
type_transition.??Unfortunately the compiler error message
isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see
the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for
conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the
type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 6 lines

Therefore, the solution might be to use a common static name
for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

So, what's the way out of this damn loop ?

I am almost getting lost...

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues
with reference policy unfortunately.

There must be a way of solving this problem.

Quoted 16 lines
Quoted 3 lines

What prevents it from running things on behalf of the caller ? And what
do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully
confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login
shell domain.

Quoted 5 lines

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if
theres a single session_dbus_t type.

In the case at hand, there isn't the need to get back to the initial domain.

If I am not wrong, the whole transition is as follows:

user_t (at_spi_exec_t)-> at_spi_t (dbusd_exec_t)-> session_dbusd_t (at_spi_exec_t)-> at_spi_t

The last transition is not working for some reason (I have used the new dbus interface quoted below)...

Quoted 15 lines
Quoted 15 lines

I have the following interface:

allow $1 dbusd_exec_t:file exec_file_perms; domtrans_pattern($1, dbusd_exec_t, session_dbusd_t)

which is called with $1=at_spi_t and $1=gnome_settings_t but goes completely ignored !

If I search for "execute" or "transition" permissions using sesearch,
it doesn't find anything, so for some strange reason the interface goes
?completely ignored !

Is that what you meant earlier ? Why is it happening ??

[...]

Quoted 1 line

Maybe others know a way out. I really don't. Sorry.

Don't worry about that. But with the help of others, we need to find a cure for this !

Regards,

Guido

#43 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 109 lines · Guido Trentalancia via refpolicy

Hello Dominick.

Thanks for providing more information.

Quoted 71 lines · Dominick Grift
Quoted 70 lines · Guido Trentalancia
Quoted 2 lines · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 63 lines
Quoted 62 lines
Quoted 52 lines
Quoted 45 lines
Quoted 5 lines
Quoted 7 lines

It's not so helpful unfortunately. My guess is that it is a
conflicting
type_transition. Unfortunately the compiler error message
isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see
the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for
conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the
type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 6 lines

Therefore, the solution might be to use a common static name
for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

So, what's the way out of this damn loop ?

I am almost getting lost...

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues
with reference policy unfortunately.

There must be a way of solving this problem.

Quoted 16 lines
Quoted 3 lines

What prevents it from running things on behalf of the caller ? And what
do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully
confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login
shell domain.

Quoted 5 lines

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if
theres a single session_dbus_t type.

Quoted 8 lines

In the case at hand, there isn't the need to get back to the initial domain.

If I am not wrong, the whole transition is as follows:

user_t (at_spi_exec_t)-> at_spi_t (dbusd_exec_t)-> session_dbusd_t (at_spi_exec_t)-> at_spi_t

To see what i am trying to say you have to experience it for yourself. Gnome is this single body made up of individual entities. Just because atspi "may" not need to be prefixed doesnt mean that the session bus doesnt need to be prefixed. atspi isnt the only app executed by the session bus.

And let me just remind you. atspi needs to be able to run the session bus if it is not currently running. Do you see the chicken and egg problem?

Quoted 34 lines

The last transition is not working for some reason (I have used the new dbus interface quoted below)...

Quoted 15 lines
Quoted 15 lines

I have the following interface:

allow $1 dbusd_exec_t:file exec_file_perms; domtrans_pattern($1, dbusd_exec_t, session_dbusd_t)

which is called with $1=at_spi_t and $1=gnome_settings_t but goes completely ignored !

If I search for "execute" or "transition" permissions using sesearch,
it doesn't find anything, so for some strange reason the interface goes
completely ignored !

Is that what you meant earlier ? Why is it happening ??

[...]

Quoted 1 line

Maybe others know a way out. I really don't. Sorry.

Don't worry about that. But with the help of others, we need to find a cure for this !

Regards,

Guido
_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160828/fa8c81c7/attachment-0001.bin 
#44 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 119 lines · Dominick Grift
Quoted 109 lines · Guido Trentalancia via refpolicy

Hello Dominick.

Thanks for providing more information.

Quoted 71 lines · Dominick Grift
Quoted 70 lines · Guido Trentalancia
Quoted 2 lines · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 63 lines
Quoted 62 lines
Quoted 52 lines
Quoted 45 lines
Quoted 5 lines
Quoted 7 lines

It's not so helpful unfortunately. My guess is that it is a
conflicting
type_transition. Unfortunately the compiler error message
isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see
the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for
conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the
type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 6 lines

Therefore, the solution might be to use a common static name
for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

So, what's the way out of this damn loop ?

I am almost getting lost...

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues
with reference policy unfortunately.

There must be a way of solving this problem.

Quoted 16 lines
Quoted 3 lines

What prevents it from running things on behalf of the caller ? And what
do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully
confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login
shell domain.

Quoted 5 lines

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if
theres a single session_dbus_t type.

Quoted 8 lines

In the case at hand, there isn't the need to get back to the initial domain.

If I am not wrong, the whole transition is as follows:

user_t (at_spi_exec_t)-> at_spi_t (dbusd_exec_t)-> session_dbusd_t (at_spi_exec_t)-> at_spi_t

Quoted 10 lines

To see what i am trying to say you have to experience it for yourself. Gnome is this single body made up of individual entities. Just because atspi "may" not need to be prefixed doesnt mean that the session bus doesnt need to be prefixed. atspi isnt the only app executed by the session bus.

And let me just remind you. atspi needs to be able to run the session bus if it is not currently running. Do you see the chicken and egg problem?

You have to see the bigger picture. That is why i suggested you confine a minimal desktop first before you start submitting patches. Because once you have a broad overview you will see important issues that need to be resolved. You aren't able to identify them if you do not look at this as a whole.

Things should just naturally work. We can't have the house of cards collapse on the first anomaly that happens.

Quoted 36 lines
Quoted 34 lines

The last transition is not working for some reason (I have used the new dbus interface quoted below)...

Quoted 15 lines
Quoted 15 lines

I have the following interface:

allow $1 dbusd_exec_t:file exec_file_perms; domtrans_pattern($1, dbusd_exec_t, session_dbusd_t)

which is called with $1=at_spi_t and $1=gnome_settings_t but goes completely ignored !

If I search for "execute" or "transition" permissions using sesearch,
it doesn't find anything, so for some strange reason the interface goes
completely ignored !

Is that what you meant earlier ? Why is it happening ??

[...]

Quoted 1 line

Maybe others know a way out. I really don't. Sorry.

Don't worry about that. But with the help of others, we need to find a cure for this !

Regards,

Guido
_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160828/6374cf5a/attachment.bin 
#45 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Things are very far from working naturally as they are.

On the other hand, the patches are surely far from being complete or stable yet, but at least every version allows to start the Gnome desktop.

Now I met this major problem, it looks by all means a limitation of the existing framework, but I am sure that it will be sorted out...

I am also waiting to hear from Christopher about this.

Regards,

Guido

Quoted 181 lines · Dominick Grift via refpolicy
Quoted 113 lines · Dominick Grift
Quoted 112 lines · Guido Trentalancia via refpolicy

Hello Dominick.

Thanks for providing more information.

Quoted 71 lines · Dominick Grift
Quoted 70 lines · Guido Trentalancia
Quoted 2 lines · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 63 lines
Quoted 62 lines
Quoted 52 lines
Quoted 45 lines
Quoted 5 lines
Quoted 7 lines

It's not so helpful unfortunately. My guess is that it is a
conflicting
type_transition. Unfortunately the compiler error message
isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see
the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for
conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the
type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 6 lines

Therefore, the solution might be to use a common static name
for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

So, what's the way out of this damn loop ?

I am almost getting lost...

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues
with reference policy unfortunately.

There must be a way of solving this problem.

Quoted 16 lines
Quoted 3 lines

What prevents it from running things on behalf of the caller ? And what
do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully
confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login
shell domain.

Quoted 5 lines

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if
theres a single session_dbus_t type.

In the case at hand, there isn't the need to get back to the initial domain.

Quoted 7 lines
Quoted 5 lines

If I am not wrong, the whole transition is as follows:

user_t (at_spi_exec_t)-> at_spi_t (dbusd_exec_t)-> session_dbusd_t (at_spi_exec_t)-> at_spi_t

To see what i am trying to say you have to experience it for

yourself.

Quoted 1 line

Gnome is this single body made up of individual entities. Just

because

Quoted 6 lines

atspi "may" not need to be prefixed doesnt mean that the session bus doesnt need to be prefixed. atspi isnt the only app executed by the session bus.

And let me just remind you. atspi needs to be able to run the session bus if it is not currently running. Do you see the chicken and egg

problem?

Quoted 2 lines

You have to see the bigger picture. That is why i suggested you confine a minimal desktop first before you start submitting patches. Because once you have a broad overview you will see important issues that need to be resolved. You aren't able to identify them if you do not look at this as a whole.

Things should just naturally work. We can't have the house of cards collapse on the first anomaly that happens.

Quoted 1 line
Quoted 1 line

The last transition is not working for some reason (I have used the

new

Quoted 16 lines
Quoted 16 lines

dbus interface quoted below)...

Quoted 14 lines
Quoted 14 lines

I have the following interface:

allow $1 dbusd_exec_t:file exec_file_perms; domtrans_pattern($1, dbusd_exec_t, session_dbusd_t)

which is called with $1=at_spi_t and $1=gnome_settings_t but goes completely ignored !

If I search for "execute" or "transition" permissions using sesearch,
it doesn't find anything, so for some strange reason the interface goes
completely ignored !

Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line

Is that what you meant earlier ? Why is it happening ??

[...]

Quoted 1 line

Maybe others know a way out. I really don't. Sorry.

Don't worry about that. But with the help of others, we need to find

a

Quoted 12 lines
Quoted 10 lines

cure for this !

Regards,

Guido
_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

#46 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 7 lines · Guido Trentalancia via refpolicy

Things are very far from working naturally as they are.

On the other hand, the patches are surely far from being complete or stable yet, but at least every version allows to start the Gnome desktop.

Now I met this major problem, it looks by all means a limitation of the existing framework, but I am sure that it will be sorted out...

I am also waiting to hear from Christopher about this.

The way I see it is that general purpose desktops are incredibly complicated and are not designed with security in mind. I wonder if the policy complexity needed to confine it all actually buys a proportional amount of security gains. I'm not saying it shouldn't be done, but I am skeptical that it is worth it.

Signature · 1 line
Chris PeBenito
#47 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Hello Christopher!

I think it's definitely worth in terms of security confining the Gnome desktop (as well as the other applications) properly.

The user domain is the most common vulnerable point, so it should have the most limited number of permissions possibile.

By confining the desktop properly we get great security gains exactly in that direction.

Any insight on the problem that I encountered?

I couldn't get things working in the dbus module with the variable $1_dbusd_t type, so I am now moving to testing with a static type instead.

Best regards,

Guido

Quoted 20 lines · Chris PeBenito
Quoted 3 lines · Guido Trentalancia via refpolicy

Things are very far from working naturally as they are.

On the other hand, the patches are surely far from being complete or

stable yet, but at least every version allows to start the Gnome desktop.

Quoted 2 lines

Now I met this major problem, it looks by all means a limitation of

the existing framework, but I am sure that it will be sorted out...

Quoted 2 lines

I am also waiting to hear from Christopher about this.

The way I see it is that general purpose desktops are incredibly complicated and are not designed with security in mind. I wonder if the
policy complexity needed to confine it all actually buys a proportional

amount of security gains. I'm not saying it shouldn't be done, but I am
skeptical that it is worth it.

#48 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Chris PeBenito
Quoted 9 lines · Chris PeBenito
Quoted 8 lines · Guido Trentalancia via refpolicy

Things are very far from working naturally as they are.

On the other hand, the patches are surely far from being complete or stable yet, but at least every version allows to start the Gnome desktop.

Now I met this major problem, it looks by all means a limitation of the existing framework, but I am sure that it will be sorted out...

Quoted 8 lines
Quoted 1 line

I am also waiting to hear from Christopher about this.

The way I see it is that general purpose desktops are incredibly complicated and are not designed with security in mind. I wonder if the policy complexity needed to confine it all actually buys a proportional amount of security gains. I'm not saying it shouldn't be done, but I am skeptical that it is worth it.

It is expensive. I agree, but i would not go so far as to say that confining the desktop does not buy a proportional amount of security gains.

It is telling though that you're not the only authority saying that using selinux to confine the desktop is not practical (Walsh shares your opinion).

Anyhow DSSP fills a gap here. So if you value integrity on the desktop DSSP is be happy to take contributions :)

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160828/376db0aa/attachment.bin 
#49 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 22 lines · Dominick Grift
Quoted 9 lines · Chris PeBenito
Quoted 8 lines · Guido Trentalancia via refpolicy

Things are very far from working naturally as they are.

On the other hand, the patches are surely far from being complete or stable yet, but at least every version allows to start the Gnome desktop.

Now I met this major problem, it looks by all means a limitation of the existing framework, but I am sure that it will be sorted out...

Quoted 8 lines
Quoted 1 line

I am also waiting to hear from Christopher about this.

The way I see it is that general purpose desktops are incredibly complicated and are not designed with security in mind. I wonder if the policy complexity needed to confine it all actually buys a proportional amount of security gains. I'm not saying it shouldn't be done, but I am skeptical that it is worth it.

It is expensive. I agree, but i would not go so far as to say that confining the desktop does not buy a proportional amount of security gains.

Quoted 7 lines

It is telling though that you're not the only authority saying that using selinux to confine the desktop is not practical (Walsh shares your opinion).

Anyhow DSSP fills a gap here. So if you value integrity on the desktop DSSP is be happy to take contributions :)

SELinux is a flexible MAC, and it is designed to be a framework to address the widest range of access control challenges. It is THE tool for this job.

Were talking Access Control, this is not just about containing flawed or malicious code. We use access control to govern who can do what as well.

I will be the first to agree that desktops aren't designed with security in mind. That is one of the reasons we need to contain it. Some of the code in there looks downright disturbing.

My shell is "fragile" I will be the first to admit. But at least I have an excuse (dropped out of kindergarten), plus i know its "fragile" and so i contain my own code.

SELinux is not "practical" at all (until its is the only tool left capable enough to do the job). Desktop or not. Ask 10 random people, and I am willing to bet that at least 8 of them agree. Heck security is not practical!

Our identities. passwords and other authentication credentials are pretty much all we have on this network called Internet. We should do all we can to protect it.

On a desktop, the desktop is generally the most vulnerable. Yes we need to contain the system side as well, but A desktop generally has much less of that compared to a server.

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160829/a9e0bfcb/attachment.bin 
#50 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

@Dominick, absolutely.

I was really upset (to put it lightly) to find out that Fedora 24 doesn't confine Google Chrome any more, which is completely unacceptable. I might become a contributor to DSSP for this reason. Thanks,
- Naftuli Tzvi

Quoted 73 lines · Dominick Grift via refpolicy
Quoted 22 lines · Dominick Grift
Quoted 9 lines · Chris PeBenito
Quoted 8 lines · Guido Trentalancia via refpolicy

Things are very far from working naturally as they are.

On the other hand, the patches are surely far from being complete or stable yet, but at least every version allows to start the Gnome desktop.

Now I met this major problem, it looks by all means a limitation of the existing framework, but I am sure that it will be sorted out...

Quoted 8 lines
Quoted 1 line

I am also waiting to hear from Christopher about this.

The way I see it is that general purpose desktops are incredibly complicated and are not designed with security in mind. I wonder if the policy complexity needed to confine it all actually buys a proportional amount of security gains. I'm not saying it shouldn't be done, but I am skeptical that it is worth it.

It is expensive. I agree, but i would not go so far as to say that confining the desktop does not buy a proportional amount of security gains.

Quoted 7 lines

It is telling though that you're not the only authority saying that using selinux to confine the desktop is not practical (Walsh shares your opinion).

Anyhow DSSP fills a gap here. So if you value integrity on the desktop DSSP is be happy to take contributions :)

SELinux is a flexible MAC, and it is designed to be a framework to address the widest range of access control challenges. It is THE tool for this job.

Were talking Access Control, this is not just about containing flawed or malicious code. We use access control to govern who can do what as well.

I will be the first to agree that desktops aren't designed with security in mind. That is one of the reasons we need to contain it. Some of the code in there looks downright disturbing.

My shell is "fragile" I will be the first to admit. But at least I have an excuse (dropped out of kindergarten), plus i know its "fragile" and so i contain my own code.

SELinux is not "practical" at all (until its is the only tool left capable enough to do the job). Desktop or not. Ask 10 random people, and I am willing to bet that at least 8 of them agree. Heck security is not practical!

Our identities. passwords and other authentication credentials are pretty much all we have on this network called Internet. We should do all we can to protect it.

On a desktop, the desktop is generally the most vulnerable. Yes we need to contain the system side as well, but A desktop generally has much less of that compared to a server.

--
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

#51 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Chris PeBenito

Hello Christopher.

Quoted 13 lines · Chris PeBenito
Quoted 11 lines · Guido Trentalancia via refpolicy

Things are very far from working naturally as they are.

On the other hand, the patches are surely far from being complete or stable yet, but at least every version allows to start the Gnome desktop.

Now I met this major problem, it looks by all means a limitation of the existing framework, but I am sure that it will be sorted out...

I am also waiting to hear from Christopher about this.

Quoted 8 lines

The way I see it is that general purpose desktops are incredibly? complicated and are not designed with security in mind.??I wonder if the?
policy complexity needed to confine it all actually buys a proportional?
amount of security gains.??I'm not saying it shouldn't be done, but I am?
skeptical that it is worth it.

Apart from confining the whole desktop, what I recently proposed to Dominick for further evaluation is as follows:

- we patch the libsepol code so that it creates all the conflicting type rules instead of aborting;
- we also patch the policy enforcing code, so that when it needs to enforce one of such conflicting type rules, it first searches for duplicates and then it enforces the one that matches the calling context.

Do you think the above is feasible (in particular, "matching the calling context") ?

Best regards,

Guido

#52 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 35 lines · Guido Trentalancia

Hello Christopher.

Quoted 13 lines · Chris PeBenito
Quoted 11 lines · Guido Trentalancia via refpolicy

Things are very far from working naturally as they are.

On the other hand, the patches are surely far from being complete or stable yet, but at least every version allows to start the Gnome desktop.

Now I met this major problem, it looks by all means a limitation of the existing framework, but I am sure that it will be sorted out...

I am also waiting to hear from Christopher about this.

Quoted 8 lines

The way I see it is that general purpose desktops are incredibly complicated and are not designed with security in mind. I wonder if the
policy complexity needed to confine it all actually buys a proportional
amount of security gains. I'm not saying it shouldn't be done, but I am
skeptical that it is worth it.

Apart from confining the whole desktop, what I recently proposed to Dominick for further evaluation is as follows:

- we patch the libsepol code so that it creates all the conflicting type rules instead of aborting;
- we also patch the policy enforcing code, so that when it needs to enforce one of such conflicting type rules, it first searches for duplicates and then it enforces the one that matches the calling context.

Quoted 2 lines

Do you think the above is feasible (in particular, "matching the calling context") ?

I don't know what you mean by "matching the calling context." A conflicting type transition looks like this:

type_transition source_type exec_type:process new_domain; type_transition source_type exec_type:process other_new_domain;

I don't see how you can decide between the two if they both exist in the policy (unless they are in opposite if/else blocks, which is valid).

Signature · 1 line
Chris PeBenito
#53 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 51 lines · Chris PeBenito
Quoted 44 lines · Guido Trentalancia

Hello Christopher.

Quoted 19 lines · Chris PeBenito
Quoted 10 lines · Guido Trentalancia via refpolicy

Things are very far from working naturally as they are.

On the other hand, the patches are surely far from being complete
or stable yet, but at least every version allows to start the Gnome
desktop.

Quoted 6 lines

Now I met this major problem, it looks by all means a limitation of
the existing framework, but I am sure that it will be sorted out...

I am also waiting to hear from Christopher about this.

Quoted 10 lines

The way I see it is that general purpose desktops are incredibly complicated and are not designed with security in mind.??I wonder if
the
policy complexity needed to confine it all actually buys a proportional
amount of security gains.??I'm not saying it shouldn't be done, but I
am
skeptical that it is worth it.

Apart from confining the whole desktop, what I recently proposed to Dominick for further evaluation is as follows:

- we patch the libsepol code so that it creates all the conflicting type rules instead of aborting;
- we also patch the policy enforcing code, so that when it needs to enforce one of such conflicting type rules, it first searches for duplicates and then it enforces the one that matches the calling context.

Quoted 2 lines

Do you think the above is feasible (in particular, "matching the calling context") ?

I don't know what you mean by "matching the calling context."??A? conflicting type transition looks like this:

Quoted 6 lines

type_transition source_type exec_type:process new_domain; type_transition source_type exec_type:process other_new_domain;

I don't see how you can decide between the two if they both exist in the?
policy (unless they are in opposite if/else blocks, which is valid).

type_transition session_dbusd_t bin_t:process user_t; type_transition session_dbusd_t bin_t:process staff_t; type_transition
session_dbusd_t bin_t:process sysadm_t; type_transition session_dbusd_t
bin_t:process xguest_t;

At the moment, they cannot coexist (conflicting type rules).

Imagine that we insert all of them into the policy.

The process that is running as session_dbusd_t (the source) is actually classified as user_u:user_r:session_dbusd_t (or equivalently for the other three possible cases).

So, for the case at hand, we know that the first rule should be considered for such process:

we enforce: type_transition session_dbusd_t bin_t:process user_t;

Theoretically, we can select the correct rule for each calling process by looking at the full context of such process.

Am I missing something ?

Regards,

Guido

#54 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Dominick Grift

Hello Dominick.

Quoted 98 lines · Dominick Grift
Quoted 65 lines · Guido Trentalancia
Quoted 2 lines · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 58 lines
Quoted 58 lines
Quoted 52 lines
Quoted 45 lines
Quoted 5 lines
Quoted 7 lines

It's not so helpful unfortunately.??My guess is that it is a
conflicting?
type_transition.??Unfortunately the compiler error message
isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see
the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for
conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the
type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 6 lines

Therefore, the solution might be to use a common static name
for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

So, what's the way out of this damn loop ?

I am almost getting lost...

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues
with reference policy unfortunately.

Quoted 5 lines

What prevents it from running things on behalf of the caller ? And what
do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully
confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login
shell domain.

Quoted 5 lines

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if
theres a single session_dbus_t type.

I am hitting a similar situation at the moment with the modified gnome and dbus modules...

user_t -> session_dbusd_t -> cannot execute bin_t or shell in the user_t domain

Perhaps, it is possible to change the existing code so that it adds the conflicting type rules, but then when it actually needs to apply them, it looks up for duplicates and it only applies the one which matches the calling context.

It should be feasible...

What do you say ?

We need to find a way out of this !

Best regards,

Guido

#55 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 113 lines · Guido Trentalancia

Hello Dominick.

Quoted 98 lines · Dominick Grift
Quoted 65 lines · Guido Trentalancia
Quoted 2 lines · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 58 lines
Quoted 58 lines
Quoted 52 lines
Quoted 45 lines
Quoted 5 lines
Quoted 7 lines

It's not so helpful unfortunately. My guess is that it is a
conflicting
type_transition. Unfortunately the compiler error message
isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see
the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for
conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the
type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 6 lines

Therefore, the solution might be to use a common static name
for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

So, what's the way out of this damn loop ?

I am almost getting lost...

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues
with reference policy unfortunately.

Quoted 5 lines

What prevents it from running things on behalf of the caller ? And what
do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully
confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login
shell domain.

Quoted 5 lines

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if
theres a single session_dbus_t type.

I am hitting a similar situation at the moment with the modified gnome and dbus modules...

user_t -> session_dbusd_t -> cannot execute bin_t or shell in the user_t domain

Quoted 9 lines

Perhaps, it is possible to change the existing code so that it adds the conflicting type rules, but then when it actually needs to apply them, it looks up for duplicates and it only applies the one which matches the calling context.

It should be feasible...

What do you say ?

I am saying what I said. This issue is very old and no one ever bothered to fix it. It is not going to happen.

Module policy is legacy. A new superior language that does not have these issues is available.

Quoted 1 line

We need to find a way out of this !

There is a way out but its not module policy

Quoted 5 lines

Best regards,

Guido

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160830/c9528686/attachment-0001.bin 
#56 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 127 lines · Dominick Grift via refpolicy
Quoted 113 lines · Guido Trentalancia

Hello Dominick.

Quoted 98 lines · Dominick Grift
Quoted 65 lines · Guido Trentalancia
Quoted 2 lines · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 58 lines
Quoted 58 lines
Quoted 52 lines
Quoted 45 lines
Quoted 5 lines
Quoted 7 lines

It's not so helpful unfortunately. My guess is that it is a
conflicting
type_transition. Unfortunately the compiler error message
isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see
the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for
conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the
type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 6 lines

Therefore, the solution might be to use a common static name
for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

So, what's the way out of this damn loop ?

I am almost getting lost...

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues
with reference policy unfortunately.

Quoted 5 lines

What prevents it from running things on behalf of the caller ? And what
do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully
confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login
shell domain.

Quoted 5 lines

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if
theres a single session_dbus_t type.

I am hitting a similar situation at the moment with the modified gnome and dbus modules...

user_t -> session_dbusd_t -> cannot execute bin_t or shell in the user_t domain

Quoted 9 lines

Perhaps, it is possible to change the existing code so that it adds the conflicting type rules, but then when it actually needs to apply them, it looks up for duplicates and it only applies the one which matches the calling context.

It should be feasible...

What do you say ?

I am saying what I said. This issue is very old and no one ever bothered to fix it. It is not going to happen.

Quoted 6 lines

Module policy is legacy. A new superior language that does not have these issues is available.

Quoted 1 line

We need to find a way out of this !

There is a way out but its not module policy

Perhaps you can structure the policy better, but a conflicting type transition is an error even if is written in CIL.

Signature · 1 line
Chris PeBenito
#57 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 131 lines · Chris PeBenito
Quoted 130 lines · Dominick Grift via refpolicy
Quoted 113 lines · Guido Trentalancia

Hello Dominick.

Quoted 98 lines · Dominick Grift
Quoted 65 lines · Guido Trentalancia
Quoted 2 lines · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 58 lines
Quoted 58 lines
Quoted 52 lines
Quoted 45 lines
Quoted 5 lines
Quoted 7 lines

It's not so helpful unfortunately. My guess is that it is a
conflicting
type_transition. Unfortunately the compiler error message
isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see
the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for
conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the
type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 6 lines

Therefore, the solution might be to use a common static name
for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

So, what's the way out of this damn loop ?

I am almost getting lost...

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues
with reference policy unfortunately.

Quoted 5 lines

What prevents it from running things on behalf of the caller ? And what
do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully
confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login
shell domain.

Quoted 5 lines

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if
theres a single session_dbus_t type.

I am hitting a similar situation at the moment with the modified gnome and dbus modules...

user_t -> session_dbusd_t -> cannot execute bin_t or shell in the user_t domain

Quoted 9 lines

Perhaps, it is possible to change the existing code so that it adds the conflicting type rules, but then when it actually needs to apply them, it looks up for duplicates and it only applies the one which matches the calling context.

It should be feasible...

What do you say ?

I am saying what I said. This issue is very old and no one ever bothered to fix it. It is not going to happen.

Module policy is legacy. A new superior language that does not have these issues is available.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

We need to find a way out of this !

There is a way out but its not module policy

Perhaps you can structure the policy better, but a conflicting type transition is an error even if is written in CIL.

Sure. That is true. Maybe the ability to structure your policy better makes a big difference, aside from having the luxury of more meaningful compiler errors and warnings.

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160831/f4aabd70/attachment-0001.bin 
#58 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 136 lines · Dominick Grift
Quoted 135 lines · Chris PeBenito
Quoted 133 lines · Dominick Grift via refpolicy
Quoted 113 lines · Guido Trentalancia

Hello Dominick.

Quoted 98 lines · Dominick Grift
Quoted 65 lines · Guido Trentalancia
Quoted 2 lines · Dominick Grift

On 08/27/2016 07:16 PM, Guido Trentalancia wrote:

[...]

Quoted 58 lines
Quoted 58 lines
Quoted 52 lines
Quoted 45 lines
Quoted 5 lines
Quoted 7 lines

It's not so helpful unfortunately. My guess is that it is a
conflicting
type_transition. Unfortunately the compiler error message
isn't
helpful.

I have just posted a patch on the SELinux mailing list to produce a
more meaningful error message for conflicting type rules, see
the
following thread:

[PATCH] libsepol: Produce more meaningful error messages for
conflicting type rules

In this case, the conflicting type rule is:

scontext=at_spi_t
tcontext=dbusd_exec_t
tclass=process
result=sysadm_dbusd_t

which confirms the previous debugging results (it's the type_transition
rule).

Another one is similar, with scontext=gnome_settings_t.

What I suspect is that when it compiles, it quadruplicates the
type
transition for each of user, staff, sysadm and xguest, thus leading
to
conflicting rules.

Quoted 6 lines

Therefore, the solution might be to use a common static name
for
the
domain (for example, "session_dbusd_t" instead of "$1_dbusd_t").

Quoted 3 lines

and that will introduce other issues. because the session bus must be
able to run things on behalf of the caller

Thanks for providing a forecast of other issues.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

So, what's the way out of this damn loop ?

I am almost getting lost...

I dont know.

We need to find a cure for this !!

I have been pleading for this for years. In my case the solution to these problems is DSSP and CIL. I was never able to solve these issues
with reference policy unfortunately.

Quoted 5 lines

What prevents it from running things on behalf of the caller ? And what
do you mean exactly for running things on behalf of the caller ?

It hard to explain. The best way to appreciate what I mean is to experience it yourself. It will become clear as you move towards a fully
confined desktop.

A lot of programs can be started by the session bus. Many of these programs started by the session bus on behalf of users run other programs and so forth and so forth. Some of these programs need to eventually be able run shell with a domain transition back to the login
shell domain.

Quoted 5 lines

staff_t -> staff_dbus_t -> staff_myapp_t -> staff_t

To be able to do this we need to use derived types. You can't do it if
theres a single session_dbus_t type.

I am hitting a similar situation at the moment with the modified gnome and dbus modules...

user_t -> session_dbusd_t -> cannot execute bin_t or shell in the user_t domain

Quoted 9 lines

Perhaps, it is possible to change the existing code so that it adds the conflicting type rules, but then when it actually needs to apply them, it looks up for duplicates and it only applies the one which matches the calling context.

It should be feasible...

What do you say ?

I am saying what I said. This issue is very old and no one ever bothered to fix it. It is not going to happen.

Module policy is legacy. A new superior language that does not have these issues is available.

Quoted 1 line

We need to find a way out of this !

There is a way out but its not module policy

Quoted 9 lines
Quoted 4 lines

Perhaps you can structure the policy better, but a conflicting type transition is an error even if is written in CIL.

Sure. That is true. Maybe the ability to structure your policy better makes a big difference, aside from having the luxury of more meaningful compiler errors and warnings.

Not suggesting secilc is perfect. It is not.

SECILC should identify and warn about any blockabstracts it finds in optional policy. Currently it allows them without any notification that it is not allowed and/or that it causes inconsistent behavior. This is bound to cause confusion.

Even though these are documented "rules". The compiler should still catch it and prevent it from happening.

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160831/b130d02a/attachment.bin 
#59 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Chris PeBenito
Quoted 35 lines · Chris PeBenito
Quoted 34 lines · Guido Trentalancia

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the ? gnome-settings-daemon and the at-spi daemon with all the ? needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced ? to support the OIL Runtime Compiler (ORC) optimized code ? execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome ? keyring domains;
- add support for chat over dbus in the gconfd domain and in the ? new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home ? directories (such as the ICC EDID profiles): requires the ? recent colord patch;
- add support for for reading the colord related files in the home ? directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home ? directories;
- includes minor modifications to the consolekit, dbus and ? policykit modules to support the new targeted gnome daemons ? and applications;
- modifies the pulseaudio module to introduce new interfaces to ? read and write pulseaudio tmpfs files and to use the pulseaudio ? file descriptor;
- provides better module encapsulation (i.e. dbus module).

The support for Gnome2/ORBit-2 (version 2) has been dropped.

This patch depends on the recent colord patch.

Recent changes to the pulseaudio module depends on this patch !

[...]

Quoted 15 lines

policy/modules/contrib/gnome.if interface(`gnome_role',` · line 60

Quoted 13 lines
policy/modules/contrib/gnome.if +2 -0
+		type dconf_t, dconf_exec_t, dconf_home_t;
+		type at_spi_t, at_spi_exec_t;

? type gconfd_t, gconfd_exec_t, gconf_tmp_t;
? type gconf_home_t;

(quoted diff) +2 -0
+		type gnome_settings_t, gnome_settings_exec_t;
+		type gnome_settings_daemon_t,

gnome_settings_daemon_exec_t;

(quoted diff) +2 -0
+		type gnome_settings_schemas_t;
+		type gkeyringd_exec_t, gnome_keyring_home_t,

gnome_keyring_cache_home_t, gnome_keyring_tmp_t;

policy/modules/contrib/gnome.if +2 -0
+		type mime_info_t;
+		type user_dbusd_t;

This dbus type cannot be referenced directly in this module.

It's not a dbus type, although it might resemble that from its naming...

It's just a convenience private type used to create a domain for running non-system dbus sessions.

Quoted 8 lines
Quoted 6 lines

? optional_policy(`

policy/modules/contrib/gnome.if +3 -0
+		dbus_connect_spec_session_bus(user, dconf_t)
+		dbus_connect_spec_session_bus(user, at_spi_t)
+		dbus_connect_spec_session_bus(user,

gnome_settings_daemon_t)

Prefixes can't be hardcoded like this.

It's related to the above private type.

It is used somewhat similarly to a variable in a program.

It's not related to "user" as in the arguments "(user, user_r, user_t)".

As already explained, it would fail to compile with a "conflicting type rule" error if I use the $1 argument.

Quoted 11 lines
Quoted 11 lines
policy/modules/contrib/gnome.if +3 -0
+		dbus_connect_system_bus(gnome_settings_daemon_t)
+		dbus_domain_transition(at_spi_t, user_dbusd_t)
+		dbus_domain_transition(gnome_settings_t,

user_dbusd_t)

policy/modules/contrib/gnome.if +3 -0
+		dbus_send_spec_session_bus(user, dconf_t)
+		dbus_send_spec_session_bus(user, at_spi_t)
+		dbus_send_spec_session_bus(user,

gnome_settings_daemon_t)
? dbus_spec_session_domain($1, $1_gkeyringd_t,
gkeyringd_exec_t)

Regards,

Guido

#60 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Guido Trentalancia
Quoted 28 lines · Guido Trentalancia

Update for the gnome module:

- target the dconf daemon, the gsettings user application, the gnome-settings-daemon and the at-spi daemon with all the needed domain transitions;
- a new gstreamer_orcexec_t type and file context is introduced to support the OIL Runtime Compiler (ORC) optimized code execution (used for example by pulseaudio);
- add support for more permissions needed in gconfd_t and gnome keyring domains;
- add support for chat over dbus in the gconfd domain and in the new domains (dconf, gsettings, etc);
- add support for a few needed fs and kernel permissions.
- add support for reading the colord related files in the home directories (such as the ICC EDID profiles): requires the recent colord patch;
- add support for for reading the colord related files in the home directories in the common user domain template;
- add support for a new mime_info_t type to be used in the home directories;
- includes minor modifications to the consolekit, dbus and policykit modules to support the new targeted gnome daemons and applications;
- modifies the pulseaudio module to introduce new interfaces to read and write pulseaudio tmpfs files and to use the pulseaudio file descriptor;
- provides better module encapsulation (i.e. dbus module).

Quoted 5 lines

The support for Gnome2/ORBit-2 (version 2) has been dropped.

This patch depends on the recent colord patch.

Recent changes to the pulseaudio module depends on this patch !

Hey,

I've been fairly busy lately so didnt closely follow this thread and its too long now for me to understand what exactly the problems are.

If I followed correctly, it seems like the biggest problem currently is transitioning to/from dbus? can you show the "ps auxfZ | grep dbus" lines?

How exactly are you running into problems? Can you post a very minimal command that triggers the problems? Is there some hello world I can put in /usr/share/dbus-1/services and a command to trigger the issue?

A lot of these other problems in this patch seem to be issues with dbus so lets fix that first then the other ones will be easier.

-- Jason

#61 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Hello Jason.

Quoted 3 lines · Jason Zaman
Quoted 2 lines · Guido Trentalancia

Update for the gnome module:

[...]

Quoted 5 lines

Hey,

I've been fairly busy lately so didnt closely follow this thread and its
too long now for me to understand what exactly the problems are.

I'll point you to a few right messages to read in this thread to understand the problem clearly...

Please read the following messages in order:

http://oss.tresys.com/pipermail/refpolicy/2016-August/008360.html?(non-
quoted message text only)

http://oss.tresys.com/pipermail/refpolicy/2016-August/008369.html?(non-
quoted message text only)

What Dominick added here is partly true, although at the I have had some success with re-writing the policy for the whole desktop (or most of it):

http://oss.tresys.com/pipermail/refpolicy/2016-August/008370.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008374.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008382.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008385.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008384.html

The following messages are about a possible way to solve the problem without changing the actual policy (which can be tricky):

http://oss.tresys.com/pipermail/refpolicy/2016-August/008397.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008398.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008400.html

So, you have an excellent excerpt now...

Quoted 4 lines

If I followed correctly, it seems like the biggest problem currently is
transitioning to/from dbus? can you show the "ps auxfZ | grep dbus" lines?

The problem is transitioning from a user domain (user, staff, sysadm or xguest) to other domains such as dbus (or gkeyring) and then back to the initial user domain.

At the moment the policy uses variable types built using the user argument ($1) passed to the gnome/dbus role() interface.

Such approach has big limitations and the current framework is poorly designed with respect to the ability to perform the above mentioned transition.

Quoted 5 lines

How exactly are you running into problems? Can you post a very minimal
command that triggers the problems? Is there some hello world I can put
in /usr/share/dbus-1/services and a command to trigger the issue?

It's more complex than just starting a command. There are problems in the underlying framework when the modified policy is loaded (conflicting type rules, i.e. conflicting type transitions).

One way to solve the problem is by changing the policy. I have had some success so far, however it's tricky, expensive and it's not the optimal solution.

A possible optimal solution is proposed in the last two or three messages that I posted (see the last two or three messages quoted above).

Quoted 3 lines

A lot of these other problems in this patch seem to be issues with dbus
so lets fix that first then the other ones will be easier.

If you want to help implementing a patch, we need to identify the code where such policy is actually enforced, so that there we can track the calling user domain to choose the right type transition.

Regards,

Guido

#62 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 43 lines · Guido Trentalancia

Hello Jason.

Quoted 3 lines · Jason Zaman
Quoted 2 lines · Guido Trentalancia

Update for the gnome module:

[...]

Quoted 5 lines

Hey,

I've been fairly busy lately so didnt closely follow this thread and its
too long now for me to understand what exactly the problems are.

I'll point you to a few right messages to read in this thread to understand the problem clearly...

Please read the following messages in order:

http://oss.tresys.com/pipermail/refpolicy/2016-August/008360.html?(non-
quoted message text only)

http://oss.tresys.com/pipermail/refpolicy/2016-August/008369.html?(non-
quoted message text only)

What Dominick added here is partly true, although at the I have had some success with re-writing the policy for the whole desktop (or most of it):

http://oss.tresys.com/pipermail/refpolicy/2016-August/008370.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008374.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008382.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008385.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008384.html

The following messages are about a possible way to solve the problem without changing the actual policy (which can be tricky):

Quoted 7 lines

http://oss.tresys.com/pipermail/refpolicy/2016-August/008397.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008398.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008400.html

So, you have an excellent excerpt now...

This helped a lot but I am still unclear what the original problem is.

Quoted 9 lines
Quoted 4 lines

If I followed correctly, it seems like the biggest problem currently is
transitioning to/from dbus? can you show the "ps auxfZ | grep dbus" lines?

The problem is transitioning from a user domain (user, staff, sysadm or xguest) to other domains such as dbus (or gkeyring) and then back to the initial user domain.

Quoted 6 lines

At the moment the policy uses variable types built using the user argument ($1) passed to the gnome/dbus role() interface.

Such approach has big limitations and the current framework is poorly designed with respect to the ability to perform the above mentioned transition.

As you realized, this kind if thing is not allowed:

    type_transition session_dbusd_t bin_t:process user_t;
    type_transition session_dbusd_t bin_t:process staff_t;
    type_transition session_dbusd_t bin_t:process sysadm_t;
    type_transition session_dbusd_t bin_t:process xguest_t;

There are typically two ways to fix it, the easiest is prefixed types so that the transitions become:

    type_transition user_dbusd_t bin_t:process user_t;
    type_transition staff_dbusd_t bin_t:process staff_t;

dbus is currently setup like this along with most other kinds of programs that need their own domain but then need to transition back to the user's shell (eg staff_sudo_t, and a few login type things are what first come to mind).

The other way is to have the program be selinux aware. Ie link with libselinux and query the policy for what should be used. For example, when running a user's cronjob, cron will look in /etc/selinux/mcs/contexts/default_contexts for the line and query all the role/type combos until it finds one that is allowed by the policy for that user. For these kinds of things the program basically does setexeccon() before the exec to manually set it so do not require the type_transition rules at all.

DBus is also SELinux aware and it looks like logic for something like this might already exist. On my system I have:
/etc/selinux/mcs/contexts/dbus_contexts but it's empty so not sure what should be in it.

There are many ways to fix a problem like this depending on a lot of things.

Quoted 11 lines
Quoted 6 lines

How exactly are you running into problems? Can you post a very minimal
command that triggers the problems? Is there some hello world I can put
in /usr/share/dbus-1/services and a command to trigger the issue?

It's more complex than just starting a command. There are problems in the underlying framework when the modified policy is loaded (conflicting type rules, i.e. conflicting type transitions).

Quoted 7 lines

One way to solve the problem is by changing the policy. I have had some success so far, however it's tricky, expensive and it's not the optimal solution.

A possible optimal solution is proposed in the last two or three messages that I posted (see the last two or three messages quoted above).

I still do not understand exactly what problem you are trying to solve tho. What is running and what is it trying to do? Can you show some error messages?

Are these lines the ones that are giving issues? Why do you need the lines at all?
dbus_domain_transition(at_spi_t, user_dbusd_t) dbus_domain_transition(gnome_settings_t, user_dbusd_t)

Wouldnt they just need dbus send_msg? Why does it need to exec the dbus daemon? It should already be running, they dont need to start it or anything. Can you show some error messages?

Quoted 7 lines
Quoted 3 lines

A lot of these other problems in this patch seem to be issues with dbus
so lets fix that first then the other ones will be easier.

If you want to help implementing a patch, we need to identify the code where such policy is actually enforced, so that there we can track the calling user domain to choose the right type transition.

We need to take a step back, there are too many issues mixed together with this patch. fixing the policy to allow conflicting types sounds like the wrong solution to whatever the problem is.

-- Jason

Quoted 3 lines

Regards,

Guido

#63 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Hello Jason,

thanks for getting back on this.

Quoted 1 line · Jason Zaman

On Thu, Sep 01, 2016 at 11:33:00AM +0200, Guido Trentalancia wrote:

[...]

Quoted 6 lines
Quoted 6 lines

The following messages are about a possible way to solve the problem
without changing the actual policy (which can be tricky):

http://oss.tresys.com/pipermail/refpolicy/2016-August/008397.html

Quoted 8 lines
Quoted 5 lines

http://oss.tresys.com/pipermail/refpolicy/2016-August/008398.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008400.html

So, you have an excellent excerpt now...

This helped a lot but I am still unclear what the original problem is.

The original problem is that the patch that I posted to update the gnome policy and the gnome file contexts leads to the conflicting type rules issues.

It's a limitation of the current situation.

What the patch does (its description) has been posted here:

http://oss.tresys.com/pipermail/refpolicy/2016-August/008324.html

Try by yourself, by applying such patch, then modifying as indicated by Christopher (moving dbus related statements from the gnome role template to the dbus module) and finally using the prefixed types (at the moment it uses user_dbusd_t, which won't work for all users).

It shouldn't take very long to apply the patch and modify it... At least you can touch the problem with your own hands.

Quoted 27 lines
Quoted 13 lines
Quoted 6 lines

If I followed correctly, it seems like the biggest problem currently
is
transitioning to/from dbus? can you show the "ps auxfZ | grep dbus"
lines?

The problem is transitioning from a user domain (user, staff, sysadm or
xguest) to other domains such as dbus (or gkeyring) and then back to
the initial user domain.

Quoted 7 lines

At the moment the policy uses variable types built using the user argument ($1) passed to the gnome/dbus role() interface.

Such approach has big limitations and the current framework is poorly
designed with respect to the ability to perform the above mentioned transition.

As you realized, this kind if thing is not allowed:
????type_transition session_dbusd_t bin_t:process user_t; ????type_transition session_dbusd_t bin_t:process staff_t; ????type_transition session_dbusd_t bin_t:process sysadm_t; ????type_transition session_dbusd_t bin_t:process xguest_t;

Quoted 5 lines

There are typically two ways to fix it, the easiest is prefixed types so
that the transitions become:
????type_transition user_dbusd_t bin_t:process user_t; ????type_transition staff_dbusd_t bin_t:process staff_t;

That is what doesn't work: the prefixed types. They lead to conflicting type rules.

Quoted 7 lines

dbus is currently setup like this along with most other kinds of programs that need their own domain but then need to transition back to
the user's shell (eg staff_sudo_t, and a few login type things are what
first come to mind).

Quoted 8 lines

The other way is to have the program be selinux aware. Ie link with libselinux and query the policy for what should be used. For example, when running a user's cronjob, cron will look in /etc/selinux/mcs/contexts/default_contexts for the line and query all the role/type combos until it finds one that is allowed by the policy for that user. For these kinds of things the program basically does setexeccon() before the exec to manually set it so do not require the type_transition rules at all.

I don't think this is the right approach for the problem at hand.

Quoted 5 lines

DBus is also SELinux aware and it looks like logic for something like this might already exist. On my system I have:
/etc/selinux/mcs/contexts/dbus_contexts but it's empty so not sure what
should be in it.?

It's probably reserved for dbus file contexts.

Quoted 33 lines

There are many ways to fix a problem like this depending on a lot of things.

Quoted 21 lines
Quoted 9 lines

How exactly are you running into problems? Can you post a very minimal
command that triggers the problems? Is there some hello world I can
put
in /usr/share/dbus-1/services and a command to trigger the issue?

It's more complex than just starting a command. There are problems in
the underlying framework when the modified policy is loaded (conflicting type rules, i.e. conflicting type transitions).

One way to solve the problem is by changing the policy. I have had some
success so far, however it's tricky, expensive and it's not the optimal
solution.

Quoted 3 lines

A possible optimal solution is proposed in the last two or three messages that I posted (see the last two or three messages quoted above).

I still do not understand exactly what problem you are trying to solve
tho. What is running and what is it trying to do? Can you show some error messages?

Quoted 4 lines

Are these lines the ones that are giving issues? Why do you need the lines at all?
dbus_domain_transition(at_spi_t, user_dbusd_t) dbus_domain_transition(gnome_settings_t, user_dbusd_t)

At the moment the gnome desktop is not confined. It runs in the user domain.

One of the things that the patch does is to start confining the gnome desktop.

If you start doing so, you'll end up with needing transitions that apparently cannot be supported by the current framework.

If you want to reproduce the problem, you need to start confining the gnome desktop: dconf, at-spi, gsettings, gnome-settings-daemon and so on. A way to start doing so is to try the patch (v4) that I posted and modify it as indicated by Christopher in the review.

Quoted 4 lines

Wouldnt they just need dbus send_msg? Why does it need to exec the dbus
daemon? It should already be running, they dont need to start it or anything. Can you show some error messages?

The system dbus daemon is running, not the session one.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

A lot of these other problems in this patch seem to be issues with
dbus
so lets fix that first then the other ones will be easier.

All I can say, is that the prefixed types don't work when you start confining the gnome desktop.

Try by yourself, it takes 5 minutes to apply the patch and modify it to use the prefixed types instead of "user_dbusd_t".

Quoted 9 lines
Quoted 5 lines

If you want to help implementing a patch, we need to identify the code
where such policy is actually enforced, so that there we can track the
calling user domain to choose the right type transition.

We need to take a step back, there are too many issues mixed together with this patch. fixing the policy to allow conflicting types sounds like the wrong solution to whatever the problem is.

At the moment, I still believe that is the optimal solution: allowing conflicts in the policy and resolving them at runtime by exploiting the knowledge of the user and role parts of the context.

Regards,

Guido

#64 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 156 lines · Guido Trentalancia

Hello Jason,

thanks for getting back on this.

Quoted 1 line · Jason Zaman

On Thu, Sep 01, 2016 at 11:33:00AM +0200, Guido Trentalancia wrote:

[...]

Quoted 6 lines
Quoted 6 lines

The following messages are about a possible way to solve the problem
without changing the actual policy (which can be tricky):

http://oss.tresys.com/pipermail/refpolicy/2016-August/008397.html

Quoted 8 lines
Quoted 5 lines

http://oss.tresys.com/pipermail/refpolicy/2016-August/008398.html

http://oss.tresys.com/pipermail/refpolicy/2016-August/008400.html

So, you have an excellent excerpt now...

This helped a lot but I am still unclear what the original problem is.

The original problem is that the patch that I posted to update the gnome policy and the gnome file contexts leads to the conflicting type rules issues.

It's a limitation of the current situation.

What the patch does (its description) has been posted here:

http://oss.tresys.com/pipermail/refpolicy/2016-August/008324.html

Try by yourself, by applying such patch, then modifying as indicated by Christopher (moving dbus related statements from the gnome role template to the dbus module) and finally using the prefixed types (at the moment it uses user_dbusd_t, which won't work for all users).

It shouldn't take very long to apply the patch and modify it... At least you can touch the problem with your own hands.

Quoted 27 lines
Quoted 13 lines
Quoted 6 lines

If I followed correctly, it seems like the biggest problem currently
is
transitioning to/from dbus? can you show the "ps auxfZ | grep dbus"
lines?

The problem is transitioning from a user domain (user, staff, sysadm or
xguest) to other domains such as dbus (or gkeyring) and then back to
the initial user domain.

Quoted 7 lines

At the moment the policy uses variable types built using the user argument ($1) passed to the gnome/dbus role() interface.

Such approach has big limitations and the current framework is poorly
designed with respect to the ability to perform the above mentioned transition.

As you realized, this kind if thing is not allowed:
????type_transition session_dbusd_t bin_t:process user_t; ????type_transition session_dbusd_t bin_t:process staff_t; ????type_transition session_dbusd_t bin_t:process sysadm_t; ????type_transition session_dbusd_t bin_t:process xguest_t;

Quoted 5 lines

There are typically two ways to fix it, the easiest is prefixed types so
that the transitions become:
????type_transition user_dbusd_t bin_t:process user_t; ????type_transition staff_dbusd_t bin_t:process staff_t;

That is what doesn't work: the prefixed types. They lead to conflicting type rules.

Quoted 7 lines

dbus is currently setup like this along with most other kinds of programs that need their own domain but then need to transition back to
the user's shell (eg staff_sudo_t, and a few login type things are what
first come to mind).

Quoted 8 lines

The other way is to have the program be selinux aware. Ie link with libselinux and query the policy for what should be used. For example, when running a user's cronjob, cron will look in /etc/selinux/mcs/contexts/default_contexts for the line and query all the role/type combos until it finds one that is allowed by the policy for that user. For these kinds of things the program basically does setexeccon() before the exec to manually set it so do not require the type_transition rules at all.

I don't think this is the right approach for the problem at hand.

Quoted 5 lines

DBus is also SELinux aware and it looks like logic for something like this might already exist. On my system I have:
/etc/selinux/mcs/contexts/dbus_contexts but it's empty so not sure what
should be in it.?

It's probably reserved for dbus file contexts.

Quoted 33 lines

There are many ways to fix a problem like this depending on a lot of things.

Quoted 21 lines
Quoted 9 lines

How exactly are you running into problems? Can you post a very minimal
command that triggers the problems? Is there some hello world I can
put
in /usr/share/dbus-1/services and a command to trigger the issue?

It's more complex than just starting a command. There are problems in
the underlying framework when the modified policy is loaded (conflicting type rules, i.e. conflicting type transitions).

One way to solve the problem is by changing the policy. I have had some
success so far, however it's tricky, expensive and it's not the optimal
solution.

Quoted 3 lines

A possible optimal solution is proposed in the last two or three messages that I posted (see the last two or three messages quoted above).

I still do not understand exactly what problem you are trying to solve
tho. What is running and what is it trying to do? Can you show some error messages?

Quoted 4 lines

Are these lines the ones that are giving issues? Why do you need the lines at all?
dbus_domain_transition(at_spi_t, user_dbusd_t) dbus_domain_transition(gnome_settings_t, user_dbusd_t)

At the moment the gnome desktop is not confined. It runs in the user domain.

One of the things that the patch does is to start confining the gnome desktop.

If you start doing so, you'll end up with needing transitions that apparently cannot be supported by the current framework.

If you want to reproduce the problem, you need to start confining the gnome desktop: dconf, at-spi, gsettings, gnome-settings-daemon and so on. A way to start doing so is to try the patch (v4) that I posted and modify it as indicated by Christopher in the review.

Quoted 6 lines
Quoted 4 lines

Wouldnt they just need dbus send_msg? Why does it need to exec the dbus
daemon? It should already be running, they dont need to start it or anything. Can you show some error messages?

The system dbus daemon is running, not the session one.

The session dbus is supposed to be started when you login first thing. at-spi shouldnt be trying to start it.

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

A lot of these other problems in this patch seem to be issues with
dbus
so lets fix that first then the other ones will be easier.

All I can say, is that the prefixed types don't work when you start confining the gnome desktop.

You still haven't explained exactly what is trying to run what? What are the starting domains? what is the program? what is it trying to run? what are the domains (before and after the patch) of the things it tries to run? What are the error messages?

Quoted 2 lines

Try by yourself, it takes 5 minutes to apply the patch and modify it to use the prefixed types instead of "user_dbusd_t".

Yeah, I know the rules dont work, I can see that without even building. My question is why do you need the rules? You keep saying you need these rules but what *exactly* do they fix? Once we know that we can suggest other solutions.

Using user_dbusd_t is useless. your patch would fix it for user_t, but staff_t and any others would be still broken.

Quoted 17 lines
Quoted 9 lines
Quoted 5 lines

If you want to help implementing a patch, we need to identify the code
where such policy is actually enforced, so that there we can track the
calling user domain to choose the right type transition.

We need to take a step back, there are too many issues mixed together with this patch. fixing the policy to allow conflicting types sounds like the wrong solution to whatever the problem is.

At the moment, I still believe that is the optimal solution: allowing conflicts in the policy and resolving them at runtime by exploiting the knowledge of the user and role parts of the context.

Regards,

Guido

#65 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 1 line · Jason Zaman

On Thu, Sep 01, 2016 at 02:28:50PM +0200, Guido Trentalancia wrote:

[...]

Quoted 27 lines
Quoted 27 lines

At the moment the gnome desktop is not confined. It runs in the user
domain.

One of the things that the patch does is to start confining the gnome
desktop.

If you start doing so, you'll end up with needing transitions that apparently cannot be supported by the current framework.

If you want to reproduce the problem, you need to start confining the
gnome desktop: dconf, at-spi, gsettings, gnome-settings-daemon and so
on. A way to start doing so is to try the patch (v4) that I posted and
modify it as indicated by Christopher in the review.

Quoted 7 lines

Wouldnt they just need dbus send_msg? Why does it need to exec the
dbus
daemon? It should already be running, they dont need to start it or
anything. Can you show some error messages?

Quoted 4 lines
Quoted 1 line

The system dbus daemon is running, not the session one.

The session dbus is supposed to be started when you login first thing.

Yes, exactly.

Quoted 1 line

at-spi shouldnt be trying to start it.

Who said that ? At-spi starts with Gnome from the xdg autostart directory by default.

Quoted 20 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

A lot of these other problems in this patch seem to be issues with
dbus
so lets fix that first then the other ones will be easier.

All I can say, is that the prefixed types don't work when you start confining the gnome desktop.

You still haven't explained exactly what is trying to run what? What are
the starting domains? what is the program? what is it trying to run? what are the domains (before and after the patch) of the things it tries
to run? What are the error messages?

Quoted 4 lines

Try by yourself, it takes 5 minutes to apply the patch and modify it to
use the prefixed types instead of "user_dbusd_t".

Quoted 7 lines

Yeah, I know the rules dont work, I can see that without even building.
My question is why do you need the rules? You keep saying you need these
rules but what *exactly* do they fix? Once we know that we can suggest
other solutions.

The new rules solve some problems in the current policy that don't let Gnome to start and also they confine other pieces of Gnome that are not currently confined (dconf, at-spi, gsd and so on).

Other things that are tackled by the patch are listed at the top of it (description of the patch). It is several things all together.

Quoted 3 lines

Using user_dbusd_t is useless. your patch would fix it for user_t, but
staff_t and any others would be still broken.

Yes, I know. It was so because the prefixed types don't work properly.

I think we are starting to loop around the same arguments...

Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 7 lines

If you want to help implementing a patch, we need to identify the
code
where such policy is actually enforced, so that there we can track
the
calling user domain to choose the right type transition.

We need to take a step back, there are too many issues mixed together
with this patch. fixing the policy to allow conflicting types sounds
like the wrong solution to whatever the problem is.

Quoted 5 lines
Quoted 5 lines

At the moment, I still believe that is the optimal solution:
allowing
conflicts in the policy and resolving them at runtime by exploiting the
knowledge of the user and role parts of the context.

The above is what is needed to achieve an optimal solution to the problem that I encountered while developing this gnome patch.

Guido

#66 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 4 lines · Guido Trentalancia via refpolicy
Quoted 1 line · Jason Zaman

On Thu, Sep 01, 2016 at 02:28:50PM +0200, Guido Trentalancia wrote:

Who said that ? At-spi starts with Gnome from the xdg autostart directory by default.

What happens if you start dbus-daemon --session from xdg autostart too?

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 7 lines

If you want to help implementing a patch, we need to identify the
code
where such policy is actually enforced, so that there we can track
the
calling user domain to choose the right type transition.

We need to take a step back, there are too many issues mixed together
with this patch. fixing the policy to allow conflicting types sounds
like the wrong solution to whatever the problem is.

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines

At the moment, I still believe that is the optimal solution:
allowing
conflicts in the policy and resolving them at runtime by exploiting the
knowledge of the user and role parts of the context.

The above is what is needed to achieve an optimal solution to the problem that I encountered while developing this gnome patch.

Again ... *what problem*? show me the error messages you get without this patch applied. You keep saying that what you have done is optimal to solve the problem but you have not explained what the problem is.

Do you need atspi to be able to exec dbus-daemon? What happens if you start dbus-daemon before atspi?

Why cant you just prefix the atspi domains too? type_transition staff_atspi_t dbusd_exec_t:process staff_dbusd_t; type_transition user_atspi_t dbusd_exec_t:process user_dbusd_t;

-- Jason

#67 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 5 lines · Jason Zaman
Quoted 3 lines · Guido Trentalancia via refpolicy
Quoted 1 line · Jason Zaman
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

On Thu, Sep 01, 2016 at 02:28:50PM +0200, Guido Trentalancia wrote:

Who said that ? At-spi starts with Gnome from the xdg autostart directory by default.

What happens if you start dbus-daemon --session from xdg autostart too?

The DBUS session daemon is not designed to be started from xdg autostart. There must be multiple instances of it.

Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
Quoted 22 lines
Quoted 10 lines
Quoted 9 lines

If you want to help implementing a patch, we need to identify
the
code
where such policy is actually enforced, so that there we can
track
the
calling user domain to choose the right type transition.

Quoted 5 lines

We need to take a step back, there are too many issues mixed together
with this patch. fixing the policy to allow conflicting types sounds
like the wrong solution to whatever the problem is.

At the moment, I still believe that is the optimal solution:
allowing
conflicts in the policy and resolving them at runtime by exploiting
the
knowledge of the user and role parts of the context.

Quoted 5 lines
Quoted 2 lines

The above is what is needed to achieve an optimal solution to the problem that I encountered while developing this gnome patch.

Again ... *what problem*? show me the error messages you get without this patch applied. You keep saying that what you have done is

As already explained, without the patch applied, Gnome doesn't start, pulseaudio doesn't work fine, there are permissions granted that are not strictly needed and however it is not confined properly (there are Gnome processes running in the user domain, which instead should run in their own domain).

Quoted 2 lines

optimal
to solve the problem but you have not explained what the problem is.

I have no other ways of explaining it.

The others have understood the problem, perhaps you can read their replies to get more insight...

Quoted 8 lines

Do you need atspi to be able to exec dbus-daemon? What happens if you start dbus-daemon before atspi?

Why cant you just prefix the atspi domains too? type_transition staff_atspi_t dbusd_exec_t:process staff_dbusd_t; type_transition user_atspi_t dbusd_exec_t:process user_dbusd_t;

-- Jason

Guido

#68 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Jason Zaman

Hello Jason,

I'll try another time to answer your question...

Quoted 41 lines · Jason Zaman
Quoted 7 lines · Guido Trentalancia via refpolicy
Quoted 3 lines · Jason Zaman

On Thu, Sep 01, 2016 at 02:28:50PM +0200, Guido Trentalancia wrote:

Who said that ? At-spi starts with Gnome from the xdg autostart directory by default.

What happens if you start dbus-daemon --session from xdg autostart too?

Quoted 28 lines
Quoted 27 lines
Quoted 27 lines
Quoted 15 lines
Quoted 5 lines
Quoted 9 lines

If you want to help implementing a patch, we need to identify
the
code
where such policy is actually enforced, so that there we can
track
the
calling user domain to choose the right type transition.

Quoted 5 lines

We need to take a step back, there are too many issues mixed together
with this patch. fixing the policy to allow conflicting types sounds
like the wrong solution to whatever the problem is.

At the moment, I still believe that is the optimal solution:
allowing
conflicts in the policy and resolving them at runtime by exploiting
the
knowledge of the user and role parts of the context.

Quoted 7 lines
Quoted 2 lines

The above is what is needed to achieve an optimal solution to the problem that I encountered while developing this gnome patch.

Again ... *what problem*? show me the error messages you get without this patch applied. You keep saying that what you have done is optimal
to solve the problem but you have not explained what the problem is.

The main problem that the patch was trying to sort out is to allow Gnome to run with the Reference Policy and to confine it better (for a full description, please refer to the latest version of the patch).

In this case, there isn't just one specific error message. There is a series of permissions denied in the log files and the desktop won't start (as in not passing the xdm login screen, for example) or it won't function properly.

While developing the above mentioned patch, I came across a problem with the policy: conflicting type rules.

The specific error message in this case is "Conflicting type rules" when loading the policy (it compiles fine).

You can reproduce it by applying the patch and then changing the "user_dbusd_t" type that I have used initially to the prefixed type "$1_dbusd_t".

To solve the latter problem, I believe that the optimal solution is not to change the policy further, but to:

- change the existing source code so that it adds the conflicting type rules without generating an error;
- resolve the conflict at runtime by exploiting the knowledge of the user and role parts of the context.

I was asking other people what they think of such proposed solution and, provided that it sounds feasible to them, if they have specific ideas on its implementation.

I hope it does make sense now...

Quoted 4 lines

Do you need atspi to be able to exec dbus-daemon? What happens if you start dbus-daemon before atspi?

Why cant you just prefix the atspi domains too?

I don't know if prefixing the other domains works.

However, if you post a revised patch, I can test it and let you know.

At the moment, I have removed the prefixed types and I am working with static types prefixed by the keyword "session". It works, but it surely isn't what I would call optimal.

Quoted 2 lines

type_transition staff_atspi_t dbusd_exec_t:process staff_dbusd_t; type_transition user_atspi_t dbusd_exec_t:process user_dbusd_t;

Regards,

Guido

#69 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 7 lines · Guido Trentalancia via refpolicy
Quoted 1 line

Why cant you just prefix the atspi domains too?

I don't know if prefixing the other domains works.
However, if you post a revised patch, I can test it and let you know. At the moment, I have removed the prefixed types and I am working with static types prefixed by the keyword "session". It works, but it surely isn't what I would call optimal.

I'm pretty sure removing prefixes is the opposite direction from where you need to be going.

Xfce uses at-spi-bus-launcher so I can confine that and gconfd first so we can get things working in general. If those work then the rest of the parts of gnome would follow the same pattern.

-- Jason

Quoted 11 lines
Quoted 2 lines

type_transition staff_atspi_t dbusd_exec_t:process staff_dbusd_t; type_transition user_atspi_t dbusd_exec_t:process user_dbusd_t;

Regards,

Guido

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

#70 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

In reply to Jason Zaman

Hello Jason.

I have an update about the advice that you kindly provided...

Quoted 49 lines · Jason Zaman
Quoted 7 lines · Guido Trentalancia via refpolicy
Quoted 3 lines · Jason Zaman

On Thu, Sep 01, 2016 at 02:28:50PM +0200, Guido Trentalancia wrote:

Who said that ? At-spi starts with Gnome from the xdg autostart directory by default.

What happens if you start dbus-daemon --session from xdg autostart too?

Quoted 28 lines
Quoted 21 lines
Quoted 21 lines
Quoted 20 lines
Quoted 5 lines
Quoted 9 lines

If you want to help implementing a patch, we need to identify
the
code
where such policy is actually enforced, so that there we can
track
the
calling user domain to choose the right type transition.

We need to take a step back, there are too many issues mixed together
with this patch. fixing the policy to allow conflicting types sounds
like the wrong solution to whatever the problem is.

Quoted 6 lines
Quoted 6 lines

At the moment, I still believe that is the optimal solution:
allowing
conflicts in the policy and resolving them at runtime by exploiting
the
knowledge of the user and role parts of the context.

Quoted 2 lines

The above is what is needed to achieve an optimal solution to the problem that I encountered while developing this gnome patch.

Again ... *what problem*? show me the error messages you get without this patch applied. You keep saying that what you have done is optimal
to solve the problem but you have not explained what the problem is.

Quoted 6 lines

Do you need atspi to be able to exec dbus-daemon? What happens if you start dbus-daemon before atspi?

Why cant you just prefix the atspi domains too? type_transition staff_atspi_t dbusd_exec_t:process staff_dbusd_t; type_transition user_atspi_t dbusd_exec_t:process user_dbusd_t;

The latter (prefixing the other domains, such as at_spi, that at some point need to transition back to the user domain) solved the problem that I was experiencing !

Brilliant idea... Thanks very much for your advice !!

Unfortunately, I don't know if I can really update this patch for the mailing list and resubmit it, because there are very strict requirements on its length.

It's a shame, but I cannot split it in several parts because this patch is made of highly interdependent bits...

Best regards,

Guido

#71 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Quoted 9 lines · Jason Zaman
Quoted 3 lines

Why cant you just prefix the atspi domains too? type_transition staff_atspi_t dbusd_exec_t:process staff_dbusd_t; type_transition user_atspi_t dbusd_exec_t:process user_dbusd_t;

The latter (prefixing the other domains, such as at_spi, that at some point need to transition back to the user domain) solved the problem that I was experiencing !

Quoted 8 lines

Brilliant idea... Thanks very much for your advice !!

Unfortunately, I don't know if I can really update this patch for the mailing list and resubmit it, because there are very strict requirements on its length.

It's a shame, but I cannot split it in several parts because this patch is made of highly interdependent bits...

Great that it works!
Can you rebase the patch on master then send me the file directly (not to the list since it's big). Then I can take a look and comment.

If this works well for dbus session programs we probably want to make a few templates to handle the common stuff first. Then we can do the specific patches separately for atspi and the other programs afterwards. It's a big change but I'm sure we can figure out a good way to organise it.

I use xfce so will check if there are more things that use dbus so we can make the templates good for everything at the same time.

-- Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.tresys.com/pipermail/refpolicy/attachments/20160906/6f094538/attachment.html

#72 lore raw

PATCH v4 1/1 Update for the gnome policy and file contexts

Hello Jason.

Quoted 14 lines · Jason Zaman
Quoted 6 lines · Jason Zaman
Quoted 3 lines

Why cant you just prefix the atspi domains too? type_transition staff_atspi_t dbusd_exec_t:process staff_dbusd_t; type_transition user_atspi_t dbusd_exec_t:process user_dbusd_t;

The latter (prefixing the other domains, such as at_spi, that at

some

Quoted 1 line

point need to transition back to the user domain) solved the

problem

Quoted 5 lines

that I was experiencing !

Brilliant idea... Thanks very much for your advice !!

Unfortunately, I don't know if I can really update this patch for

Quoted 8 lines

the

Quoted 4 lines

mailing list and resubmit it, because there are very strict requirements on its length.

It's a shame, but I cannot split it in several parts because this

patch

Quoted 1 line

is made of highly interdependent bits...

Great that it works!

Yes, thanks very much to your advice !

Quoted 2 lines

Can you rebase the patch on master then send me the file directly (not to the list since it's big). Then I can take a look and comment.

I am still completing it. There are still bits that are getting changed and improved every now and then while it gets tested better.

Quoted 5 lines

If this works well for dbus session programs we probably want to make a few templates to handle the common stuff first. Then we can do the specific patches separately for atspi and the other programs afterwards. It's a big change but I'm sure we can figure out a good way to organise it.

I really hope it will get committed.

Quoted 2 lines

I use xfce so will check if there are more things that use dbus so we can make the templates good for everything at the same time.

There is only one strange thing happening: when I start gnome-terminal from the gnome-shell menu (it executes /usr/bin/gnome-terminal, which then executes /usr/libexec/gnome-terminal-server), it runs in the $1_dbusd_t domain.

Other applications when are started from the gnome-shell menu do not end up running in the $1_dbusd_t domain but in the user domain, as desirable.

It am not sure why the above is happening. I can get it to transition from $1_dbusd_t to $1_t, which sorts things out, but it would be better if it was running in gnome_terminal_t and gnome_terminal_server_t respectively.

Best regards,

Guido