Skip to contentSkip to conversation

Resolve issues with plymouth in enforcing

PATCH In review Sugar, David 4 participants 18 messages Apr 12, 2019 – Apr 23, 2019

lore
Share & tools
lore
#0 lore raw

cover Resolve issues with plymouth in enforcing

I made some changes to the policy to get plymouth working in enforcing. I have noticed that since plymouthd is started very early during boot it is running as kernel_t. Some of the permissions are for kernel_t even though they are for the plymouthd process.

Dave Sugar (5):
Allow xdm (lightdm) start plymouth

Dave Sugar (3):
Allow xdm (lightdm) start plymouth
Changes to support plymouth working in enforcing Some items that seem they can be dontaudited for plymouthd

 policy/modules/kernel/devices.if     | 18 +++++++++++++
 policy/modules/kernel/kernel.te      |  5 +++-
 policy/modules/services/plymouthd.if | 38 ++++++++++++++++++++++++++++
 policy/modules/services/plymouthd.te |  5 ++++
 policy/modules/services/xserver.te   |  4 +++
 5 files changed, 69 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/3 Allow xdm (lightdm) execute plymouth

type=AVC msg=audit(1554917007.995:194): avc:  denied  { execute } for  pid=7647 comm="lightdm" name="plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
type=AVC msg=audit(1554917007.995:194): avc:  denied  { read open } for  pid=7647 comm="lightdm" path="/usr/bin/plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
type=AVC msg=audit(1554917007.995:194): avc:  denied  { execute_no_trans } for  pid=7647 comm="lightdm" path="/usr/bin/plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
type=AVC msg=audit(1554917007.995:194): avc:  denied  { map } for  pid=7647 comm="plymouth" path="/usr/bin/plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
---
 policy/modules/services/xserver.te | 4 ++++
 1 file changed, 4 insertions(+)
policy/modules/services/xserver.te +4 -0
index a2b08a89..38c28678 100644
@@ -615,6 +615,10 @@ optional_policy(`
 	mta_dontaudit_getattr_spool_files(xdm_t)
 ')
 
+optional_policy(`
+	plymouthd_domtrans_plymouth(xdm_t)
+')
+
 optional_policy(`
 	resmgr_stream_connect(xdm_t)
 ')
Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH 1/3] Allow xdm (lightdm) execute plymouth

Can this get merged?

Quoted 26 lines · David
type=AVC msg=audit(1554917007.995:194): avc:  denied  { execute } for  pid=7647 comm="lightdm" name="plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
type=AVC msg=audit(1554917007.995:194): avc:  denied  { read open } for  pid=7647 comm="lightdm" path="/usr/bin/plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
type=AVC msg=audit(1554917007.995:194): avc:  denied  { execute_no_trans } for  pid=7647 comm="lightdm" path="/usr/bin/plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
type=AVC msg=audit(1554917007.995:194): avc:  denied  { map } for  pid=7647 comm="plymouth" path="/usr/bin/plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
---
  policy/modules/services/xserver.te | 4 ++++
  1 file changed, 4 insertions(+)
policy/modules/services/xserver.te +4 -0
index a2b08a89..38c28678 100644
@@ -615,6 +615,10 @@ optional_policy(`
  	mta_dontaudit_getattr_spool_files(xdm_t)
  ')
 
+optional_policy(`
+	plymouthd_domtrans_plymouth(xdm_t)
+')
+
  optional_policy(`
  	resmgr_stream_connect(xdm_t)
  ')
#3 lore raw

Re: [PATCH 1/3] Allow xdm (lightdm) execute plymouth

In reply to Sugar, David
Quoted 15 lines · David
type=AVC msg=audit(1554917007.995:194): avc:  denied  { execute } for  pid=7647 comm="lightdm" name="plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
type=AVC msg=audit(1554917007.995:194): avc:  denied  { read open } for  pid=7647 comm="lightdm" path="/usr/bin/plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
type=AVC msg=audit(1554917007.995:194): avc:  denied  { execute_no_trans } for  pid=7647 comm="lightdm" path="/usr/bin/plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
type=AVC msg=audit(1554917007.995:194): avc:  denied  { map } for  pid=7647 comm="plymouth" path="/usr/bin/plymouth" dev="dm-1" ino=6508817 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:plymouth_exec_t:s0 tclass=file permissive=1
---
  policy/modules/services/xserver.te | 4 ++++
  1 file changed, 4 insertions(+)
policy/modules/services/xserver.te +0 -0
index a2b08a89..38c28678 100644

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

Quoted 10 lines
policy/modules/services/xserver.te +4 -0
@@ -615,6 +615,10 @@ optional_policy(`
  	mta_dontaudit_getattr_spool_files(xdm_t)
  ')
 
+optional_policy(`
+	plymouthd_domtrans_plymouth(xdm_t)
+')
+
  optional_policy(`
  	resmgr_stream_connect(xdm_t)
  ')

Merged.

Signature · 1 line
Chris PeBenito
#4 lore raw

PATCH 2/3 Changes to support plymouth working in enforcing

In reply to Sugar, David

plymouth is started very early in the boot process. Looks like before the SELinux policy is loaded so plymouthd is running as kernel_t rather than plymouthd_t. Due to this I needed to allow a few permissions on kernel_t to get the system to boot.

Please note that in this case I have the harddisk encrypted with LUKS so when plymouthd is started the harddisk is not unlocked yet. I don't know if the permissions are different in the case when LUKS is not involved.

type=AVC msg=audit(1554917011.127:225): avc:  denied  { write } for  pid=2585 comm="plymouthd" name="plymouth" dev="tmpfs" ino=18877 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:plymouthd_var_run_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1554917011.127:226): avc:  denied  { remove_name } for  pid=2585 comm="plymouthd" name="pid" dev="tmpfs" ino=18883 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:plymouthd_var_run_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1554917011.127:227): avc:  denied  { unlink } for  pid=2585 comm="plymouthd" name="pid" dev="tmpfs" ino=18883 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:plymouthd_var_run_t:s0 tclass=file permissive=1

type=AVC msg=audit(1554917011.116:224): avc: denied { write } for pid=2585 comm="plymouthd" name="boot-duration" dev="dm-16" ino=2097285 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:plymouthd_var_lib_t:s0 tclass=file permissive=1

type=AVC msg=audit(1555069712.938:237): avc: denied { ioctl } for pid=2554 comm="plymouthd" path="/dev/dri/card0" dev="devtmpfs" ino=12229 ioctlcmd=64b1 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:dri_device_t:s0 tclass=chr_file permissive=0

---
 policy/modules/kernel/devices.if     | 18 +++++++++++++
 policy/modules/kernel/kernel.te      |  5 +++-
 policy/modules/services/plymouthd.if | 38 ++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+), 1 deletion(-)
policy/modules/kernel/devices.if +18 -0
index 78a95ce8..d1cdf933 100644
@@ -1939,6 +1939,24 @@ interface(`dev_setattr_dri_dev',`
 	setattr_chr_files_pattern($1, device_t, dri_device_t)
 ')
 
+########################################
+## <summary>
+##	IOCLT the dri devices.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`dev_ioctl_dri_dev',`
+	gen_require(`
+		type device_t, dri_device_t;
+	')
+
+	allow $1 dri_device_t:chr_file ioctl;
+')
+
 ########################################
 ## <summary>
 ##	Read and write the dri devices.
policy/modules/kernel/kernel.te +4 -1
index b9ae4079..d230a5a2 100644
@@ -397,9 +397,12 @@ optional_policy(`
 ')
 
 optional_policy(`
-	plymouthd_read_lib_files(kernel_t)
+	dev_ioctl_dri_dev(kernel_t)
+
+	plymouthd_delete_pid_files(kernel_t)
 	plymouthd_read_pid_files(kernel_t)
 	plymouthd_read_spool_files(kernel_t)
+	plymouthd_rw_lib_files(kernel_t)
 
 	term_use_ptmx(kernel_t)
 	term_use_unallocated_ttys(kernel_t)
policy/modules/services/plymouthd.if +38 -0
index 04e0c734..3cc08b96 100644
@@ -192,6 +192,25 @@ interface(`plymouthd_read_lib_files',`
 	read_files_pattern($1, plymouthd_var_lib_t, plymouthd_var_lib_t)
 ')
 
+########################################
+## <summary>
+##	Read and write plymouthd lib files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`plymouthd_rw_lib_files',`
+	gen_require(`
+		type plymouthd_var_lib_t;
+	')
+
+	files_search_var_lib($1)
+	rw_files_pattern($1, plymouthd_var_lib_t, plymouthd_var_lib_t)
+')
+
 ########################################
 ## <summary>
 ##	Create, read, write, and delete
@@ -232,6 +251,25 @@ interface(`plymouthd_read_pid_files',`
 	allow $1 plymouthd_var_run_t:file read_file_perms;
 ')
 
+########################################
+## <summary>
+##	Delete the plymouthd pid files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`plymouthd_delete_pid_files',`
+	gen_require(`
+		type plymouthd_var_run_t;
+	')
+
+	files_search_pids($1)
+	delete_files_pattern($1, plymouthd_var_run_t, plymouthd_var_run_t)
+')
+
 ########################################
 ## <summary>
 ##	All of the rules required to
Signature · 1 line
2.20.1
#5 lore raw

Re: [PATCH 2/3] Changes to support plymouth working in enforcing

Quoted 5 lines · David

plymouth is started very early in the boot process. Looks like before the SELinux policy is loaded so plymouthd is running as kernel_t rather than plymouthd_t. Due to this I needed to allow a few permissions on kernel_t to get the system to boot.

Could plymouth re-exec itself or do a dynamic domain transition to get the right domain?

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

Re: [PATCH 2/3] Changes to support plymouth working in enforcing

Quoted 10 lines · Russell Coker
Quoted 5 lines · David

plymouth is started very early in the boot process. Looks like before the SELinux policy is loaded so plymouthd is running as kernel_t rather than plymouthd_t. Due to this I needed to allow a few permissions on kernel_t to get the system to boot.

Could plymouth re-exec itself or do a dynamic domain transition to get the right domain?

I don't see a way in the plymouth.conf or other configuration file to have plymouth re-exec.

#7 lore raw

Re: [PATCH 2/3] Changes to support plymouth working in enforcing

Quoted 11 lines · David
Quoted 9 lines · Russell Coker
Quoted 5 lines · David

plymouth is started very early in the boot process. Looks like before the SELinux policy is loaded so plymouthd is running as kernel_t rather than plymouthd_t. Due to this I needed to allow a few permissions on kernel_t to get the system to boot.

Quoted 8 lines
Quoted 4 lines

Could plymouth re-exec itself or do a dynamic domain transition to get the
right domain?

I don't see a way in the plymouth.conf or other configuration file to have plymouth re-exec.

Probably need to hack the plymouth source.

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

Re: [PATCH 2/3] Changes to support plymouth working in enforcing

Quoted 18 lines · Russell Coker
Quoted 17 lines · David
Quoted 13 lines · Russell Coker
Quoted 5 lines · David

plymouth is started very early in the boot process. Looks like before the SELinux policy is loaded so plymouthd is running as kernel_t rather than plymouthd_t. Due to this I needed to allow a few permissions on kernel_t to get the system to boot.

Could plymouth re-exec itself or do a dynamic domain transition to get the
right domain?

Quoted 4 lines
Quoted 2 lines

I don't see a way in the plymouth.conf or other configuration file to have plymouth re-exec.

Probably need to hack the plymouth source.

Not sure if it is worth the trouble, plymouthd mainly runs in the initramfs. There's a couple of left-overs when systemd loads policy but that is it AFAIK.

Quoted 5 lines
Signature · 3 lines
-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
Signature · 3 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
#9 lore raw

Re: [PATCH 2/3] Changes to support plymouth working in enforcing

Quoted 19 lines · Dominick Grift
Quoted 18 lines · Russell Coker
Quoted 17 lines · David
Quoted 13 lines · Russell Coker
Quoted 5 lines · David

plymouth is started very early in the boot process. Looks like before the SELinux policy is loaded so plymouthd is running as kernel_t rather than plymouthd_t. Due to this I needed to allow a few permissions on kernel_t to get the system to boot.

Could plymouth re-exec itself or do a dynamic domain transition to get the
right domain?

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

I don't see a way in the plymouth.conf or other configuration file to have plymouth re-exec.

Probably need to hack the plymouth source.

Not sure if it is worth the trouble, plymouthd mainly runs in the initramfs. There's a couple of left-overs when systemd loads policy but that is it AFAIK.

And even if I was able to get changes into plymouth, I'm not sure how long it would take to get those merged into RHEL. Can this be merged as is or are there some suggestions to update this?

Quoted 6 lines
Quoted 5 lines
Signature · 3 lines
-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
#10 lore raw

Re: [PATCH 2/3] Changes to support plymouth working in enforcing

In reply to Sugar, David
Quoted 119 lines · David

plymouth is started very early in the boot process. Looks like before the SELinux policy is loaded so plymouthd is running as kernel_t rather than plymouthd_t. Due to this I needed to allow a few permissions on kernel_t to get the system to boot.

Please note that in this case I have the harddisk encrypted with LUKS so when plymouthd is started the harddisk is not unlocked yet. I don't know if the permissions are different in the case when LUKS is not involved.

type=AVC msg=audit(1554917011.127:225): avc:  denied  { write } for  pid=2585 comm="plymouthd" name="plymouth" dev="tmpfs" ino=18877 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:plymouthd_var_run_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1554917011.127:226): avc:  denied  { remove_name } for  pid=2585 comm="plymouthd" name="pid" dev="tmpfs" ino=18883 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:plymouthd_var_run_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1554917011.127:227): avc:  denied  { unlink } for  pid=2585 comm="plymouthd" name="pid" dev="tmpfs" ino=18883 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:plymouthd_var_run_t:s0 tclass=file permissive=1

type=AVC msg=audit(1554917011.116:224): avc: denied { write } for pid=2585 comm="plymouthd" name="boot-duration" dev="dm-16" ino=2097285 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:plymouthd_var_lib_t:s0 tclass=file permissive=1

type=AVC msg=audit(1555069712.938:237): avc: denied { ioctl } for pid=2554 comm="plymouthd" path="/dev/dri/card0" dev="devtmpfs" ino=12229 ioctlcmd=64b1 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:dri_device_t:s0 tclass=chr_file permissive=0

---
  policy/modules/kernel/devices.if     | 18 +++++++++++++
  policy/modules/kernel/kernel.te      |  5 +++-
  policy/modules/services/plymouthd.if | 38 ++++++++++++++++++++++++++++
  3 files changed, 60 insertions(+), 1 deletion(-)
policy/modules/kernel/devices.if +18 -0
index 78a95ce8..d1cdf933 100644
@@ -1939,6 +1939,24 @@ interface(`dev_setattr_dri_dev',`
  	setattr_chr_files_pattern($1, device_t, dri_device_t)
  ')
 
+########################################
+## <summary>
+##	IOCLT the dri devices.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`dev_ioctl_dri_dev',`
+	gen_require(`
+		type device_t, dri_device_t;
+	')
+
+	allow $1 dri_device_t:chr_file ioctl;
+')
+
  ########################################
  ## <summary>
  ##	Read and write the dri devices.
policy/modules/kernel/kernel.te +4 -1
index b9ae4079..d230a5a2 100644
@@ -397,9 +397,12 @@ optional_policy(`
  ')
 
  optional_policy(`
-	plymouthd_read_lib_files(kernel_t)
+	dev_ioctl_dri_dev(kernel_t)
+
+	plymouthd_delete_pid_files(kernel_t)
  	plymouthd_read_pid_files(kernel_t)
  	plymouthd_read_spool_files(kernel_t)
+	plymouthd_rw_lib_files(kernel_t)
 
  	term_use_ptmx(kernel_t)
  	term_use_unallocated_ttys(kernel_t)
policy/modules/services/plymouthd.if +31 -0
index 04e0c734..3cc08b96 100644
@@ -192,6 +192,25 @@ interface(`plymouthd_read_lib_files',`
  	read_files_pattern($1, plymouthd_var_lib_t, plymouthd_var_lib_t)
  ')
 
+########################################
+## <summary>
+##	Read and write plymouthd lib files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`plymouthd_rw_lib_files',`
+	gen_require(`
+		type plymouthd_var_lib_t;
+	')
+
+	files_search_var_lib($1)
+	rw_files_pattern($1, plymouthd_var_lib_t, plymouthd_var_lib_t)
+')
+
  ########################################
  ## <summary>
  ##	Create, read, write, and delete
@@ -232,6 +251,25 @@ interface(`plymouthd_read_pid_files',`
  	allow $1 plymouthd_var_run_t:file read_file_perms;
  ')
 
+########################################
+## <summary>
+##	Delete the plymouthd pid files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`plymouthd_delete_pid_files',`
+	gen_require(`

policy/modules/services/plymouthd.if interface(`plymouthd_read_pid_files',` · line 275

Quoted 10 lines
policy/modules/services/plymouthd.if +7 -0
+		type plymouthd_var_run_t;
+	')
+
+	files_search_pids($1)
+	delete_files_pattern($1, plymouthd_var_run_t, plymouthd_var_run_t)
+')
+
  ########################################
  ## <summary>
  ##	All of the rules required to

Merged.

Signature · 1 line
Chris PeBenito
#11 lore raw

PATCH 3/3 Some items that seem they can be dontaudited for plymouthd

In reply to Sugar, David

type=AVC msg=audit(1554983723.772:784): avc: denied { create } for pid=8123 comm="plymouthd" scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:system_r:plymouthd_t:s0 tclass=netlink_kobject_uevent_socket permissive=0

type=AVC msg=audit(1555070131.882:1648): avc:  denied  { getattr } for  pid=8634 comm="plymouthd" path="/run/udev/data/c226:0" dev="tmpfs" ino=29946 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1
type=AVC msg=audit(1555070131.903:1652): avc:  denied  { open } for  pid=8634 comm="plymouthd" path="/run/udev/data/+drm:card0-DP-1" dev="tmpfs" ino=31856 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1
type=AVC msg=audit(1555070131.903:1652): avc:  denied  { read } for  pid=8634 comm="plymouthd" name="+drm:card0-DP-1" dev="tmpfs" ino=31856 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1
---
 policy/modules/services/plymouthd.te | 5 +++++
 1 file changed, 5 insertions(+)
policy/modules/services/plymouthd.te +5 -0
index 835ee035..6352375d 100644
@@ -38,6 +38,7 @@ dontaudit plymouthd_t self:capability dac_override;
 allow plymouthd_t self:capability2 block_suspend;
 allow plymouthd_t self:process { signal getsched };
 allow plymouthd_t self:fifo_file rw_fifo_file_perms;
+dontaudit plymouthd_t self:netlink_kobject_uevent_socket create;
 allow plymouthd_t self:unix_stream_socket create_stream_socket_perms;
 
 manage_dirs_pattern(plymouthd_t, plymouthd_spool_t, plymouthd_spool_t)
@@ -87,6 +88,10 @@ optional_policy(`
 	gnome_read_generic_home_content(plymouthd_t)
 ')
 
+optional_policy(`
+	udev_dontaudit_rw_pid_files(plymouthd_t)
+')
+
 optional_policy(`
 	sssd_stream_connect(plymouthd_t)
 ')
Signature · 1 line
2.20.1
#12 lore raw

Re: [PATCH 3/3] Some items that seem they can be dontaudited for plymouthd

What is netlink_kobject_uevent_socket? Do we have a place we can document this sort of thing to make it easier to determine whether access is required and what the implications of such access are?

policy/modules/services/plymouthd.te

Quoted 24 lines · David

type=AVC msg=audit(1554983723.772:784): avc: denied { create } for pid=8123 comm="plymouthd" scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:system_r:plymouthd_t:s0 tclass=netlink_kobject_uevent_socket permissive=0

type=AVC msg=audit(1555070131.882:1648): avc: denied { getattr } for pid=8634 comm="plymouthd" path="/run/udev/data/c226:0" dev="tmpfs" ino=29946 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1 type=AVC msg=audit(1555070131.903:1652): avc: denied { open } for pid=8634 comm="plymouthd" path="/run/udev/data/+drm:card0-DP-1" dev="tmpfs" ino=31856 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1 type=AVC msg=audit(1555070131.903:1652): avc: denied { read } for pid=8634 comm="plymouthd" name="+drm:card0-DP-1" dev="tmpfs" ino=31856 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1

---
 policy/modules/services/plymouthd.te | 5 +++++
 1 file changed, 5 insertions(+)
policy/modules/services/plymouthd.te +0 -0

index 835ee035..6352375d 100644

Quoted 24 lines
policy/modules/services/plymouthd.te +5 -0
@@ -38,6 +38,7 @@ dontaudit plymouthd_t self:capability dac_override;
 allow plymouthd_t self:capability2 block_suspend;
 allow plymouthd_t self:process { signal getsched };
 allow plymouthd_t self:fifo_file rw_fifo_file_perms;
+dontaudit plymouthd_t self:netlink_kobject_uevent_socket create;
 allow plymouthd_t self:unix_stream_socket create_stream_socket_perms;
 
 manage_dirs_pattern(plymouthd_t, plymouthd_spool_t, plymouthd_spool_t)
@@ -87,6 +88,10 @@ optional_policy(`
 	gnome_read_generic_home_content(plymouthd_t)
 ')
 
+optional_policy(`
+	udev_dontaudit_rw_pid_files(plymouthd_t)
+')
+
 optional_policy(`
 	sssd_stream_connect(plymouthd_t)
 ')
Signature · 1 line
2.20.1
Signature · 2 lines
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
#13 lore raw

Re: [PATCH 3/3] Some items that seem they can be dontaudited for plymouthd

Quoted 4 lines · Russell Coker

What is netlink_kobject_uevent_socket? Do we have a place we can document this sort of thing to make it easier to determine whether access is required and what the implications of such access are?

I'm really not sure either. But, please note, that this patch is dontaudit rules to quiet some denials that didn't seem to have any negative side effect. If this patch isn't applied things will still function, just have some entries in the audit logs.

Quoted 52 lines · David

policy/modules/services/plymouthd.te

Quoted 24 lines

type=AVC msg=audit(1554983723.772:784): avc: denied { create } for pid=8123 comm="plymouthd" scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:system_r:plymouthd_t:s0 tclass=netlink_kobject_uevent_socket permissive=0

type=AVC msg=audit(1555070131.882:1648): avc: denied { getattr } for pid=8634 comm="plymouthd" path="/run/udev/data/c226:0" dev="tmpfs" ino=29946 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1 type=AVC msg=audit(1555070131.903:1652): avc: denied { open } for pid=8634 comm="plymouthd" path="/run/udev/data/+drm:card0-DP-1" dev="tmpfs" ino=31856 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1 type=AVC msg=audit(1555070131.903:1652): avc: denied { read } for pid=8634 comm="plymouthd" name="+drm:card0-DP-1" dev="tmpfs" ino=31856 scontext=system_u:system_r:plymouthd_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1

---
  policy/modules/services/plymouthd.te | 5 +++++
  1 file changed, 5 insertions(+)
policy/modules/services/plymouthd.te +0 -0

index 835ee035..6352375d 100644

Quoted 24 lines
policy/modules/services/plymouthd.te +5 -0
@@ -38,6 +38,7 @@ dontaudit plymouthd_t self:capability dac_override;
  allow plymouthd_t self:capability2 block_suspend;
  allow plymouthd_t self:process { signal getsched };
  allow plymouthd_t self:fifo_file rw_fifo_file_perms;
+dontaudit plymouthd_t self:netlink_kobject_uevent_socket create;
  allow plymouthd_t self:unix_stream_socket create_stream_socket_perms;
 
  manage_dirs_pattern(plymouthd_t, plymouthd_spool_t, plymouthd_spool_t)
@@ -87,6 +88,10 @@ optional_policy(`
  	gnome_read_generic_home_content(plymouthd_t)
  ')
 
+optional_policy(`
+	udev_dontaudit_rw_pid_files(plymouthd_t)
+')
+
  optional_policy(`
  	sssd_stream_connect(plymouthd_t)
  ')
Signature · 1 line
2.20.1
#14 lore raw

Re: [PATCH 3/3] Some items that seem they can be dontaudited for plymouthd

Quoted 9 lines · David
Quoted 3 lines · Russell Coker

What is netlink_kobject_uevent_socket? Do we have a place we can document this sort of thing to make it easier to determine whether access is required and what the implications of such access are?

I'm really not sure either. But, please note, that this patch is dontaudit rules to quiet some denials that didn't seem to have any negative side effect. If this patch isn't applied things will still function, just have some entries in the audit logs.

There's a good chance the action in question isn't an accident and some aspect of the program's functionality will be changed. I think it's best to have an idea of what the issue was before putting in a dontaudit rule, if some configuration of that program actually needs such functionality then a dontaudit will make it inconvenient to track it down.

Have you tried running strace or ltrace to see what it's doing?

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

Re: [PATCH 3/3] Some items that seem they can be dontaudited for plymouthd

Quoted 11 lines · Russell Coker
Quoted 9 lines · David
Quoted 3 lines · Russell Coker

What is netlink_kobject_uevent_socket? Do we have a place we can document this sort of thing to make it easier to determine whether access is required and what the implications of such access are?

I'm really not sure either. But, please note, that this patch is dontaudit rules to quiet some denials that didn't seem to have any negative side effect. If this patch isn't applied things will still function, just have some entries in the audit logs.

Quoted 7 lines

There's a good chance the action in question isn't an accident and some aspect of the program's functionality will be changed. I think it's best to have an idea of what the issue was before putting in a dontaudit rule, if some configuration of that program actually needs such functionality then a dontaudit will make it inconvenient to track it down.

Have you tried running strace or ltrace to see what it's doing?

I agree that this probably shouldnt be dontaudited. This is a common pattern for "udev clients"

The kobject_uevent socket aspect is probably to monitor devices (equivalent to udevadm monitor)

Quoted 5 lines
Signature · 3 lines
-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
Signature · 3 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
#16 lore raw

Re: [PATCH 3/3] Some items that seem they can be dontaudited for plymouthd

Quoted 18 lines · Dominick Grift
Quoted 17 lines · Russell Coker
Quoted 9 lines · David
Quoted 3 lines · Russell Coker

What is netlink_kobject_uevent_socket? Do we have a place we can document this sort of thing to make it easier to determine whether access is required and what the implications of such access are?

I'm really not sure either. But, please note, that this patch is dontaudit rules to quiet some denials that didn't seem to have any negative side effect. If this patch isn't applied things will still function, just have some entries in the audit logs.

There's a good chance the action in question isn't an accident and some aspect of the program's functionality will be changed. I think it's best to have an idea of what the issue was before putting in a dontaudit rule, if some configuration of that program actually needs such functionality then a dontaudit will make it inconvenient to track it down.

Quoted 6 lines
Quoted 1 line

Have you tried running strace or ltrace to see what it's doing?

I agree that this probably shouldnt be dontaudited. This is a common pattern for "udev clients"

The kobject_uevent socket aspect is probably to monitor devices (equivalent to udevadm monitor)

This should be skipped and not merged.

Would you like this set to be resubmitted without this particular patch?

Quoted 6 lines
Quoted 5 lines
Signature · 3 lines
-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
#17 lore raw

Re: [PATCH 3/3] Some items that seem they can be dontaudited for plymouthd

In reply to Russell Coker
Quoted 3 lines · Russell Coker

What is netlink_kobject_uevent_socket? Do we have a place we can document this sort of thing to make it easier to determine whether access is required and what the implications of such access are?

The object class/perms list should be the place. Right now its at https://selinuxproject.org/page/ObjectClassesPerms, though arguably it could move back to the refpolicy wiki not that it's on SELinux project GitHub.

Signature · 1 line
Chris PeBenito