Bug 842980

Summary: SELinux is preventing /usr/bin/qemu-kvm from 'getattr' accesses on the filesystem /.
Product: [Fedora] Fedora Reporter: Abhay <abhaykadam88>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: abhaykadam88, dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:3edf90aa0b3e3a8e59f0c590da879b0bd11f27bf14cde8ee8d94efc9a61111a7
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-10 22:35:32 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 Abhay 2012-07-25 08:18:39 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.4.6-2.fc17.x86_64
time:           Wed 25 Jul 2012 01:48:21 PM IST

description:
:SELinux is preventing /usr/bin/qemu-kvm from 'getattr' accesses on the filesystem /.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that qemu-kvm should be allowed getattr access on the  filesystem 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 qemu-kvm /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:svirt_t:s0:c195,c220
:Target Context                system_u:object_r:fusefs_t:s0
:Target Objects                / [ filesystem ]
:Source                        qemu-kvm
:Source Path                   /usr/bin/qemu-kvm
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           qemu-system-x86-1.0-17.fc17.x86_64
:Target RPM Packages           filesystem-3-2.fc17.x86_64
:Policy RPM                    selinux-policy-3.10.0-140.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.4.6-2.fc17.x86_64 #1 SMP Thu
:                              Jul 19 22:54:16 UTC 2012 x86_64 x86_64
:Alert Count                   2
:First Seen                    Wed 25 Jul 2012 01:47:57 PM IST
:Last Seen                     Wed 25 Jul 2012 01:47:57 PM IST
:Local ID                      8b4d5b9f-4584-4a38-8861-ffb5d7929626
:
:Raw Audit Messages
:type=AVC msg=audit(1343204277.290:128): avc:  denied  { getattr } for  pid=32670 comm="qemu-kvm" name="/" dev="sda5" ino=5 scontext=system_u:system_r:svirt_t:s0:c195,c220 tcontext=system_u:object_r:fusefs_t:s0 tclass=filesystem
:
:
:type=SYSCALL msg=audit(1343204277.290:128): arch=x86_64 syscall=fstatfs success=no exit=EACCES a0=d a1=7fff962144b0 a2=0 a3=48 items=0 ppid=1 pid=32670 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=2 comm=qemu-kvm exe=/usr/bin/qemu-kvm subj=system_u:system_r:svirt_t:s0:c195,c220 key=(null)
:
:Hash: qemu-kvm,svirt_t,fusefs_t,filesystem,getattr
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Daniel Walsh 2012-08-03 11:52:54 UTC
Are your images stored on a fuse file system?

Comment 2 Abhay 2012-08-03 14:02:01 UTC
(In reply to comment #1)
> Are your images stored on a fuse file system?

I am sorry, i don't know what fuse filesystem is. My guestos image is stored on a disk partition which is formatted with NTFS filesystem.

Comment 3 Daniel Walsh 2012-08-06 18:19:31 UTC
Linux uses the FUSE file system to reach NTFS filesystems.


You should turn on the virt_use_fusefs  boolean.

# setsebool -P virt_use_fusefs 1

Then can you run your virtual machine in permissive mode.

# semanage permissive -a svirt_t

And gather all of the AVC messages.

# ausearch -m avc

Comment 4 Daniel Walsh 2012-08-06 18:22:22 UTC
I just checked in the expected fixes for this into Fedora 17.

Comment 5 Miroslav Grepl 2012-08-07 08:53:44 UTC
Fixed in selinux-policy-3.10.0-144.fc17

Comment 6 Fedora Update System 2012-08-08 11:22:21 UTC
selinux-policy-3.10.0-145.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-145.fc17

Comment 7 Fedora Update System 2012-08-09 23:05:28 UTC
Package selinux-policy-3.10.0-145.fc17:
* should fix your issue,
* was pushed to the Fedora 17 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.10.0-145.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-11591/selinux-policy-3.10.0-145.fc17
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-08-10 22:35:32 UTC
selinux-policy-3.10.0-145.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.