Bug 1667656 - SELinux is preventing x86_energy_perf from 'getattr' accesses on the chr_file /dev/cpu/1/msr.
Summary: SELinux is preventing x86_energy_perf from 'getattr' accesses on the chr_file...
Keywords:
Status: CLOSED DUPLICATE of bug 1562513
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 29
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:43887384d6eb3acf2169e783f2d...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-19 13:42 UTC by smitna
Modified: 2019-01-20 17:58 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-01-20 17:58:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description smitna 2019-01-19 13:42:03 UTC
Description of problem:
Seems to happen when waking from sleep.  I suspect this might be triggered by package "tlp-rdw".
SELinux is preventing x86_energy_perf from 'getattr' accesses on the chr_file /dev/cpu/1/msr.

*****  Plugin restorecon (90.5 confidence) suggests   ************************

If you want to fix the label. 
/dev/cpu/1/msr default label should be cpu_device_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /dev/cpu/1/msr

*****  Plugin device (9.50 confidence) suggests   ****************************

If you want to allow x86_energy_perf to have getattr access on the msr chr_file
Then you need to change the label on /dev/cpu/1/msr to a type of a similar device.
Do
# semanage fcontext -a -t SIMILAR_TYPE '/dev/cpu/1/msr'
# restorecon -v '/dev/cpu/1/msr'

*****  Plugin catchall (1.40 confidence) suggests   **************************

If you believe that x86_energy_perf should be allowed getattr access on the msr chr_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 'x86_energy_perf' --raw | audit2allow -M my-x86energyperf
# semodule -X 300 -i my-x86energyperf.pp

Additional Information:
Source Context                system_u:system_r:tlp_t:s0
Target Context                system_u:object_r:device_t:s0
Target Objects                /dev/cpu/1/msr [ chr_file ]
Source                        x86_energy_perf
Source Path                   x86_energy_perf
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.2-44.fc29.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.19.13-300.fc29.x86_64 #1 SMP Sat
                              Dec 29 22:54:28 UTC 2018 x86_64 x86_64
Alert Count                   2
First Seen                    2018-10-27 14:52:54 EDT
Last Seen                     2019-01-16 07:44:30 EST
Local ID                      ee59d2d3-b581-47c6-9322-de33ff0f7eea

Raw Audit Messages
type=AVC msg=audit(1547642670.582:345): avc:  denied  { getattr } for  pid=10345 comm="x86_energy_perf" path="/dev/cpu/1/msr" dev="devtmpfs" ino=298171 scontext=system_u:system_r:tlp_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=chr_file permissive=0


Hash: x86_energy_perf,tlp_t,device_t,chr_file,getattr

Version-Release number of selected component:
selinux-policy-3.14.2-44.fc29.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.7
hashmarkername: setroubleshoot
kernel:         4.19.15-300.fc29.x86_64
type:           libreport

Potential duplicate: bug 1562513

Comment 1 Lukas Vrabec 2019-01-20 17:58:52 UTC

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


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