Skip to contentSkip to conversation

Update the policy and file contexts for the xserver module

PATCH Superseded Guido Trentalancia 4 participants 21 messages Aug 13, 2016 – Aug 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update the policy and file contexts for the xserver module

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm;
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib(64)?/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
 
 /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 
policy/modules/services/xserver.if +21 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 	typeattribute $1 x_domain;
 	typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`
+	gen_require(`
+		type xdm_t;
+		class dbus send_msg;
+        ')
+
+	allow $1 xdm_t:dbus send_msg;
+	allow xdm_t $1:dbus send_msg;
+')
policy/modules/services/xserver.te +4 -0
@@ -507,6 +507,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_dbus_chat(xdm_t)
+')
+
+optional_policy(`
 	consolekit_dbus_chat(xdm_t)
 ')
 
#1 lore raw

PATCH 1/1 Update the policy and file contexts for the xserver module

Quoted 17 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm;
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)

policy/modules/services/xserver.fc HOME_DIR/\.Xauthority.* -- gen_context(s · line 77

Quoted 4 lines
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib(64)?/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)

Not sure but I do not think that the (64)? is needed anymore as per:

https://github.com/TresysTechnology/refpolicy/blob/master/config/file_contexts.subs_dist#L18

Quoted 48 lines
policy/modules/services/xserver.fc +0 -0
 /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 
policy/modules/services/xserver.if +21 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 	typeattribute $1 x_domain;
 	typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`
+	gen_require(`
+		type xdm_t;
+		class dbus send_msg;
+        ')
+
+	allow $1 xdm_t:dbus send_msg;
+	allow xdm_t $1:dbus send_msg;
+')
policy/modules/services/xserver.te +4 -0
@@ -507,6 +507,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_dbus_chat(xdm_t)
+')
+
+optional_policy(`
 	consolekit_dbus_chat(xdm_t)
 ')
 

_______________________________________________
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/b42f0b58/attachment-0001.bin 
#2 lore raw

PATCH 1/1 Update the policy and file contexts for the xserver module

Quoted 25 lines · Dominick Grift
Quoted 17 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm;
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)

policy/modules/services/xserver.fc HOME_DIR/\.Xauthority.* -- gen_context(s · line 77

Quoted 4 lines
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib(64)?/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)

Not sure but I do not think that the (64)? is needed anymore as per:

Quoted 1 line

https://github.com/TresysTechnology/refpolicy/blob/master/config/file_contexts.subs_dist#L18

That should be the case.

Signature · 1 line
Chris PeBenito
#3 lore raw

PATCH v2 1/1 Update the policy and file contexts for the xserver module

In reply to Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm;
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
 
 /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 
policy/modules/services/xserver.if +21 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 	typeattribute $1 x_domain;
 	typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`
+	gen_require(`
+		type xdm_t;
+		class dbus send_msg;
+        ')
+
+	allow $1 xdm_t:dbus send_msg;
+	allow xdm_t $1:dbus send_msg;
+')
policy/modules/services/xserver.te +4 -0
@@ -507,6 +507,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_dbus_chat(xdm_t)
+')
+
+optional_policy(`
 	consolekit_dbus_chat(xdm_t)
 ')
 
#4 lore raw

PATCH v2 1/1 Update the policy and file contexts for the xserver module

Quoted 33 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm;
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
 
 /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 
policy/modules/services/xserver.if +3 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 	typeattribute $1 x_domain;
 	typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>

policy/modules/services/xserver.if interface(`xserver_unconfined',` · line 1306

Quoted 10 lines
policy/modules/services/xserver.if +10 -0
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`

Why does this interface need to be added, if it isn't going to be used (it's not used below).

If it is still needed, then the interface should be xserver_dbus_chat_xdm()

Quoted 20 lines
policy/modules/services/xserver.if +8 -0
+	gen_require(`
+		type xdm_t;
+		class dbus send_msg;
+        ')
+
+	allow $1 xdm_t:dbus send_msg;
+	allow xdm_t $1:dbus send_msg;
+')
policy/modules/services/xserver.te +4 -0
@@ -507,6 +507,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_dbus_chat(xdm_t)
+')
+
+optional_policy(`
 	consolekit_dbus_chat(xdm_t)
 ')
Signature · 1 line
Chris PeBenito
#5 lore raw

PATCH v2 1/1 Update the policy and file contexts for the xserver module

Quoted 48 lines · Chris PeBenito
Quoted 33 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm;
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
 
 /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 
policy/modules/services/xserver.if +3 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 	typeattribute $1 x_domain;
 	typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>

policy/modules/services/xserver.if interface(`xserver_unconfined',` · line 1306

Quoted 10 lines
policy/modules/services/xserver.if +10 -0
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`

Why does this interface need to be added, if it isn't going to be used (it's not used below).

Quoted 3 lines

If it is still needed, then the interface should be xserver_dbus_chat_xdm()

Seems to be used here though:

http://oss.tresys.com/pipermail/refpolicy/2016-August/008213.html

Quoted 22 lines
Quoted 20 lines
policy/modules/services/xserver.if +8 -0
+	gen_require(`
+		type xdm_t;
+		class dbus send_msg;
+        ')
+
+	allow $1 xdm_t:dbus send_msg;
+	allow xdm_t $1:dbus send_msg;
+')
policy/modules/services/xserver.te +4 -0
@@ -507,6 +507,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_dbus_chat(xdm_t)
+')
+
+optional_policy(`
 	consolekit_dbus_chat(xdm_t)
 ')
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/bf78ff42/attachment.bin 
#6 lore raw

PATCH v2 1/1 Update the policy and file contexts for the xserver module

Quoted 49 lines · Dominick Grift
Quoted 48 lines · Chris PeBenito
Quoted 33 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm;
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
 
 /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 
policy/modules/services/xserver.if +3 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 	typeattribute $1 x_domain;
 	typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>

policy/modules/services/xserver.if interface(`xserver_unconfined',` · line 1306

Quoted 10 lines
policy/modules/services/xserver.if +10 -0
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`

Why does this interface need to be added, if it isn't going to be used (it's not used below).

Quoted 7 lines
Quoted 3 lines

If it is still needed, then the interface should be xserver_dbus_chat_xdm()

Seems to be used here though:

http://oss.tresys.com/pipermail/refpolicy/2016-August/008213.html

You're right. With all of the patches, I missed this connection.

Signature · 1 line
Chris PeBenito
#7 lore raw

PATCH v2 1/1 Update the policy and file contexts for the xserver module

Quoted 66 lines · Chris PeBenito
Quoted 65 lines · Dominick Grift
Quoted 63 lines · Chris PeBenito
Quoted 44 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm;
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)

---
refpolicy-git-06082016-orig/policy/modules/services/xserver.fc

2016-08-06 21:26:43.295774282 +0200
+++ refpolicy-git-06082016/policy/modules/services/xserver.fc   
2016-08-13 16:20:35.731361535 +0200
(quoted diff) +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*    --    gen_context(s
 /usr/lib/xorg/Xorg\.wrap    --   
 gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg    --   
 gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap    --   
 gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib/X11/xdm/Xsession    --   

gen_context(system_u:object_r:xsession_exec_t,s0)

/usr/sbin/lightdm --
gen_context(system_u:object_r:xdm_exec_t,s0)

---
refpolicy-git-06082016-orig/policy/modules/services/xserver.if

2016-08-06 21:26:43.295774282 +0200
+++ refpolicy-git-06082016/policy/modules/services/xserver.if   
2016-08-13 15:01:34.028150851 +0200
policy/modules/services/xserver.if +3 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
     typeattribute $1 x_domain;
     typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>

policy/modules/services/xserver.if interface(`xserver_unconfined',` · line 1306

Quoted 10 lines
policy/modules/services/xserver.if +10 -0
+##    Send and receive messages from
+##    xdm over dbus.
+## </summary>
+## <param name="domain">
+##    <summary>
+##    Domain allowed access.
+##    </summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`

Why does this interface need to be added, if it isn't going to be used (it's not used below).

If it is still needed, then the interface should be xserver_dbus_chat_xdm()

Quoted 6 lines
Quoted 3 lines

Seems to be used here though:

http://oss.tresys.com/pipermail/refpolicy/2016-August/008213.html

You're right. With all of the patches, I missed this connection.

Yes. Too much. There are some other things that slipped through that should'nt have.

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/096b8e89/attachment-0001.bin 
#8 lore raw

PATCH v2 1/1 Update the policy and file contexts for the xserver module

Hello Dominick and Chris.

Quoted 4 lines · Dominick Grift
Quoted 3 lines · Chris PeBenito
Quoted 2 lines · Dominick Grift
Quoted 1 line · Chris PeBenito

On 08/13/16 10:23, Guido Trentalancia wrote:

[...]

Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 28 lines
Quoted 13 lines

refpolicy-git-06082016-
orig/policy/modules/services/xserver.if???

2016-08-06 21:26:43.295774282 +0200
+++ refpolicy-git-
06082016/policy/modules/services/xserver.if???
2016-08-13 15:01:34.028150851 +0200
policy/modules/services/xserver.if +3 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 ?????typeattribute $1 x_domain;
 ?????typeattribute $1 xserver_unconfined_type;
 ?')
+
+########################################
+## <summary>

policy/modules/services/xserver.if interface(`xserver_unconfined',` · line 1306

Quoted 10 lines
policy/modules/services/xserver.if +10 -0
+##????Send and receive messages from
+##????xdm over dbus.
+## </summary>
+## <param name="domain">
+##????<summary>
+##????Domain allowed access.
+##????</summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`

Why does this interface need to be added, if it isn't going to be used
(it's not used below).

Quoted 4 lines

If it is still needed, then the interface should be xserver_dbus_chat_xdm()

Seems to be used here though:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

http://oss.tresys.com/pipermail/refpolicy/2016-August/008213.html

You're right.??With all of the patches, I missed this connection.

Yes. Too much. There are some other things that slipped through that should'nt have.

They are all very small patches, but they bring a lot of improvement in terms of usability ! The Reference Policy is substantially improved after the changes have been merged.

Also, I believe only the gnome patch is missing to complete the job.

Best regards,

Guido

#9 lore raw

PATCH v2 1/1 Update the policy and file contexts for the xserver module

In reply to Chris PeBenito
Quoted 48 lines · Chris PeBenito
Quoted 33 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm;
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
 
 /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 
policy/modules/services/xserver.if +3 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 	typeattribute $1 x_domain;
 	typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>

policy/modules/services/xserver.if interface(`xserver_unconfined',` · line 1306

Quoted 10 lines
policy/modules/services/xserver.if +10 -0
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`

Why does this interface need to be added, if it isn't going to be used (it's not used below).

Quoted 1 line

If it is still needed, then the interface should be xserver_dbus_chat_xdm()

Also IMHO this should ideally have been split out of xserver module. You dont need a desktop manager for xserver (startx). That xserver module, and the xdm domain are big enough on their own.

Quoted 24 lines
Quoted 22 lines
policy/modules/services/xserver.if +8 -0
+	gen_require(`
+		type xdm_t;
+		class dbus send_msg;
+        ')
+
+	allow $1 xdm_t:dbus send_msg;
+	allow xdm_t $1:dbus send_msg;
+')
policy/modules/services/xserver.te +4 -0
@@ -507,6 +507,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_dbus_chat(xdm_t)
+')
+
+optional_policy(`
 	consolekit_dbus_chat(xdm_t)
 ')
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/a4ad082b/attachment.bin 
#10 lore raw

PATCH v2 1/1 Update the policy and file contexts for the xserver module

In reply to Chris PeBenito

Hello Chris !

Quoted 59 lines · Chris PeBenito
Quoted 43 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with ? xdm;
- added permission to chat over dbus with colord.

---

?policy/modules/services/xserver.fc |????1 +
?policy/modules/services/xserver.if |???21 +++++++++++++++++++++
?policy/modules/services/xserver.te |????4 ++++

?3 files changed, 26 insertions(+)

--- refpolicy-git-06082016-orig/policy/modules/services/xserver.fc

2016-08-06 21:26:43.295774282 +0200
+++ refpolicy-git-06082016/policy/modules/services/xserver.fc	
2016-08-13 16:20:35.731361535 +0200
(quoted diff) +0 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_cont

ext(s
?/usr/lib/xorg/Xorg\.wrap -- gen_context(system_u:obj
ect_r:xserver_exec_t,s0)
?/usr/lib/xorg-server/Xorg -- gen_context(system_u:ob
ject_r:xserver_exec_t,s0)
?/usr/lib/xorg-server/Xorg\.wrap -- gen_context(syste
m_u:object_r:xserver_exec_t,s0)
+/usr/lib/X11/xdm/Xsession -- gen_context(system_u:ob
ject_r:xsession_exec_t,s0)

?/usr/sbin/lightdm -- gen_context(system_u:object_r:x
dm_exec_t,s0)

--- refpolicy-git-06082016-orig/policy/modules/services/xserver.if

2016-08-06 21:26:43.295774282 +0200
+++ refpolicy-git-06082016/policy/modules/services/xserver.if	
2016-08-13 15:01:34.028150851 +0200
policy/modules/services/xserver.if +3 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 ?	typeattribute $1 x_domain;
 ?	typeattribute $1 xserver_unconfined_type;
 ?')
+
+########################################
+## <summary>

policy/modules/services/xserver.if interface(`xserver_unconfined',` · line 1306

Quoted 10 lines
policy/modules/services/xserver.if +10 -0
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xdm_dbus_chat',`

Why does this interface need to be added, if it isn't going to be used?
(it's not used below).

Quoted 2 lines

If it is still needed, then the interface should be xserver_dbus_chat_xdm()

Thanks for pointing this out. It's used by userdomain.if (userdom_common_user_template). Please not that you already merged the userdomain patch.

I am now going to rename it, resubmit this patch and submit a short patch to rename it in userdomain which you already merged.

Best regards,

Guido

#11 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

In reply to Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm (currently used by the userdomain module in the common user template);
- added permission to chat over dbus with colord.

---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
 
 /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 
policy/modules/services/xserver.if +21 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 	typeattribute $1 x_domain;
 	typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xserver_dbus_chat_xdm',`
+	gen_require(`
+		type xdm_t;
+		class dbus send_msg;
+        ')
+
+	allow $1 xdm_t:dbus send_msg;
+	allow xdm_t $1:dbus send_msg;
+')
policy/modules/services/xserver.te +4 -0
@@ -507,6 +507,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_dbus_chat(xdm_t)
+')
+
+optional_policy(`
 	consolekit_dbus_chat(xdm_t)
 ')
 
#12 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

Quoted 7 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm (currently used by the userdomain module in the common user template);
- added permission to chat over dbus with colord.

Merged, though I moved the interface up.

Quoted 62 lines
---
 policy/modules/services/xserver.fc |    1 +
 policy/modules/services/xserver.if |   21 +++++++++++++++++++++
 policy/modules/services/xserver.te |    4 ++++
 3 files changed, 26 insertions(+)
policy/modules/services/xserver.fc +1 -0
@@ -74,6 +74,7 @@ HOME_DIR/\.Xauthority.*	--	gen_context(s
 /usr/lib/xorg/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg	--	gen_context(system_u:object_r:xserver_exec_t,s0)
 /usr/lib/xorg-server/Xorg\.wrap	--	gen_context(system_u:object_r:xserver_exec_t,s0)
+/usr/lib/X11/xdm/Xsession	--	gen_context(system_u:object_r:xsession_exec_t,s0)
 
 /usr/sbin/lightdm	--	gen_context(system_u:object_r:xdm_exec_t,s0)
 
policy/modules/services/xserver.if +21 -0
@@ -1291,3 +1291,24 @@ interface(`xserver_unconfined',`
 	typeattribute $1 x_domain;
 	typeattribute $1 xserver_unconfined_type;
 ')
+
+########################################
+## <summary>
+##	Send and receive messages from
+##	xdm over dbus.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`xserver_dbus_chat_xdm',`
+	gen_require(`
+		type xdm_t;
+		class dbus send_msg;
+        ')
+
+	allow $1 xdm_t:dbus send_msg;
+	allow xdm_t $1:dbus send_msg;
+')
policy/modules/services/xserver.te +4 -0
@@ -507,6 +507,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	colord_dbus_chat(xdm_t)
+')
+
+optional_policy(`
 	consolekit_dbus_chat(xdm_t)
 ')
 

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

Signature · 1 line
Chris PeBenito
#13 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

Hello Chris.

Quoted 10 lines · Chris PeBenito
Quoted 7 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with ? xdm (currently used by the userdomain module in ? the common user template);
- added permission to chat over dbus with colord.

Merged, though I moved the interface up.

Excellent.

This is what is missing now:

- the gnome module: this is very important, I am now improving it as suggested by Dominick Grift;
- the dbus patch for binary execution (otherwise it refuses to start);
- the new fc_sort patch if you like the idea of installing it system- wide to avoid execution permission problems (e.g. in /usr/src);
- a patch to make use of the new module_load permission to load kernel module (problem of the appropriate location for modules_object_t).

It's all about patches that are being reviewed, there are no other patches...

Regards,

Guido

#14 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

Quoted 26 lines · Guido Trentalancia

Hello Chris.

Quoted 10 lines · Chris PeBenito
Quoted 7 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm (currently used by the userdomain module in the common user template);
- added permission to chat over dbus with colord.

Merged, though I moved the interface up.

Excellent.

This is what is missing now:

- the gnome module: this is very important, I am now improving it as suggested by Dominick Grift;
- the dbus patch for binary execution (otherwise it refuses to start);
- the new fc_sort patch if you like the idea of installing it system- wide to avoid execution permission problems (e.g. in /usr/src);
- a patch to make use of the new module_load permission to load kernel module (problem of the appropriate location for modules_object_t).

Quoted 2 lines

It's all about patches that are being reviewed, there are no other patches...

In the future I'd ask that you post related patches as a series, so we can see that patches are related.

I've pushed all of the merged changes, plus my modifications. Please rebase any remaining patches.

Signature · 1 line
Chris PeBenito
#15 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

Quoted 13 lines · Chris PeBenito
Quoted 12 lines · Guido Trentalancia

Hello Chris.

Quoted 9 lines · Chris PeBenito
Quoted 7 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm (currently used by the userdomain module in the common user template);
- added permission to chat over dbus with colord.

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Merged, though I moved the interface up.

Excellent.

What distro (or version of distro) are you on?

Quoted 5 lines
Quoted 5 lines

This is what is missing now:

- the gnome module: this is very important, I am now improving it as suggested by Dominick Grift;
- the dbus patch for binary execution (otherwise it refuses to start);

I have the same file on gentoo and dbus all starts fine. In general things marked bin_t are not terrible so I'm not hugely against adding the perm. Is this for a new version of dbus or something? I'm on sys-apps/dbus-1.10.8-r1. Ideally i'd like to see where in the code its calling that and that would give more insight to why. /bin/false is frequently used in /etc/passwd so it might be something to do with that?

Quoted 2 lines
Quoted 2 lines

- the new fc_sort patch if you like the idea of installing it system- wide to avoid execution permission problems (e.g. in /usr/src);

sysadm_t has full permissions in to src_t already? otherwise compiling the kernel wouldnt work either since it has many scripts it needs to run too.
How are you installing the sources? in general the package manager should be force-resetting the labels on the files as it merges them into the main FS.

Quoted 2 lines
Quoted 2 lines

- a patch to make use of the new module_load permission to load kernel module (problem of the appropriate location for modules_object_t).

I got a report on gentoo about things failing on kernel 4.7. I think this one is requried to fix it.

Quoted 6 lines
Quoted 3 lines

It's all about patches that are being reviewed, there are no other patches...

In the future I'd ask that you post related patches as a series, so we can see that patches are related.

Seconded, this makes it easier to follow.

$ git format-patch origin/master..mybranch
$ git send-email --to=refpolicy at oss.tresys.com --compose 000*.patch
the --compose switch will open an editor so you can write a short message
about the series and then all the other patches are replies to that. 

-- Jason

Quoted 9 lines

I've pushed all of the merged changes, plus my modifications. Please rebase any remaining patches.

Signature · 5 lines
Chris PeBenito
_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy
#16 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

Hello Jason.

Thanks for getting back on this.

Quoted 14 lines · Jason Zaman
Quoted 13 lines · Chris PeBenito
Quoted 12 lines · Guido Trentalancia

Hello Chris.

Quoted 9 lines · Chris PeBenito
Quoted 7 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with ? xdm (currently used by the userdomain module in ? the common user template);
- added permission to chat over dbus with colord.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Merged, though I moved the interface up.

Excellent.

What distro (or version of distro) are you on?

It's not a distribution, but rather just Linux and GNU stuff built from scratch. It's not Linuxfromscratch, as I do not follow their way of building stuff, but similar to it.

It's as close as possible to the original source code (i.e. patches kept to the minimum and configure options closest to the default).

Quoted 11 lines
Quoted 7 lines
Quoted 7 lines

This is what is missing now:

- the gnome module: this is very important, I am now improving it as
suggested by Dominick Grift;
- the dbus patch for binary execution (otherwise it refuses to start);

I have the same file on gentoo and dbus all starts fine. In general things marked bin_t are not terrible so I'm not hugely against adding the perm. Is this for a new version of dbus or something?

I am always using the latest version of everything, so it's latest dbus.

Please note that there should be references of this in the source code... Did you get a chance to look there ?

Might be the following:

dbus/dbus-transport-unix.c:??c = dbus_connection_open ("unixexec:argv0=false,argv1=foobar,path=/bin/false", &error);

Also, many .service files have the following:

Exec=/bin/false

Quoted 2 lines

I'm on sys-apps/dbus-1.10.8-r1. Ideally i'd like to see where in the code its calling that and that would give more insight to why.

See above.

Quoted 3 lines

/bin/false is frequently used in /etc/passwd so it might be something to
do with that?

I don't think so. It's used in /etc/passwd to deny a login for virtual users (such as daemons).

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

- the new fc_sort patch if you like the idea of installing it system-
wide to avoid execution permission problems (e.g. in /usr/src);

sysadm_t has full permissions in to src_t already? otherwise compiling

It's a bug in the git module then. It should create files in /usr/src with automatic transition to the src_t type.

Quoted 8 lines

the kernel wouldnt work either since it has many scripts it needs to run
too.
How are you installing the sources? in general the package manager should be force-resetting the labels on the files as it merges them into
the main FS.

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

- a patch to make use of the new module_load permission to load kernel
module (problem of the appropriate location for modules_object_t).

I got a report on gentoo about things failing on kernel 4.7. I think this one is requried to fix it.

See above, we need to tackle the git module with a simple fix.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

It's all about patches that are being reviewed, there are no other
patches...

Apart from the lvm module that was left out for some reason.

Quoted 4 lines
Quoted 3 lines

In the future I'd ask that you post related patches as a series, so we?
can see that patches are related.

Quoted 8 lines

Seconded, this makes it easier to follow.

$ git format-patch origin/master..mybranch
$ git send-email --to=refpolicy at oss.tresys.com --compose 000*.patch
the --compose switch will open an editor so you can write a short
message
about the series and then all the other patches are replies to that.?

-- Jason

Thanks Jason, I'll give it a try...

Regards,

Guido

#17 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

Quoted 47 lines · Guido Trentalancia

Hello Jason.

Thanks for getting back on this.

Quoted 14 lines · Jason Zaman
Quoted 13 lines · Chris PeBenito
Quoted 12 lines · Guido Trentalancia

Hello Chris.

Quoted 9 lines · Chris PeBenito
Quoted 7 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with xdm (currently used by the userdomain module in the common user template);
- added permission to chat over dbus with colord.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Merged, though I moved the interface up.

Excellent.

What distro (or version of distro) are you on?

It's not a distribution, but rather just Linux and GNU stuff built from scratch. It's not Linuxfromscratch, as I do not follow their way of building stuff, but similar to it.

It's as close as possible to the original source code (i.e. patches kept to the minimum and configure options closest to the default).

Quoted 11 lines
Quoted 7 lines
Quoted 7 lines

This is what is missing now:

- the gnome module: this is very important, I am now improving it as
suggested by Dominick Grift;
- the dbus patch for binary execution (otherwise it refuses to start);

I have the same file on gentoo and dbus all starts fine. In general things marked bin_t are not terrible so I'm not hugely against adding the perm. Is this for a new version of dbus or something?

I am always using the latest version of everything, so it's latest dbus.

Quoted 8 lines

Please note that there should be references of this in the source code... Did you get a chance to look there ?

Might be the following:

dbus/dbus-transport-unix.c: c = dbus_connection_open ("unixexec:argv0=false,argv1=foobar,path=/bin/false", &error);

For the record: just because i advice against this that means just that, not much. I am just rambling, saying what is on my mind. It is up to others to decide what is right and what is wrong for them.

I am fine with things either way. I just like to talk about this stuff and share some of my experiences.

Quoted 74 lines

Also, many .service files have the following:

Exec=/bin/false

Quoted 2 lines

I'm on sys-apps/dbus-1.10.8-r1. Ideally i'd like to see where in the code its calling that and that would give more insight to why.

See above.

Quoted 3 lines

/bin/false is frequently used in /etc/passwd so it might be something to
do with that?

I don't think so. It's used in /etc/passwd to deny a login for virtual users (such as daemons).

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

- the new fc_sort patch if you like the idea of installing it system-
wide to avoid execution permission problems (e.g. in /usr/src);

sysadm_t has full permissions in to src_t already? otherwise compiling

It's a bug in the git module then. It should create files in /usr/src with automatic transition to the src_t type.

Quoted 8 lines

the kernel wouldnt work either since it has many scripts it needs to run
too.
How are you installing the sources? in general the package manager should be force-resetting the labels on the files as it merges them into
the main FS.

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

- a patch to make use of the new module_load permission to load kernel
module (problem of the appropriate location for modules_object_t).

I got a report on gentoo about things failing on kernel 4.7. I think this one is requried to fix it.

See above, we need to tackle the git module with a simple fix.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

It's all about patches that are being reviewed, there are no other
patches...

Apart from the lvm module that was left out for some reason.

Quoted 4 lines
Quoted 3 lines

In the future I'd ask that you post related patches as a series, so we
can see that patches are related.

Quoted 8 lines

Seconded, this makes it easier to follow.

$ git format-patch origin/master..mybranch
$ git send-email --to=refpolicy at oss.tresys.com --compose 000*.patch
the --compose switch will open an editor so you can write a short
message
about the series and then all the other patches are replies to that. 

-- Jason

Thanks Jason, I'll give it a try...

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/20160815/fd880523/attachment.bin 
#18 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

In reply to Guido Trentalancia
Quoted 40 lines · Guido Trentalancia

Hello Jason.

Thanks for getting back on this.

Quoted 14 lines · Jason Zaman
Quoted 13 lines · Chris PeBenito
Quoted 12 lines · Guido Trentalancia

Hello Chris.

Quoted 9 lines · Chris PeBenito
Quoted 7 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with ? xdm (currently used by the userdomain module in ? the common user template);
- added permission to chat over dbus with colord.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Merged, though I moved the interface up.

Excellent.

What distro (or version of distro) are you on?

It's not a distribution, but rather just Linux and GNU stuff built from scratch. It's not Linuxfromscratch, as I do not follow their way of building stuff, but similar to it.

It's as close as possible to the original source code (i.e. patches kept to the minimum and configure options closest to the default).

Quoted 8 lines
Quoted 7 lines
Quoted 7 lines

This is what is missing now:

- the gnome module: this is very important, I am now improving it as
suggested by Dominick Grift;
- the dbus patch for binary execution (otherwise it refuses to start);

Quoted 6 lines
Quoted 3 lines

I have the same file on gentoo and dbus all starts fine. In general things marked bin_t are not terrible so I'm not hugely against adding the perm. Is this for a new version of dbus or something?

I am always using the latest version of everything, so it's latest dbus.

Im on the latest release in their stable branch too so not sure why yours fails but mine doesnt.

Quoted 8 lines

Please note that there should be references of this in the source code... Did you get a chance to look there ?

Might be the following:

dbus/dbus-transport-unix.c:??c = dbus_connection_open ("unixexec:argv0=false,argv1=foobar,path=/bin/false", &error);

Could be this. Are you up for strace/gdb'ing to confirm?

Quoted 4 lines

Also, many .service files have the following:

Exec=/bin/false

If this was it, it would fail as init_t or initrc_t. your dbus is failing later on so cant be something like this.

Quoted 16 lines
Quoted 2 lines

I'm on sys-apps/dbus-1.10.8-r1. Ideally i'd like to see where in the code its calling that and that would give more insight to why.

See above.

Quoted 3 lines

/bin/false is frequently used in /etc/passwd so it might be something to
do with that?

I don't think so. It's used in /etc/passwd to deny a login for virtual users (such as daemons).

Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

- the new fc_sort patch if you like the idea of installing it system-
wide to avoid execution permission problems (e.g. in /usr/src);

Quoted 5 lines
Quoted 2 lines

sysadm_t has full permissions in to src_t already? otherwise compiling

It's a bug in the git module then. It should create files in /usr/src with automatic transition to the src_t type.

/usr/bin/git is bin_t, so it will run as sysadm_t. you mean you are doing:
cd /usr/src/
git clone git://github.com/TresysTechnology/refpolicy.git
and its failing?

That definitely gets it all as src_t for me

meriadoc src # id -Z
staff_u:sysadm_r:sysadm_t:s0-s0:c0.c1023
meriadoc src # ls -ldZ /usr/src/refpolicy/
drwxr-xr-x. 8 root root staff_u:object_r:src_t:s0 22 Aug 15 22:05 /usr/src/refpolicy//

Everything under that dir is also src_t. There should be no problems. the git policy is for git daemon and gitweb. the main "git" binary is just bin_t. What label do you have on it after checking out?

-- Jason

Quoted 44 lines
Quoted 9 lines

the kernel wouldnt work either since it has many scripts it needs to run
too.
How are you installing the sources? in general the package manager should be force-resetting the labels on the files as it merges them into
the main FS.

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

- a patch to make use of the new module_load permission to load kernel
module (problem of the appropriate location for modules_object_t).

I got a report on gentoo about things failing on kernel 4.7. I think this one is requried to fix it.

See above, we need to tackle the git module with a simple fix.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

It's all about patches that are being reviewed, there are no other
patches...

Apart from the lvm module that was left out for some reason.

Quoted 4 lines
Quoted 3 lines

In the future I'd ask that you post related patches as a series, so we?
can see that patches are related.

Quoted 8 lines

Seconded, this makes it easier to follow.

$ git format-patch origin/master..mybranch
$ git send-email --to=refpolicy at oss.tresys.com --compose 000*.patch
the --compose switch will open an editor so you can write a short
message
about the series and then all the other patches are replies to that.?

-- Jason

Thanks Jason, I'll give it a try...

Regards,

Guido

#19 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

Hello.

Quoted 56 lines · Jason Zaman
Quoted 43 lines · Guido Trentalancia

Hello Jason.

Thanks for getting back on this.

Quoted 14 lines · Jason Zaman
Quoted 13 lines · Chris PeBenito
Quoted 12 lines · Guido Trentalancia

Hello Chris.

Quoted 9 lines · Chris PeBenito
Quoted 7 lines · Guido Trentalancia

Update for the xserver module:

- updated the file contexts for the Xsession script;
- created an interface for chatting over dbus with ? xdm (currently used by the userdomain module in ? the common user template);
- added permission to chat over dbus with colord.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Merged, though I moved the interface up.

Excellent.

What distro (or version of distro) are you on?

It's not a distribution, but rather just Linux and GNU stuff built from
scratch. It's not Linuxfromscratch, as I do not follow their way of building stuff, but similar to it.

It's as close as possible to the original source code (i.e. patches kept to the minimum and configure options closest to the default).

Quoted 10 lines
Quoted 9 lines
Quoted 9 lines

This is what is missing now:

- the gnome module: this is very important, I am now improving it
as
suggested by Dominick Grift;
- the dbus patch for binary execution (otherwise it refuses to
start);

Quoted 8 lines
Quoted 5 lines

I have the same file on gentoo and dbus all starts fine. In general
things marked bin_t are not terrible so I'm not hugely against adding
the perm. Is this for a new version of dbus or something?

I am always using the latest version of everything, so it's latest dbus.

Im on the latest release in their stable branch too so not sure why yours fails but mine doesnt.

Quoted 1 line
Quoted 8 lines
Quoted 7 lines

Please note that there should be references of this in the source code... Did you get a chance to look there ?

Might be the following:

dbus/dbus-transport-unix.c:??c = dbus_connection_open ("unixexec:argv0=false,argv1=foobar,path=/bin/false", &error);

Could be this. Are you up for strace/gdb'ing to confirm??

Not now, as I am busy with building and testing gnome module which is more urgent.

Quoted 33 lines
Quoted 3 lines

Also, many .service files have the following:

Exec=/bin/false

If this was it, it would fail as init_t or initrc_t. your dbus is failing later on so cant be something like this.

Quoted 20 lines
Quoted 3 lines

I'm on sys-apps/dbus-1.10.8-r1. Ideally i'd like to see where in the
code its calling that and that would give more insight to why.

See above.

Quoted 4 lines

/bin/false is frequently used in /etc/passwd so it might be something
to
do with that?

I don't think so. It's used in /etc/passwd to deny a login for virtual
users (such as daemons).

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

- the new fc_sort patch if you like the idea of installing it system-
wide to avoid execution permission problems (e.g. in /usr/src);

Quoted 6 lines
Quoted 2 lines

sysadm_t has full permissions in to src_t already? otherwise compiling

It's a bug in the git module then. It should create files in /usr/src
with automatic transition to the src_t type.

Quoted 5 lines

/usr/bin/git is bin_t, so it will run as sysadm_t. you mean you are doing:
cd /usr/src/
git clone git://github.com/TresysTechnology/refpolicy.git
and its failing?

Exactly. It gets usr_t instead of src_t.

Quoted 11 lines

That definitely gets it all as src_t for me

meriadoc src # id -Z staff_u:sysadm_r:sysadm_t:s0-s0:c0.c1023
meriadoc src # ls -ldZ /usr/src/refpolicy/
drwxr-xr-x. 8 root root staff_u:object_r:src_t:s0 22 Aug 15 22:05 /usr/src/refpolicy//

Everything under that dir is also src_t. There should be no problems. the git policy is for git daemon and gitweb. the main "git" binary is just bin_t. What label do you have on it after checking out?

git binary is bin_t.

Regards,

Guido

#20 lore raw

PATCH v3 1/1 Update the policy and file contexts for the xserver module

In reply to Guido Trentalancia

Hello Jason.

I am finally back to your question...

Quoted 5 lines · Guido Trentalancia

Hello Jason.

Thanks for getting back on this.

On Mon, 15/08/2016 at 11.19 +0800, Jason Zaman wrote:

[...]

Quoted 20 lines
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines

This is what is missing now:

- the gnome module: this is very important, I am now improving it
as
suggested by Dominick Grift;
- the dbus patch for binary execution (otherwise it refuses to start);

Quoted 4 lines

I have the same file on gentoo and dbus all starts fine. In general things marked bin_t are not terrible so I'm not hugely against adding
the perm. Is this for a new version of dbus or something?

I am always using the latest version of everything, so it's latest dbus.

Please note that there should be references of this in the source code... Did you get a chance to look there ?

Quoted 8 lines

Might be the following:

dbus/dbus-transport-unix.c:??c = dbus_connection_open ("unixexec:argv0=false,argv1=foobar,path=/bin/false", &error);

Also, many .service files have the following:

Exec=/bin/false

The matter is finally clarified. It's the latter (the Exec field in the service files) !

Try by yourself, it's extremely easy to reproduce, just create a service file with that field...

Some service files that are executed through systemd use that Exec field, most probably because the Exec field is mandatory for dbus service files.

I am now dropping that dbus patch, because corecmd_exec_bin() executes bin_t executable files BUT the resulting process runs in the system_dbusd_t !

Regards,

Guido