Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 1944526 - SELinux is preventing systemd-sleep from 'add_name' accesses on the directory state.
Summary: SELinux is preventing systemd-sleep from 'add_name' accesses on the directory...
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 34
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:7859f724a154c7f07b391054d19...
Depends On:
TreeView+ depends on / blocked
Reported: 2021-03-30 06:26 UTC by Otto Liljalaakso
Modified: 2021-04-05 00:17 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-34-1.fc34
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-04-05 00:17:47 UTC
Type: ---

Attachments (Terms of Use)

Description Otto Liljalaakso 2021-03-30 06:26:12 UTC
Description of problem:
SELinux is preventing systemd-sleep from 'add_name' accesses on the directory state.

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

If you believe that systemd-sleep should be allowed add_name access on the state directory 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:sysfs_t:s0
Target Objects                state [ dir ]
Source                        systemd-sleep
Source Path                   systemd-sleep
Port                          <Tuntematon>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-3.14.7-28.fc34.noarch
Local Policy RPM              selinux-policy-targeted-3.14.7-28.fc34.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.11.9-300.fc34.x86_64 #1 SMP Wed
                              Mar 24 12:06:51 UTC 2021 x86_64 x86_64
Alert Count                   2
First Seen                    2021-03-28 13:40:23 EEST
Last Seen                     2021-03-30 09:08:11 EEST
Local ID                      97c53be1-25f3-494c-9571-3057afe80a4f

Raw Audit Messages
type=AVC msg=audit(1617084491.30:16617): avc:  denied  { add_name } for  pid=278668 comm="systemd-sleep" name="state" scontext=system_u:system_r:systemd_sleep_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=0

Hash: systemd-sleep,systemd_sleep_t,sysfs_t,dir,add_name

Version-Release number of selected component:

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

Comment 1 Zdenek Pytela 2021-03-30 13:21:46 UTC
I've submitted a Fedora PR to address the issue:

Comment 2 Fedora Update System 2021-04-02 14:44:41 UTC
FEDORA-2021-e221a38cfe has been submitted as an update to Fedora 34.

Comment 3 Fedora Update System 2021-04-03 01:09:13 UTC
FEDORA-2021-e221a38cfe 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-e221a38cfe`
You can provide feedback for this update here:

See also for more information on how to test updates.

Comment 4 Otto Liljalaakso 2021-04-03 03:50:43 UTC
Thank you for working on this. Unfortunately, I have not seen the error on the affected system since the fix became available, so I am unable to test if the fix helps. But since the submitted fix is clear enough and the problem does not reproduce, I am willing to consider the issue fixed.

I will install the update anyhow and report if I the problem happens again.

Comment 5 Fedora Update System 2021-04-05 00:17:47 UTC
FEDORA-2021-e221a38cfe has been pushed to the Fedora 34 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.