Bug 2365799

Summary: SELinux is preventing systemd-user-ru from connectto access on the unix_stream_socket /systemd/userdb/io.systemd.DynamicUser
Product: [Fedora] Fedora Reporter: Daniel Mendizabal <daniel>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: dwalsh, lvrabec, mmalik, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---Keywords: SELinux
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-41.40-1.fc42 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-05-15 01:56:00 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:

Description Daniel Mendizabal 2025-05-13 05:48:27 UTC
SELinux is triggered when trying to login to a systemd-homed user, and the following selinux alert is being triggered:

Additional Information:
Source Context                system_u:system_r:systemd_user_runtimedir_t:s0
Target Context                system_u:system_r:kernel_t:s0
Target Objects                /systemd/userdb/io.systemd.DynamicUser [
                              unix_stream_socket ]
Source                        systemd-user-ru
Source Path                   systemd-user-ru
Port                          <Unknown>
Host                          io
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-41.39-1.fc42.noarch
Local Policy RPM              
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     io
Platform                      Linux io 6.14.5-300.fc42.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Fri May  2 14:16:46 UTC 2025
                              x86_64


type=AVC msg=audit(1747089881.911:266): avc:  denied  { connectto } for  pid=3954 comm="systemd-user-ru" path="/systemd/userdb/io.systemd.DynamicUser" scontext=system_u:system_r:systemd_user_runtimedir_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=unix_stream_socket permissive=1


Hash: systemd-user-ru,systemd_user_runtimedir_t,kernel_t,unix_stream_socket,connectto


Reproducible: Always

Steps to Reproduce:
1.Create a systemd-homed user: homectl create test (--storage luks / subvolume / directory)
2.Reboot and login to user: test
3.Run: sealert -l "*"

Comment 1 Fedora Update System 2025-05-13 19:17:57 UTC
FEDORA-2025-5e64167ac4 (selinux-policy-41.40-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-5e64167ac4

Comment 2 Fedora Update System 2025-05-14 02:07:55 UTC
FEDORA-2025-5e64167ac4 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-5e64167ac4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-5e64167ac4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 3 Fedora Update System 2025-05-15 01:56:00 UTC
FEDORA-2025-5e64167ac4 (selinux-policy-41.40-1.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.