I had a similar issue in Bug 2251508, and this was fixed after an update. However, after a system update this evening, I am getting SELinux errors again. Fortunately this time the suggested policy works as a workaround, which it hadn't before.
Below is the SELinux Alert:
--------
SELinux is preventing systemd-sleep from setattr access on the file /sys/firmware/efi/efivars/HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67.
***** Plugin catchall (100. confidence) suggests **************************
If you believe that systemd-sleep should be allowed setattr access on the HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67 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 'systemd-sleep' --raw | audit2allow -M my-systemdsleep
# semodule -X 300 -i my-systemdsleep.pp
Additional Information:
Source Context system_u:system_r:systemd_sleep_t:s0
Target Context system_u:object_r:efivarfs_t:s0
Target Objects /sys/firmware/efi/efivars/HibernateLocation-
8cf2644b-4b0b-428f-9387-6d876050dc67 [ file ]
Source systemd-sleep
Source Path systemd-sleep
Port <Unknown>
Host localhost.localdomain
Source RPM Packages
Target RPM Packages
SELinux Policy RPM selinux-policy-targeted-39.3-1.fc39.noarch
Local Policy RPM selinux-policy-targeted-39.3-1.fc39.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Enforcing
Host Name localhost.localdomain
Platform Linux localhost.localdomain 6.6.7-200.fc39.x86_64
#1 SMP PREEMPT_DYNAMIC Wed Dec 13 21:43:37 UTC
2023 x86_64
Alert Count 1
First Seen 2023-12-23 01:07:05 EST
Last Seen 2023-12-23 01:07:05 EST
Local ID 28b7603c-7372-42bc-a5e7-89716134d7dc
Raw Audit Messages
type=AVC msg=audit(1703311625.363:336): avc: denied { setattr } for pid=3817 comm="systemd-sleep" path="/sys/firmware/efi/efivars/HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67" dev="efivarfs" ino=510 scontext=system_u:system_r:systemd_sleep_t:s0 tcontext=system_u:object_r:efivarfs_t:s0 tclass=file permissive=0
Hash: systemd-sleep,systemd_sleep_t,efivarfs_t,file,setattr
Reproducible: Always
Steps to Reproduce:
Try to put computer to sleep.
Actual Results:
Computer doesn't sleeps but generates an SELinux warning.
Expected Results:
Computer should sleep.
Comment 4Fedora Update System
2024-01-27 02:35:17 UTC
FEDORA-2024-334b3be641 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-334b3be641`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-334b3be641
See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
Comment 5Fedora Update System
2024-01-30 04:22:10 UTC
FEDORA-2024-334b3be641 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.