Bug 1013204 - SELinux is preventing hdparm from 'read' accesses on the blk_file sda.
Summary: SELinux is preventing hdparm from 'read' accesses on the blk_file sda.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: tuned
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaroslav Škarvada
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:e682c101dd649c75794bcc82330...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-28 10:20 UTC by Heiko Adams
Modified: 2014-11-07 20:47 UTC (History)
10 users (show)

Fixed In Version: selinux-policy-3.12.1-192.fc20
Clone Of:
Environment:
Last Closed: 2014-11-07 20:47:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Heiko Adams 2013-09-28 10:20:52 UTC
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.
Do
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 10:57:10 UTC
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 11:41:03 UTC
What does

$ ls -Z `which hdparm`

I believe you will need to fix labeling on your system.

Comment 3 Miroslav Grepl 2013-10-07 11:48:19 UTC
Dan,
tuned is so close unconfined domain.

Comment 4 Heiko Adams 2013-10-07 12:23:06 UTC
$ 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 13:53:28 UTC
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.