Bug 2359547

Summary: SELinux is preventing /usr/lib/systemd/systemd-user-runtime-dir from 'remove_name' accesses on the directory /user.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, lvrabec, mikhail.v.gavrilov, mmalik, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:16ae427ebb89bc52011d2b4fe9848f4573519a4ef1c9ea0031589401416c4960;VARIANT_ID=workstation;
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-04-14 20:59:23 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 Mikhail 2025-04-14 16:39:27 UTC
Description of problem:
SELinux is preventing /usr/lib/systemd/systemd-user-runtime-dir from 'remove_name' accesses on the directory /user.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/user default label should be default_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /user

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that systemd-user-runtime-dir should be allowed remove_name access on the user directory 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 'systemd-user-ru' --raw | audit2allow -M my-systemduserru
# semodule -X 300 -i my-systemduserru.pp

Additional Information:
Source Context                system_u:system_r:systemd_user_runtimedir_t:s0
Target Context                system_u:object_r:config_home_t:s0
Target Objects                /user [ dir ]
Source                        systemd-user-ru
Source Path                   /usr/lib/systemd/systemd-user-runtime-dir
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           systemd-257.5-2.fc43.x86_64
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-41.37-1.fc43.noarch
Local Policy RPM              selinux-policy-targeted-41.37-1.fc43.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 6.14.0-01-
                              1e26c5e28ca5821a824e90dd359556f5e9e7b89f+ #6 SMP
                              PREEMPT_DYNAMIC Sat Apr 12 02:36:28 +05 2025
                              x86_64
Alert Count                   1
First Seen                    2025-04-14 19:01:51 +05
Last Seen                     2025-04-14 19:01:51 +05
Local ID                      63c7dfb9-531a-446d-b9b9-010dfe9743ae

Raw Audit Messages
type=AVC msg=audit(1744639311.767:222): avc:  denied  { write } for  pid=3984 comm="systemd-user-ru" name="dconf" dev="tmpfs" ino=65 scontext=system_u:system_r:systemd_user_runtimedir_t:s0 tcontext=system_u:object_r:config_home_t:s0 tclass=dir permissive=1


type=AVC msg=audit(1744639311.767:222): avc:  denied  { remove_name } for  pid=3984 comm="systemd-user-ru" name="user" dev="tmpfs" ino=66 scontext=system_u:system_r:systemd_user_runtimedir_t:s0 tcontext=system_u:object_r:config_home_t:s0 tclass=dir permissive=1


type=SYSCALL msg=audit(1744639311.767:222): arch=x86_64 syscall=unlinkat success=yes exit=0 a0=5 a1=5599d77f6543 a2=0 a3=4 items=2 ppid=1 pid=3984 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=systemd-user-ru exe=/usr/lib/systemd/systemd-user-runtime-dir subj=system_u:system_r:systemd_user_runtimedir_t:s0 key=(null)

type=CWD msg=audit(1744639311.767:222): cwd=/

type=PATH msg=audit(1744639311.767:222): item=0 name=/ inode=65 dev=00:4f mode=040700 ouid=42 ogid=42 rdev=00:00 obj=system_u:object_r:config_home_t:s0 nametype=PARENT cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0

type=PATH msg=audit(1744639311.767:222): item=1 name=user inode=66 dev=00:4f mode=0100600 ouid=42 ogid=42 rdev=00:00 obj=system_u:object_r:config_home_t:s0 nametype=DELETE cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0

Hash: systemd-user-ru,systemd_user_runtimedir_t,config_home_t,dir,remove_name

Version-Release number of selected component:
selinux-policy-targeted-41.37-1.fc43.noarch

Additional info:
reporter:       libreport-2.17.15
reason:         SELinux is preventing /usr/lib/systemd/systemd-user-runtime-dir from 'remove_name' accesses on the directory /user.
package:        selinux-policy-targeted-41.37-1.fc43.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.14.0-01-1e26c5e28ca5821a824e90dd359556f5e9e7b89f+
component:      selinux-policy

Comment 1 Mikhail 2025-04-14 16:39:30 UTC
Created attachment 2084955 [details]
File: description

Comment 2 Mikhail 2025-04-14 16:39:31 UTC
Created attachment 2084956 [details]
File: os_info

Comment 3 Zdenek Pytela 2025-04-14 20:59:23 UTC

*** This bug has been marked as a duplicate of bug 2359546 ***