Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 975260 - SELinux is preventing /usr/sbin/smartctl from using the 'sys_rawio' capabilities.
Summary: SELinux is preventing /usr/sbin/smartctl from using the 'sys_rawio' capabilit...
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:5081c98ccbc94654d5f697ca230...
Depends On:
TreeView+ depends on / blocked
Reported: 2013-06-18 00:31 UTC by W Agtail
Modified: 2013-07-25 00:40 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.11.1-98.fc18
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-07-25 00:40:26 UTC
Type: ---

Attachments (Terms of Use)

Description W Agtail 2013-06-18 00:31:25 UTC
Description of problem:
running smartctl from snmpd
SELinux is preventing /usr/sbin/smartctl from using the 'sys_rawio' capabilities.

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

If you believe that smartctl should have the sys_rawio capability by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep smartctl /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:snmpd_t:s0
Target Context                system_u:system_r:snmpd_t:s0
Target Objects                 [ capability ]
Source                        smartctl
Source Path                   /usr/sbin/smartctl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           smartmontools-6.1-1.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-97.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.4-200.fc18.x86_64 #1 SMP Fri
                              May 24 20:10:49 UTC 2013 x86_64 x86_64
Alert Count                   7
First Seen                    2013-06-18 00:52:10 BST
Last Seen                     2013-06-18 01:20:16 BST
Local ID                      28bd500d-b413-491f-aaeb-d602028911dd

Raw Audit Messages
type=AVC msg=audit(1371514816.588:18599): avc:  denied  { sys_rawio } for  pid=5339 comm="smartctl" capability=17  scontext=system_u:system_r:snmpd_t:s0 tcontext=system_u:system_r:snmpd_t:s0 tclass=capability

type=SYSCALL msg=audit(1371514816.588:18599): arch=x86_64 syscall=ioctl success=yes exit=0 a0=3 a1=31f a2=7fffc3ae1d70 a3=1 items=0 ppid=5337 pid=5339 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=smartctl exe=/usr/sbin/smartctl subj=system_u:system_r:snmpd_t:s0 key=(null)

Hash: smartctl,snmpd_t,snmpd_t,capability,sys_rawio


#============= snmpd_t ==============
allow snmpd_t self:capability sys_rawio;

audit2allow -R
require {
	type snmpd_t;
	class capability sys_rawio;

#============= snmpd_t ==============
allow snmpd_t self:capability sys_rawio;

Additional info:
reporter:       libreport-2.1.4
hashmarkername: setroubleshoot
kernel:         3.9.4-200.fc18.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-06-18 06:42:52 UTC
commit de2b20a8032d41e81ae99d7cd0307c7b56e6fd79
Author: Miroslav Grepl <mgrepl@redhat.com>
Date:   Tue Jun 18 08:40:30 2013 +0200

    Allow snmpd to run smartctl in fsadm_t domain

Comment 2 Fedora Update System 2013-06-27 13:36:27 UTC
selinux-policy-3.11.1-98.fc18 has been submitted as an update for Fedora 18.

Comment 3 Fedora Update System 2013-06-28 06:10:26 UTC
Package selinux-policy-3.11.1-98.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-98.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 4 W Agtail 2013-06-30 18:46:04 UTC
this update has done the trick, thanks

Comment 5 Daniel Walsh 2013-07-01 10:49:28 UTC
Please update karma.

Comment 6 Fedora Update System 2013-07-25 00:40:26 UTC
selinux-policy-3.11.1-98.fc18 has been pushed to the Fedora 18 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.