Bug 1436830

Summary: SELinux is preventing hdparm from 'ioctl' accesses on the blk_file /dev/sr0.
Product: [Fedora] Fedora Reporter: Frank Büttner <bugzilla>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: arturpolak1, dominick.grift, dwalsh, lvrabec, mgrepl, plautrba, pmoore, ssekidde
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:f1498037012314ae0ff00546f9b77013e5607bcd8e718017a6584206a907d209;VARIANT_ID=workstation;
Fixed In Version: selinux-policy-3.13.1-225.13.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-25 02:23:47 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 Frank Büttner 2017-03-28 18:54:34 UTC
Description of problem:
Plug in the power supply
SELinux is preventing hdparm from 'ioctl' accesses on the blk_file /dev/sr0.

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

If sie denken, dass es hdparm standardmäßig erlaubt sein sollte, ioctl Zugriff auf sr0 blk_file zu erhalten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
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:removable_device_t:s0
Target Objects                /dev/sr0 [ blk_file ]
Source                        hdparm
Source Path                   hdparm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.11.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.10.5-200.fc25.x86_64 #1 SMP Wed
                              Mar 22 20:37:08 UTC 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-03-28 19:22:51 CEST
Last Seen                     2017-03-28 19:22:51 CEST
Local ID                      0649de67-61db-4caa-beeb-83e827d999cc

Raw Audit Messages
type=AVC msg=audit(1490721771.977:186): avc:  denied  { ioctl } for  pid=3813 comm="hdparm" path="/dev/sr0" dev="devtmpfs" ino=1122 ioctlcmd=0x2285 scontext=system_u:system_r:tlp_t:s0 tcontext=system_u:object_r:removable_device_t:s0 tclass=blk_file permissive=1


Hash: hdparm,tlp_t,removable_device_t,blk_file,ioctl

Version-Release number of selected component:
selinux-policy-3.13.1-225.11.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.10.5-200.fc25.x86_64
type:           libreport

Potential duplicate: bug 1416980

Comment 1 Frank Büttner 2017-04-15 18:09:02 UTC
Description of problem:
Boot the system

Version-Release number of selected component:
selinux-policy-3.13.1-225.11.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.10.9-200.fc25.x86_64
type:           libreport

Comment 2 Lukas Vrabec 2017-04-17 13:51:03 UTC
*** Bug 1416980 has been marked as a duplicate of this bug. ***

Comment 3 Fedora Update System 2017-04-19 20:36:33 UTC
selinux-policy-3.13.1-225.13.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0af0456dcc

Comment 4 Fedora Update System 2017-04-20 18:25:07 UTC
selinux-policy-3.13.1-225.13.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-0af0456dcc

Comment 5 Fedora Update System 2017-04-25 02:23:47 UTC
selinux-policy-3.13.1-225.13.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.