Skip to contentSkip to conversation

new sddm pam patch

PATCH In review Russell Coker 2 participants 3 messages Feb 17, 2022 – Mar 27, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 new sddm pam patch

Here is a new patch for sddm using PAM for it's own helper. This one uses system_r instead of xdm_r and has patches for all 3 versions of the policy config. I think it's ready for inclusion.

policy/modules/services/xserver.te +3 -0
Index: refpolicy-2.20220217/policy/modules/services/xserver.te
===================================================================
@@ -843,6 +843,9 @@ manage_files_pattern(xserver_t, xdm_tmp_
 manage_lnk_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
 manage_sock_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
 
+# for sddm to use pam for greeter, sddm greeter needs execmod
+allow xdm_t xdm_tmpfs_t:file execmod;
+
 # Run Xorg.wrap
 can_exec(xserver_t, xserver_exec_t)
 
config/appconfig-mcs/seusers +1 -0
Index: refpolicy-2.20220217/config/appconfig-mcs/seusers
===================================================================
@@ -1,2 +1,3 @@
 root:unconfined_u:s0-mcs_systemhigh
 __default__:unconfined_u:s0-mcs_systemhigh
+sddm:xdm:s0
policy/users +1 -0
Index: refpolicy-2.20220217/policy/users
===================================================================
@@ -27,6 +27,7 @@ gen_user(system_u,, system_r, s0, s0 - m
 gen_user(user_u, user, user_r, s0, s0)
 gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats)
 gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
+gen_user(xdm, user, system_r, s0, s0)
 
 # Until order dependence is fixed for users:
 ifdef(`direct_sysadm_daemon',`
config/appconfig-mcs/xdm_default_contexts new file +1 -0
Index: refpolicy-2.20220217/config/appconfig-mcs/xdm_default_contexts
===================================================================
@@ -0,0 +1 @@
+system_r:xdm_t:s0		system_r:xdm_t:s0
config/appconfig-mls/xdm_default_contexts new file +1 -0
Index: refpolicy-2.20220217/config/appconfig-mls/xdm_default_contexts
===================================================================
@@ -0,0 +1 @@
+system_r:xdm_t:s0		system_r:xdm_t:s0
config/appconfig-standard/xdm_default_contexts new file +1 -0
Index: refpolicy-2.20220217/config/appconfig-standard/xdm_default_contexts
===================================================================
@@ -0,0 +1 @@
+system_r:xdm_t		system_r:xdm_t
#1 lore raw
Quoted 25 lines · Russell Coker

Here is a new patch for sddm using PAM for it's own helper. This one uses system_r instead of xdm_r and has patches for all 3 versions of the policy config. I think it's ready for inclusion.

Index: refpolicy-2.20220217/policy/modules/services/xserver.te
===================================================================

policy/modules/services/xserver.te +3 -0
@@ -843,6 +843,9 @@ manage_files_pattern(xserver_t, xdm_tmp_
  manage_lnk_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
  manage_sock_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
 
+# for sddm to use pam for greeter, sddm greeter needs execmod
+allow xdm_t xdm_tmpfs_t:file execmod;
+
  # Run Xorg.wrap
  can_exec(xserver_t, xserver_exec_t)
 

Index: refpolicy-2.20220217/config/appconfig-mcs/seusers
===================================================================

config/appconfig-mcs/seusers line 3

Quoted 3 lines
config/appconfig-mcs/seusers +1 -0
@@ -1,2 +1,3 @@
  root:unconfined_u:s0-mcs_systemhigh
  __default__:unconfined_u:s0-mcs_systemhigh
+sddm:xdm:s0

Did sddm:system_u fail? If we must have a new seuser, please place it in the xserver module. The build system supports declaring users in modules.

The changes for seusers changes for standard and mls are missing.

Quoted 30 lines

Index: refpolicy-2.20220217/policy/users
===================================================================

policy/users +1 -0
@@ -27,6 +27,7 @@ gen_user(system_u,, system_r, s0, s0 - m
  gen_user(user_u, user, user_r, s0, s0)
  gen_user(staff_u, staff, staff_r sysadm_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats)
  gen_user(sysadm_u, sysadm, sysadm_r, s0, s0 - mls_systemhigh, mcs_allcats)
+gen_user(xdm, user, system_r, s0, s0)
 
  # Until order dependence is fixed for users:
  ifdef(`direct_sysadm_daemon',`

Index: refpolicy-2.20220217/config/appconfig-mcs/xdm_default_contexts
===================================================================

config/appconfig-mcs/xdm_default_contexts new file +1 -0
@@ -0,0 +1 @@
+system_r:xdm_t:s0		system_r:xdm_t:s0

Index: refpolicy-2.20220217/config/appconfig-mls/xdm_default_contexts
===================================================================

config/appconfig-mls/xdm_default_contexts new file +1 -0
@@ -0,0 +1 @@
+system_r:xdm_t:s0		system_r:xdm_t:s0

Index: refpolicy-2.20220217/config/appconfig-standard/xdm_default_contexts
===================================================================

config/appconfig-standard/xdm_default_contexts new file +1 -0
@@ -0,0 +1 @@
+system_r:xdm_t		system_r:xdm_t
Signature · 1 line
Chris PeBenito
#2 lore raw
Quoted 6 lines · On Friday, 18 February 2022 00:48:44 AEDT Chris PeBenito wrote:
Quoted 6 lines
policy/modules/services/xserver.te +3 -0
+# for sddm to use pam for greeter, sddm greeter needs execmod
+allow xdm_t xdm_tmpfs_t:file execmod;
+

# Run Xorg.wrap
can_exec(xserver_t, xserver_exec_t)

Quoted 10 lines
Quoted 8 lines

Index: refpolicy-2.20220217/config/appconfig-mcs/seusers
===================================================================

config/appconfig-mcs/seusers +0 -0
@@ -1,2 +1,3 @@

root:unconfined_u:s0-mcs_systemhigh
__default__:unconfined_u:s0-mcs_systemhigh
+sddm:xdm:s0

Did sddm:system_u fail?

Yes, there's several programs that end up in the wrong domains (or try to) if you do that.

Quoted 2 lines

If we must have a new seuser, please place it in
the xserver module. The build system supports declaring users in modules.

OK, that's in the next version.

Quoted 1 line

The changes for seusers changes for standard and mls are missing.

OK, done that too.

Signature · 2 lines
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/