Bug 2257252

Summary: SELinux is preventing systemd-sleep from 'setattr' accesses on the file /sys/firmware/efi/efivars/HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67.
Product: [Fedora] Fedora Reporter: Diego <diego.ml>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 39CC: diego.ml, dwalsh, lvrabec, mmalik, nknazeko, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:1a4bf9d1b2d69eaae947fd8d02269a1103a43243239ab67620d0a3e11377ff9a;VARIANT_ID=;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-01-08 11:53:11 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:
Attachments:
Description Flags
File: description
none
File: os_info none

Description Diego 2024-01-08 11:32:21 UTC
Description of problem:
Turned on the device after hibernation.
SELinux is preventing systemd-sleep from 'setattr' accesses 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                          (removed)
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                     (removed)
Platform                      Linux (removed) 6.6.8-200.fc39.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Thu Dec 21 04:01:49 UTC 2023
                              x86_64
Alert Count                   1
First Seen                    2024-01-07 17:51:45 CET
Last Seen                     2024-01-07 17:51:45 CET
Local ID                      bf87658e-fe67-4684-948c-b1d2de13d15d

Raw Audit Messages
type=AVC msg=audit(1704646305.121:916): avc:  denied  { setattr } for  pid=87321 comm="systemd-sleep" path="/sys/firmware/efi/efivars/HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67" dev="efivarfs" ino=558537 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

Version-Release number of selected component:
selinux-policy-targeted-39.3-1.fc39.noarch

Additional info:
reporter:       libreport-2.17.11
reason:         SELinux is preventing systemd-sleep from 'setattr' accesses on the file /sys/firmware/efi/efivars/HibernateLocation-8cf2644b-4b0b-428f-9387-6d876050dc67.
component:      selinux-policy
type:           libreport
kernel:         6.6.8-200.fc39.x86_64
comment:        Turned on the device after hibernation.
hashmarkername: setroubleshoot
package:        selinux-policy-targeted-39.3-1.fc39.noarch
component:      selinux-policy

Comment 1 Diego 2024-01-08 11:32:23 UTC
Created attachment 2007755 [details]
File: description

Comment 2 Diego 2024-01-08 11:32:25 UTC
Created attachment 2007756 [details]
File: os_info

Comment 3 Zdenek Pytela 2024-01-08 11:53:11 UTC

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