Bug 906652

Summary: SELinux is preventing /usr/sbin/smartd from 'read' accesses on the blk_file sdb.
Product: [Fedora] Fedora Reporter: Steve Tyler <stephent98>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:453735f82d817fc49574ad58f80629fb9f8f0e74866927b60fcdf4ecd3c0bdc1
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-11 04:55:09 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 Steve Tyler 2013-02-01 06:01:18 UTC
Description of problem:
This occurred while running qemu-kvm.
The VM was hosting the F18 installer in another VM with /dev/sdb configured as the install target.
SELinux is preventing /usr/sbin/smartd from 'read' accesses on the blk_file sdb.

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

If you believe that smartd should be allowed read access on the sdb 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:svirt_image_t:s0:c250,c697
Target Objects                sdb [ blk_file ]
Source                        smartd
Source Path                   /usr/sbin/smartd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           smartmontools-6.0-2.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-73.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.4-204.fc18.x86_64 #1 SMP Wed
                              Jan 23 16:44:29 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-01-31 21:52:52 PST
Last Seen                     2013-01-31 21:52:52 PST
Local ID                      10e70e46-c06b-4a33-825f-014789494157

Raw Audit Messages
type=AVC msg=audit(1359697972.253:355): avc:  denied  { read } for  pid=387 comm="smartd" name="sdb" dev="devtmpfs" ino=6522 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:svirt_image_t:s0:c250,c697 tclass=blk_file


type=SYSCALL msg=audit(1359697972.253:355): arch=x86_64 syscall=open success=no exit=EACCES a0=7ff7881f8818 a1=800 a2=7ff78719d568 a3=7ff78719d568 items=0 ppid=1 pid=387 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=smartd exe=/usr/sbin/smartd subj=system_u:system_r:fsdaemon_t:s0 key=(null)

Hash: smartd,fsdaemon_t,svirt_image_t,blk_file,read

audit2allow

#============= fsdaemon_t ==============
#!!!! This avc is a constraint violation.  You will need to add an attribute to either the source or target type to make it work.
#Constraint rule: 
#	Possible cause source context and target context 'level' differ[08]
allow fsdaemon_t svirt_image_t:blk_file read;

audit2allow -R

#============= fsdaemon_t ==============
#!!!! This avc is a constraint violation.  You will need to add an attribute to either the source or target type to make it work.
#Constraint rule: 
#	Possible cause source context and target context 'level' differ[08]
allow fsdaemon_t svirt_image_t:blk_file read;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.4-204.fc18.x86_64
type:           libreport

Potential duplicate: bug 892525

Comment 1 Miroslav Grepl 2013-02-01 10:45:01 UTC
We allowed it in rawhide.

Comment 2 Fedora Update System 2013-02-05 09:23:35 UTC
selinux-policy-3.11.1-76.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-76.fc18

Comment 3 Fedora Update System 2013-02-08 02:35:54 UTC
Package selinux-policy-3.11.1-76.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-76.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-2101/selinux-policy-3.11.1-76.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-02-11 04:55:10 UTC
selinux-policy-3.11.1-76.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.