Bug 2251508 - SELinux is preventing systemd-sleep from create access on the file HibernateLocation [...]
Summary: SELinux is preventing systemd-sleep from create access on the file HibernateL...
Keywords:
Status: CLOSED DUPLICATE of bug 2249928
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 39
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-11-25 21:32 UTC by dpw818
Modified: 2023-11-27 07:50 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-27 07:50:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description dpw818 2023-11-25 21:32:17 UTC
After upgrade from Fedora 38 to Fedora 39, I am unable to put my laptop to sleep or hibernate.  I get the following SELinux Errors:

**************
SELinux is preventing systemd-sleep from create access on the file HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67.

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

If you believe that systemd-sleep should be allowed create 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                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.2-1.fc39.noarch
Local Policy RPM              selinux-policy-targeted-39.2-1.fc39.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 6.5.12-300.fc39.x86_64
                              #1 SMP PREEMPT_DYNAMIC Mon Nov 20 22:44:24 UTC
                              2023 x86_64
Alert Count                   2
First Seen                    2023-11-25 08:53:21 EST
Last Seen                     2023-11-25 08:54:39 EST
Local ID                      46d83f45-5edf-4968-ad76-63b8dd81ad16

Raw Audit Messages
type=AVC msg=audit(1700920479.973:110637): avc:  denied  { create } for  pid=257601 comm="systemd-sleep" name="HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67" 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,create
**************

I have tried setting local policy described above, that is:

sudo ausearch -c 'systemd-sleep' --raw | audit2allow -M my-systemdsleep
sudo semodule -X 300 -i my-systemdsleep.pp

However this did not fix the problem and I remain unable to sleep or hibernate my computer, instead required to shut it down each time.

Thanks!

Reproducible: Always

Steps to Reproduce:
Try to put my computer into sleep or hibernate mode.
Actual Results:  
Computer does not sleep, generates an SELinux error message

Expected Results:  
Computer will go to sleep or hibernate when instructed.

Comment 1 Zdenek Pytela 2023-11-27 07:50:38 UTC

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


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