Bug 2334965

Summary: SELinux is preventing power-profiles- from 'write' accesses on the file energy_performance_preference.
Product: [Fedora] Fedora Reporter: Fabio Valentini <decathorpe>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 41CC: agurenko, decathorpe, dominik, dwalsh, fedora, jack, kaloyan_petrov, kroupa.matyas, ludovic, lvrabec, mikhail.v.gavrilov, mmalik, omosnacek, pkoncity, renich, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:6810b65bdde99bade85d347ed2571b92adf5b51c464dae1aca9d932b16adbcbe;VARIANT_ID=workstation;
Fixed In Version: selinux-policy-41.31-1.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-03 01:18:48 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 Fabio Valentini 2024-12-30 18:12:24 UTC
Description of problem:
This seems to happen when power-profiles-daemon attempts to set the performance profile (for example, when launching a game).
SELinux is preventing power-profiles- from 'write' accesses on the file energy_performance_preference.

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

If you believe that power-profiles- should be allowed write access on the energy_performance_preference 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 'power-profiles-' --raw | audit2allow -M my-powerprofiles
# semodule -X 300 -i my-powerprofiles.pp

Additional Information:
Source Context                system_u:system_r:powerprofiles_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                energy_performance_preference [ file ]
Source                        power-profiles-
Source Path                   power-profiles-
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-41.27-1.fc41.noarch
Local Policy RPM              selinux-policy-targeted-41.27-1.fc41.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.12.7-200.fc41.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Fri Dec 27 17:05:33 UTC 2024
                              x86_64
Alert Count                   3
First Seen                    2024-12-29 14:56:15 CET
Last Seen                     2024-12-30 13:55:41 CET
Local ID                      20e96f94-3318-4051-b501-0a71c5c71016

Raw Audit Messages
type=AVC msg=audit(1735563341.961:181): avc:  denied  { write } for  pid=2897 comm="power-profiles-" name="energy_performance_preference" dev="sysfs" ino=23260 scontext=system_u:system_r:powerprofiles_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file permissive=1


Hash: power-profiles-,powerprofiles_t,sysfs_t,file,write

Version-Release number of selected component:
selinux-policy-targeted-41.27-1.fc41.noarch

Additional info:
reporter:       libreport-2.17.15
reason:         SELinux is preventing power-profiles- from 'write' accesses on the file energy_performance_preference.
package:        selinux-policy-targeted-41.27-1.fc41.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.12.7-200.fc41.x86_64
comment:        This seems to happen when power-profiles-daemon attempts to set the performance profile (for example, when launching a game).
component:      selinux-policy

Comment 1 Fabio Valentini 2024-12-30 18:12:27 UTC
Created attachment 2064299 [details]
File: description

Comment 2 Fabio Valentini 2024-12-30 18:12:29 UTC
Created attachment 2064300 [details]
File: os_info

Comment 3 Zdenek Pytela 2025-01-27 14:02:01 UTC
*** Bug 2338135 has been marked as a duplicate of this bug. ***

Comment 4 Zdenek Pytela 2025-01-27 14:08:48 UTC
*** Bug 2321924 has been marked as a duplicate of this bug. ***

Comment 5 Zdenek Pytela 2025-01-27 14:09:03 UTC
*** Bug 2321933 has been marked as a duplicate of this bug. ***

Comment 6 Zdenek Pytela 2025-01-27 14:09:26 UTC
*** Bug 2322485 has been marked as a duplicate of this bug. ***

Comment 7 Zdenek Pytela 2025-01-27 14:09:43 UTC
*** Bug 2329824 has been marked as a duplicate of this bug. ***

Comment 8 Zdenek Pytela 2025-01-27 14:09:51 UTC
*** Bug 2334081 has been marked as a duplicate of this bug. ***

Comment 9 Zdenek Pytela 2025-01-27 14:10:13 UTC
*** Bug 2321391 has been marked as a duplicate of this bug. ***

Comment 10 Zdenek Pytela 2025-01-27 14:10:35 UTC
*** Bug 2323024 has been marked as a duplicate of this bug. ***

Comment 11 Zdenek Pytela 2025-01-27 14:10:43 UTC
*** Bug 2336865 has been marked as a duplicate of this bug. ***

Comment 12 Fedora Update System 2025-01-28 15:37:45 UTC
FEDORA-2025-9da160c869 (selinux-policy-41.30-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-9da160c869

Comment 13 Fedora Update System 2025-01-29 05:50:47 UTC
FEDORA-2025-9da160c869 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-9da160c869`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-9da160c869

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

Comment 14 Fedora Update System 2025-02-02 02:01:32 UTC
FEDORA-2025-62c612355c has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-62c612355c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-62c612355c

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

Comment 15 Fedora Update System 2025-02-03 01:18:48 UTC
FEDORA-2025-62c612355c (selinux-policy-41.31-1.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.