Bug 2221901

Summary: SELinux is preventing sddm-helper from 'write' accesses on the file wayland-errors.
Product: [Fedora] Fedora Reporter: Dennis Schridde <devurandom>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: devurandom, dwalsh, lvrabec, mmalik, nknazeko, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:b53285b0419dd1bcdbe125a607636fc3cb89240600787b5c204f149683e3d9b1;VARIANT_ID=kde;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-11 20:36:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: description
none
File: os_info none

Description Dennis Schridde 2023-07-11 08:25:25 UTC
Description of problem:
I started my computer, auto-login logged me into KDE Plasma, I found the SELinux alert right after.
SELinux is preventing sddm-helper from 'write' accesses on the file wayland-errors.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that sddm-helper should be allowed write access on the wayland-errors file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'sddm-helper' --raw | audit2allow -M my-sddmhelper
# semodule -X 300 -i my-sddmhelper.pp

Additional Information:
Source Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Context                system_u:object_r:container_file_t:s0
Target Objects                wayland-errors [ file ]
Source                        sddm-helper
Source Path                   sddm-helper
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-38.20-1.fc38.noarch
Local Policy RPM              selinux-policy-targeted-38.20-1.fc38.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.3.11-200.fc38.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Sun Jul 2 13:17:31 UTC 2023 x86_64
Alert Count                   5
First Seen                    2023-07-06 09:29:44 CEST
Last Seen                     2023-07-11 08:40:22 CEST
Local ID                      26fd00bf-f316-429c-83c5-d03336021c6c

Raw Audit Messages
type=AVC msg=audit(1689057622.963:184): avc:  denied  { write } for  pid=2472 comm="sddm-helper" name="wayland-errors" dev="dm-0" ino=269 scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:object_r:container_file_t:s0 tclass=file permissive=0


Hash: sddm-helper,xdm_t,container_file_t,file,write

Version-Release number of selected component:
selinux-policy-targeted-38.20-1.fc38.noarch

Additional info:
reporter:       libreport-2.17.11
reason:         SELinux is preventing sddm-helper from 'write' accesses on the file wayland-errors.
package:        selinux-policy-targeted-38.20-1.fc38.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.3.11-200.fc38.x86_64
comment:        I started my computer, auto-login logged me into KDE Plasma, I found the SELinux alert right after.
component:      selinux-policy

Comment 1 Dennis Schridde 2023-07-11 08:25:30 UTC
Created attachment 1975103 [details]
File: description

Comment 2 Dennis Schridde 2023-07-11 08:25:32 UTC
Created attachment 1975104 [details]
File: os_info

Comment 3 Daniel Walsh 2023-07-11 20:36:15 UTC
This looks like you volume mounted wayland-errors from the host into a container and then used :z to force a relabel.

You should never take non private data from the host and stick it into a container and force a relabel, because it can 
break other parts of the system.

If you run restorecon -R --force PATHCONTAININGwayland-errors, it should fix the problem.

Comment 4 Dennis Schridde 2023-07-19 21:37:02 UTC
*** Bug 2222201 has been marked as a duplicate of this bug. ***