Bug 2211062 - SELinux is preventing systemd-sleep from 'open' accesses on the file /run/udev/data/+power_supply:BAT1.
Summary: SELinux is preventing systemd-sleep from 'open' accesses on the file /run/ude...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 38
Hardware: x86_64
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:ffcf44b715a78d46888f04a4d04...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-30 12:19 UTC by Miren Radia
Modified: 2023-06-18 01:30 UTC (History)
9 users (show)

Fixed In Version: selinux-policy-38.17-1.fc38
Clone Of:
Environment:
Last Closed: 2023-06-18 01:30:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: description (2.02 KB, text/plain)
2023-05-30 12:19 UTC, Miren Radia
no flags Details
File: os_info (699 bytes, text/plain)
2023-05-30 12:19 UTC, Miren Radia
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1719 0 None open Allow systemd-sleep read udev pid files 2023-05-31 06:51:58 UTC

Description Miren Radia 2023-05-30 12:19:32 UTC
Description of problem:
I closed my laptop lid which should trigger systemd suspend-then-hibernate (configured via KDE Powerdevil). 

I received this SELinux audit denial after waking up my laptop.
SELinux is preventing systemd-sleep from 'open' accesses on the file /run/udev/data/+power_supply:BAT1.

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

If you believe that systemd-sleep should be allowed open access on the +power_supply:BAT1 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:udev_var_run_t:s0
Target Objects                /run/udev/data/+power_supply:BAT1 [ file ]
Source                        systemd-sleep
Source Path                   systemd-sleep
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-38.12-1.fc38.noarch
Local Policy RPM              selinux-policy-targeted-38.12-1.fc38.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.2.15-300.fc38.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Thu May 11 17:37:39 UTC 2023
                              x86_64
Alert Count                   15
First Seen                    2023-05-29 18:14:06 BST
Last Seen                     2023-05-30 13:11:07 BST
Local ID                      1af235f1-a6c3-4937-992f-66e17cd930a0

Raw Audit Messages
type=AVC msg=audit(1685448667.201:1720): avc:  denied  { open } for  pid=145045 comm="systemd-sleep" path="/run/udev/data/+power_supply:BAT1" dev="tmpfs" ino=16724 scontext=system_u:system_r:systemd_sleep_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=0


Hash: systemd-sleep,systemd_sleep_t,udev_var_run_t,file,open

Version-Release number of selected component:
selinux-policy-targeted-38.12-1.fc38.noarch

Additional info:
reporter:       libreport-2.17.10
reason:         SELinux is preventing systemd-sleep from 'open' accesses on the file /run/udev/data/+power_supply:BAT1.
package:        selinux-policy-targeted-38.12-1.fc38.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.2.15-300.fc38.x86_64
component:      selinux-policy

Comment 1 Miren Radia 2023-05-30 12:19:34 UTC
Created attachment 1967860 [details]
File: description

Comment 2 Miren Radia 2023-05-30 12:19:36 UTC
Created attachment 1967861 [details]
File: os_info

Comment 3 Fedora Update System 2023-06-15 20:24:48 UTC
FEDORA-2023-9050c32c92 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-9050c32c92

Comment 4 Fedora Update System 2023-06-16 04:35:08 UTC
FEDORA-2023-9050c32c92 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-9050c32c92`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-9050c32c92

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2023-06-18 01:30:04 UTC
FEDORA-2023-9050c32c92 has been pushed to the Fedora 38 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.