Bug 1013204 - SELinux is preventing hdparm from 'read' accesses on the blk_file sda.
SELinux is preventing hdparm from 'read' accesses on the blk_file sda.
Product: Fedora
Classification: Fedora
Component: tuned (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jaroslav Škarvada
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-09-28 06:20 EDT by Heiko Adams
Modified: 2014-11-07 15:47 EST (History)
10 users (show)

See Also:
Fixed In Version: selinux-policy-3.12.1-192.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-11-07 15:47:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Heiko Adams 2013-09-28 06:20:52 EDT
Description of problem:
SELinux is preventing hdparm from 'read' accesses on the blk_file sda.

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

If sie denken, dass es hdparm standardmässig erlaubt sein sollte, read Zugriff auf sda blk_file zu erhalten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
zugriff jetzt erlauben, indem Sie die nachfolgenden Befehle ausführen:
# grep hdparm /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:tuned_t:s0
Target Context                system_u:object_r:fixed_disk_device_t:s0
Target Objects                sda [ blk_file ]
Source                        hdparm
Source Path                   hdparm
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           hdparm-9.43-5.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-83.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.11.1-300.fc20.x86_64 #1 SMP Sat
                              Sep 14 15:01:23 UTC 2013 x86_64 x86_64
Alert Count                   3
First Seen                    2013-09-28 12:07:35 CEST
Last Seen                     2013-09-28 12:19:28 CEST
Local ID                      f2a60dee-fa56-43fd-a9e3-fb2673cde61c

Raw Audit Messages
type=AVC msg=audit(1380363568.221:434): avc:  denied  { read } for  pid=3145 comm="hdparm" name="sda" dev="devtmpfs" ino=6615 scontext=system_u:system_r:tuned_t:s0 tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file

type=SYSCALL msg=audit(1380363568.221:434): arch=x86_64 syscall=open success=no exit=EACCES a0=7fff3ae8af8e a1=800 a2=0 a3=19 items=0 ppid=568 pid=3145 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=hdparm exe=/usr/sbin/hdparm subj=system_u:system_r:tuned_t:s0 key=(null)

Hash: hdparm,tuned_t,fixed_disk_device_t,blk_file,read

Additional info:
reporter:       libreport-2.1.7
hashmarkername: setroubleshoot
kernel:         3.11.1-300.fc20.x86_64
type:           libreport
Comment 1 Daniel Walsh 2013-09-28 06:57:10 EDT
Does tuned actually have to read the disk device?  This basically would allow it to read any file on the system.
Comment 2 Miroslav Grepl 2013-10-07 07:41:03 EDT
What does

$ ls -Z `which hdparm`

I believe you will need to fix labeling on your system.
Comment 3 Miroslav Grepl 2013-10-07 07:48:19 EDT
tuned is so close unconfined domain.
Comment 4 Heiko Adams 2013-10-07 08:23:06 EDT
$ ls -Z `which hdparm`
-rwxr-xr-x. root root unconfined_u:object_r:fsadm_exec_t:s0 /usr/sbin/hdparm
Comment 5 Daniel Walsh 2013-10-07 09:53:28 EDT
Yes I think we should make it unconfined by default.

Lets add a fsadm_domtrans though

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