Bug 672798 - SELinux is preventing /usr/sbin/smartd from 'ioctl' accesses on the blk_file /dev/sdc.
Summary: SELinux is preventing /usr/sbin/smartd from 'ioctl' accesses on the blk_file ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 14
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:165710701e4...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-26 12:56 UTC by Richard Shaw
Modified: 2011-02-03 20:25 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.9.7-28.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-03 20:25:54 UTC
Type: ---


Attachments (Terms of Use)

Description Richard Shaw 2011-01-26 12:56:15 UTC
SELinux is preventing /usr/sbin/smartd from 'ioctl' accesses on the blk_file /dev/sdc.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/dev/sdc default label should be fixed_disk_device_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /dev/sdc

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that smartd should be allowed ioctl access on the sdc 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:
# grep smartd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:fsdaemon_t:s0
Target Context                system_u:object_r:removable_t:s0
Target Objects                /dev/sdc [ blk_file ]
Source                        smartd
Source Path                   /usr/sbin/smartd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           smartmontools-5.40-3.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-20.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.10-74.fc14.x86_64
                              #1 SMP Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64
Alert Count                   20
First Seen                    Tue 25 Jan 2011 06:47:20 PM CST
Last Seen                     Wed 26 Jan 2011 06:47:20 AM CST
Local ID                      0c5b0efe-0d26-4cf7-a4fe-981122069caa

Raw Audit Messages
type=AVC msg=audit(1296046040.636:47559): avc:  denied  { ioctl } for  pid=2310 comm="smartd" path="/dev/sdc" dev=devtmpfs ino=6921 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:removable_t:s0 tclass=blk_file

smartd,fsdaemon_t,removable_t,blk_file,ioctl
type=SYSCALL msg=audit(1296046040.636:47559): arch=x86_64 syscall=ioctl success=yes exit=0 a0=3 a1=2285 a2=7ffffee4c2b0 a3=7fa28c26c820 items=0 ppid=1 pid=2310 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=smartd exe=/usr/sbin/smartd subj=system_u:system_r:fsdaemon_t:s0 key=(null)
smartd,fsdaemon_t,removable_t,blk_file,ioctl

#============= fsdaemon_t ==============
allow fsdaemon_t removable_t:blk_file ioctl;

Comments:

I tried restoring context on /dev/sdc in case that's what was wrong but it didn't seem to help.

Comment 1 Richard Shaw 2011-01-26 12:57:38 UTC
Also just noticed the first setroubleshoot error that looks to be related:


SELinux is preventing /usr/sbin/smartd from 'read' accesses on the blk_file sdc.

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

If you believe that smartd should be allowed read access on the sdc 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:
# grep smartd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:fsdaemon_t:s0
Target Context                system_u:object_r:removable_t:s0
Target Objects                sdc [ blk_file ]
Source                        smartd
Source Path                   /usr/sbin/smartd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           smartmontools-5.40-3.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-20.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.10-74.fc14.x86_64
                              #1 SMP Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64
Alert Count                   20
First Seen                    Tue 25 Jan 2011 06:47:20 PM CST
Last Seen                     Wed 26 Jan 2011 06:47:20 AM CST
Local ID                      96382bed-7cf9-441a-8e3e-65ee821a2ed4

Raw Audit Messages
type=AVC msg=audit(1296046040.635:47558): avc:  denied  { read } for  pid=2310 comm="smartd" name="sdc" dev=devtmpfs ino=6921 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:removable_t:s0 tclass=blk_file

smartd,fsdaemon_t,removable_t,blk_file,read
type=AVC msg=audit(1296046040.635:47558): avc:  denied  { open } for  pid=2310 comm="smartd" name="sdc" dev=devtmpfs ino=6921 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:removable_t:s0 tclass=blk_file

smartd,fsdaemon_t,removable_t,blk_file,read
type=SYSCALL msg=audit(1296046040.635:47558): arch=x86_64 syscall=open success=yes exit=ESRCH a0=7fa28ce62ef8 a1=800 a2=0 a3=7fa28c26c820 items=0 ppid=1 pid=2310 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=smartd exe=/usr/sbin/smartd subj=system_u:system_r:fsdaemon_t:s0 key=(null)
smartd,fsdaemon_t,removable_t,blk_file,read

#============= fsdaemon_t ==============
allow fsdaemon_t removable_t:blk_file { read open };

Comment 2 Daniel Walsh 2011-01-26 14:30:58 UTC
Miroslav lets add

fs_read_removable_files(fsdaemon_t)

Comment 3 Miroslav Grepl 2011-01-27 10:10:33 UTC
Fixed in selinux-policy-3.9.7-26.fc14

Comment 4 Fedora Update System 2011-02-02 12:57:39 UTC
selinux-policy-3.9.7-28.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-28.fc14

Comment 5 Fedora Update System 2011-02-02 19:30:52 UTC
selinux-policy-3.9.7-28.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-28.fc14

Comment 6 Fedora Update System 2011-02-03 20:25:01 UTC
selinux-policy-3.9.7-28.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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