Bug 2255693 - SELinux is preventing systemd-sleep from setattr access on the file /sys/firmware/efi/efivars/HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67.
Summary: SELinux is preventing systemd-sleep from setattr access on the file /sys/firm...
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 39
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
: 2256947 2257252 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2023-12-23 06:21 UTC by dpw818
Modified: 2024-01-30 04:22 UTC (History)
10 users (show)

Fixed In Version: selinux-policy-39.4-1.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2024-01-30 04:22:10 UTC
Type: ---

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1988 0 None open Allow systemd-sleep set attributes of efivarfs files 2024-01-02 10:14:01 UTC

Description dpw818 2023-12-23 06:21:41 UTC
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.
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 1 Zdenek Pytela 2024-01-05 15:29:18 UTC
*** Bug 2256947 has been marked as a duplicate of this bug. ***

Comment 2 Zdenek Pytela 2024-01-08 11:53:11 UTC
*** Bug 2257252 has been marked as a duplicate of this bug. ***

Comment 3 Fedora Update System 2024-01-26 23:20:01 UTC
FEDORA-2024-334b3be641 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2024-334b3be641

Comment 4 Fedora 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 5 Fedora 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.

Note You need to log in before you can comment on or make changes to this bug.