Bug 1693878

Summary: SELinux is preventing hdparm from 'open' accesses on the blk_file /dev/nvme0n1.
Product: [Fedora] Fedora Reporter: Matt Parkinson <mparkins>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: dwalsh, lvrabec, mgrepl, mparkins, plautrba, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:722f950614eb9ff6affb401258f0e83f814bd577d105669615e8f1087d4e6684;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-29 06:40:41 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:

Description Matt Parkinson 2019-03-28 20:53:33 UTC
Description of problem:
This alert appears every morning when I dock my "sleeping" ThinkPad 470s. I have followed the recommended steps to generate/apply the SELinux module a few times now and it has not solved the problem. As far as I can tell there is no impact other than the alert being generated.
SELinux is preventing hdparm from 'open' accesses on the blk_file /dev/nvme0n1.

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

If you believe that hdparm should be allowed open access on the nvme0n1 blk_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 'hdparm' --raw | audit2allow -M my-hdparm
# semodule -X 300 -i my-hdparm.pp

Additional Information:
Source Context                system_u:system_r:tlp_t:s0
Target Context                system_u:object_r:nvme_device_t:s0
Target Objects                /dev/nvme0n1 [ blk_file ]
Source                        hdparm
Source Path                   hdparm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.2-51.fc29.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.20.16-200.fc29.x86_64 #1 SMP Thu
                              Mar 14 15:10:22 UTC 2019 x86_64 x86_64
Alert Count                   4
First Seen                    2019-03-27 16:29:51 AEDT
Last Seen                     2019-03-29 07:45:36 AEDT
Local ID                      142eb396-2959-47d3-a459-efa9685ef534

Raw Audit Messages
type=AVC msg=audit(1553805936.754:1187): avc:  denied  { open } for  pid=21331 comm="hdparm" path="/dev/nvme0n1" dev="devtmpfs" ino=17037 scontext=system_u:system_r:tlp_t:s0 tcontext=system_u:object_r:nvme_device_t:s0 tclass=blk_file permissive=0


Hash: hdparm,tlp_t,nvme_device_t,blk_file,open

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

Additional info:
component:      selinux-policy
reporter:       libreport-2.10.0
hashmarkername: setroubleshoot
kernel:         4.20.16-200.fc29.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2019-03-29 06:40:41 UTC

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