Bug 1931954

Summary: SELinux is preventing sssd from 'getattr' accesses on the filesystem /sys/fs/cgroup.
Product: [Fedora] Fedora Reporter: Matt Fagnani <matt.fagnani>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 34CC: awilliam, dwalsh, grepl.miroslav, lvrabec, mmalik, omosnace, plautrba, vmojzis, zpytela
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:abc61acb035455d0a9a8f41d2e04260184078299c412e506ce82d12e0b6115f3;VARIANT_ID=kde; AcceptedFreezeException
Fixed In Version: selinux-policy-3.14.7-25.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-16 00:28:52 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:
Bug Depends On:    
Bug Blocks: 1829023    

Description Matt Fagnani 2021-02-23 16:17:46 UTC
Description of problem:
I was using a Fedora 34 KDE Plasma installation updated to 2021-2-22. I updated to systemd-248~rc1-2.fc34 from https://koji.fedoraproject.org/koji/buildinfo?buildID=1714025 I rebooted. sssd was denied getattr on /sys/fs/cgroup as sssd was starting during boot. This denial happened on 2/2 boots with systemd-248~rc1-2.fc34, but it didn't happen with systemd-247.3-3.fc34 or earlier.
SELinux is preventing sssd from 'getattr' accesses on the filesystem /sys/fs/cgroup.

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

If you believe that sssd should be allowed getattr access on the cgroup filesystem 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 'sssd' --raw | audit2allow -M my-sssd
# semodule -X 300 -i my-sssd.pp

Additional Information:
Source Context                system_u:system_r:sssd_t:s0
Target Context                system_u:object_r:cgroup_t:s0
Target Objects                /sys/fs/cgroup [ filesystem ]
Source                        sssd
Source Path                   sssd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-3.14.7-22.fc34.noarch
Local Policy RPM              selinux-policy-targeted-3.14.7-22.fc34.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.11.0-156.fc34.x86_64 #1 SMP Wed
                              Feb 17 08:31:59 UTC 2021 x86_64 x86_64
Alert Count                   2
First Seen                    2021-02-23 10:51:58 EST
Last Seen                     2021-02-23 11:08:39 EST
Local ID                      e4549127-bfcb-4674-99a1-9866ed6f1453

Raw Audit Messages
type=AVC msg=audit(1614096519.35:238): avc:  denied  { getattr } for  pid=786 comm="sssd" name="/" dev="cgroup2" ino=1 scontext=system_u:system_r:sssd_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=filesystem permissive=0


Hash: sssd,sssd_t,cgroup_t,filesystem,getattr

Version-Release number of selected component:
selinux-policy-targeted-3.14.7-22.fc34.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.14.0
hashmarkername: setroubleshoot
kernel:         5.11.0-156.fc34.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2021-02-23 16:43:28 UTC
Thank you for reporting the issue. I've submitted a Fedora PR to address it:
https://github.com/fedora-selinux/selinux-policy/pull/610

Comment 2 Fedora Update System 2021-02-24 10:09:24 UTC
FEDORA-2021-ccd3bb057b has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-ccd3bb057b

Comment 3 Fedora Update System 2021-02-24 19:18:19 UTC
FEDORA-2021-ccd3bb057b has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-ccd3bb057b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-ccd3bb057b

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

Comment 4 Fedora Update System 2021-03-03 15:47:37 UTC
FEDORA-2021-1cb3d5cac1 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-1cb3d5cac1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-1cb3d5cac1

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

Comment 5 Adam Williamson 2021-03-12 01:43:02 UTC
Proposing this as a Beta FE as a kind of proxy for fixing several SELinux denials. Without this update, after a simple default install and boot test, we see all these denials on F34:

----
time->Thu Mar 11 16:01:24 2021
type=AVC msg=audit(1615496484.059:126): avc:  denied  { getattr } for  pid=459 comm="sssd" name="/" dev="cgroup2" ino=1 scontext=system_u:system_r:sssd_t:s0 tcontext=system_u:object_r:cgroup_t:s0 tclass=filesystem permissive=0
----
time->Thu Mar 11 16:01:24 2021
type=AVC msg=audit(1615496484.810:146): avc:  denied  { read } for  pid=526 comm="systemd-hostnam" name="+dmi:id" dev="tmpfs" ino=866 scontext=system_u:system_r:systemd_hostnamed_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=0
----
time->Thu Mar 11 16:01:24 2021
type=AVC msg=audit(1615496484.810:147): avc:  denied  { read } for  pid=526 comm="systemd-hostnam" name="+dmi:id" dev="tmpfs" ino=866 scontext=system_u:system_r:systemd_hostnamed_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=0
----
time->Thu Mar 11 16:01:24 2021
type=AVC msg=audit(1615496484.810:148): avc:  denied  { read } for  pid=526 comm="systemd-hostnam" name="+dmi:id" dev="tmpfs" ino=866 scontext=system_u:system_r:systemd_hostnamed_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=0
----
time->Thu Mar 11 16:01:24 2021
type=AVC msg=audit(1615496484.810:149): avc:  denied  { read } for  pid=526 comm="systemd-hostnam" name="+dmi:id" dev="tmpfs" ino=866 scontext=system_u:system_r:systemd_hostnamed_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=0

With this update, those are all resolved. I think it'd be a good idea to get that done for Beta.

Comment 6 Fedora Update System 2021-03-12 18:56:57 UTC
FEDORA-2021-1e99f2ed79 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-1e99f2ed79`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-1e99f2ed79

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

Comment 7 Adam Williamson 2021-03-15 15:57:10 UTC
+4 in https://pagure.io/fedora-qa/blocker-review/issue/304 , marking accepted.

Comment 8 Fedora Update System 2021-03-16 00:28:52 UTC
FEDORA-2021-1e99f2ed79 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.