Skip to contentSkip to conversation

xserver: curb on execheap and execmem permissions

PATCH New Guido Trentalancia 2 participants 3 messages Dec 17, 2016 – Dec 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xserver: curb on execheap and execmem permissions

The X Display Manager (XDM) does not normally require execheap and execmem permissions.

Modify the current xserver module so that execheap and/or execmem are enabled only when the global booleans allow_execheap and/or allow_execmem are enabled.

This applies only to systems other than RedHat.

---
 policy/modules/services/xserver.te |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
policy/modules/services/xserver.te +8 -1
@@ -584,7 +584,14 @@ optional_policy(`
 	unconfined_domtrans(xdm_t)
 
 	ifndef(`distro_redhat',`
-		allow xdm_t self:process { execheap execmem };
+		tunable_policy(`allow_execheap',`
+			allow xdm_t self:process execheap;
+		')
+
+		# gnome-shell in gdm mode requires execmem
+		tunable_policy(`allow_execmem',`
+			allow xdm_t self:process execmem;
+		')
 	')
 ')
 
#1 lore raw

PATCH 1/1 xserver: curb on execheap and execmem permissions

Quoted 21 lines · Guido Trentalancia via refpolicy

The X Display Manager (XDM) does not normally require execheap and execmem permissions.

Modify the current xserver module so that execheap and/or execmem are enabled only when the global booleans allow_execheap and/or allow_execmem are enabled.

This applies only to systems other than RedHat.

---
 policy/modules/services/xserver.te |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
policy/modules/services/xserver.te +0 -1
@@ -584,7 +584,14 @@ optional_policy(`
 	unconfined_domtrans(xdm_t)
 
 	ifndef(`distro_redhat',`
-		allow xdm_t self:process { execheap execmem };

policy/modules/services/xserver.te optional_policy(` · line 596

Quoted 10 lines
policy/modules/services/xserver.te +8 -0
+		tunable_policy(`allow_execheap',`
+			allow xdm_t self:process execheap;
+		')
+
+		# gnome-shell in gdm mode requires execmem
+		tunable_policy(`allow_execmem',`
+			allow xdm_t self:process execmem;
+		')
 	')
 ')

I't probably should just be removed from the ifndef, if the rules are conditional.

A more important question is if xserver actually still needs these perms.

Signature · 1 line
Chris PeBenito
#2 lore raw

PATCH 1/1 xserver: curb on execheap and execmem permissions

Hello!

It only needs execmem when gnome-shell runs in gdm mode.

Regards,

Guido

Quoted 40 lines · Chris PeBenito
Quoted 7 lines · Guido Trentalancia via refpolicy

The X Display Manager (XDM) does not normally require execheap and execmem permissions.

Modify the current xserver module so that execheap and/or execmem are enabled only when the global booleans allow_execheap and/or allow_execmem are enabled.

Quoted 8 lines

This applies only to systems other than RedHat.

---
 policy/modules/services/xserver.te |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/policy/modules/services/xserver.te 2016-12-07

13:39:08.670449307 +0100

Quoted 1 line

+++ b/policy/modules/services/xserver.te 2016-12-17

17:23:59.955264997 +0100

Quoted 5 lines
policy/modules/services/xserver.te +0 -1
@@ -584,7 +584,14 @@ optional_policy(`
 	unconfined_domtrans(xdm_t)
 
 	ifndef(`distro_redhat',`
-		allow xdm_t self:process { execheap execmem };

policy/modules/services/xserver.te optional_policy(` · line 596

Quoted 10 lines
policy/modules/services/xserver.te +8 -0
+		tunable_policy(`allow_execheap',`
+			allow xdm_t self:process execheap;
+		')
+
+		# gnome-shell in gdm mode requires execmem
+		tunable_policy(`allow_execmem',`
+			allow xdm_t self:process execmem;
+		')
 	')
 ')

I't probably should just be removed from the ifndef, if the rules are conditional.

A more important question is if xserver actually still needs these perms.