Bug 852160

Summary: SELinux preventing /usr/bin/qemu-kvm from write access on the directory with config_home_t type
Product: [Fedora] Fedora Reporter: IBM Bug Proxy <bugproxy>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, jkachuck, mgrepl, wgomerin
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-21 23:59:38 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 IBM Bug Proxy 2012-08-27 18:01:23 UTC
---Problem Description---
SELinux is preventing /usr/bin/qemu-kvm from 'write' accesses on the config_home_t type directory

---uname output---
3.5.2-1.fc17.x86_64
 
Machine Type = x86_64 
  
---Steps to Reproduce---
 When I am trying to run libvirt with selinux as permissive under an underprivileged user using /usr/bin/virsh -c qemu:///session I get the follwoing denials

Raw Audit Messages
type=AVC msg=audit(1346078885.821:100): avc:  denied  { write } for  pid=2060 comm="qemu-kvm" name="lib" dev="dm-2" ino=15204904 scontext=unconfined_u:unconfined_r:svirt_t:s0:c202,c936 tcontext=unconfined_u:object_r:config_home_t:s0 tclass=dir


type=AVC msg=audit(1346078885.821:100): avc:  denied  { add_name } for  pid=2060 comm="qemu-kvm" name="F14_64.monitor" scontext=unconfined_u:unconfined_r:svirt_t:s0:c202,c936 tcontext=unconfined_u:object_r:config_home_t:s0 tclass=dir


type=AVC msg=audit(1346078885.821:100): avc:  denied  { create } for  pid=2060 comm="qemu-kvm" name="F14_64.monitor" scontext=unconfined_u:unconfined_r:svirt_t:s0:c202,c936 tcontext=unconfined_u:object_r:config_home_t:s0 tclass=sock_file


type=SYSCALL msg=audit(1346078885.821:100): arch=x86_64 syscall=bind success=yes exit=0 a0=3 a1=7fff5e083560 a2=6e a3=756d65712f747269 items=0 ppid=1 pid=2060 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=unconfined_u:unconfined_r:svirt_t:s0:c202,c936 key=(null)

Hash: qemu-kvm,svirt_t,config_home_t,dir,write

audit2allow

#============= svirt_t ==============
#!!!! The source type 'svirt_t' can write to a 'dir' of the following types:
# tmpfs_t, tmp_t, svirt_tmp_t, var_t, hugetlbfs_t, svirt_image_t, svirt_tmpfs_t, virt_cache_t, var_run_t, qemu_var_run_t, svirt_home_t, virt_home_t, dosfs_t

allow svirt_t config_home_t:dir { write add_name };
allow svirt_t config_home_t:sock_file create;

audit2allow -R

#============= svirt_t ==============
#!!!! The source type 'svirt_t' can write to a 'dir' of the following types:
# tmpfs_t, tmp_t, svirt_tmp_t, var_t, hugetlbfs_t, svirt_image_t, svirt_tmpfs_t, virt_cache_t, var_run_t, qemu_var_run_t, svirt_home_t, virt_home_t, dosfs_t

allow svirt_t config_home_t:dir { write add_name };
allow svirt_t config_home_t:sock_file create;

Comment 1 Miroslav Grepl 2012-08-28 07:33:36 UTC
should be fixed by

selinux-policy-3.10.0-148.fc17

Comment 2 IBM Bug Proxy 2012-09-06 21:00:29 UTC
------- Comment From rmarwah.com 2012-09-06 20:58 EDT-------
Thanks a lot for backporting and fixing the bug

Comment 3 Fedora Update System 2012-09-17 12:13:56 UTC
selinux-policy-3.10.0-149.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-149.fc17

Comment 4 Fedora Update System 2012-09-19 02:55:33 UTC
Package selinux-policy-3.10.0-149.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-149.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14301/selinux-policy-3.10.0-149.fc17
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2012-09-21 23:59:38 UTC
selinux-policy-3.10.0-149.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.