Bug 886700

Summary: SELinux is preventing /usr/bin/qemu-kvm from 'write' accesses on the sock_file socket.
Product: [Fedora] Fedora Reporter: Eric Blake <eblake>
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:212077c09680d62e23a43ab64652156e84218126b841300451d5effa089eae32
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-18 06:53:40 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 Eric Blake 2012-12-12 22:31:34 UTC
Description of problem:
using virt-manager to create a new VM using the Fedora 18 beta live dvd iso; not sure if this bug is in policy, qemu, or libvirt
SELinux is preventing /usr/bin/qemu-kvm from 'write' accesses on the sock_file socket.

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

If you believe that qemu-kvm should be allowed write access on the socket sock_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 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:c565,c819
Target Context                system_u:object_r:nscd_var_run_t:s0
Target Objects                socket [ sock_file ]
Source                        qemu-kvm
Source Path                   /usr/bin/qemu-kvm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           qemu-system-x86-1.2.0-24.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-62.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.6.9-4.fc18.x86_64 #1 SMP Tue Dec
                              4 14:12:51 UTC 2012 x86_64 x86_64
Alert Count                   1
First Seen                    2012-12-12 15:27:20 MST
Last Seen                     2012-12-12 15:27:20 MST
Local ID                      50cd8da6-1151-4a3e-b739-6264e9c4b653

Raw Audit Messages
type=AVC msg=audit(1355351240.222:3563): avc:  denied  { write } for  pid=8778 comm="qemu-kvm" name="socket" dev="tmpfs" ino=2896679 scontext=system_u:system_r:svirt_t:s0:c565,c819 tcontext=system_u:object_r:nscd_var_run_t:s0 tclass=sock_file


type=SYSCALL msg=audit(1355351240.222:3563): arch=x86_64 syscall=connect success=no exit=EACCES a0=5 a1=7fffe84acd70 a2=6e a3=ffffffffffffffff items=0 ppid=1 pid=8778 auid=4294967295 uid=107 gid=107 euid=107 suid=107 fsuid=107 egid=107 sgid=107 fsgid=107 tty=(none) ses=4294967295 comm=qemu-kvm exe=/usr/bin/qemu-kvm subj=system_u:system_r:svirt_t:s0:c565,c819 key=(null)

Hash: qemu-kvm,svirt_t,nscd_var_run_t,sock_file,write

audit2allow

#============= svirt_t ==============
allow svirt_t nscd_var_run_t:sock_file write;

audit2allow -R

#============= svirt_t ==============
allow svirt_t nscd_var_run_t:sock_file write;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.6.9-4.fc18.x86_64
type:           libreport

Comment 2 Miroslav Grepl 2012-12-16 22:48:01 UTC
Fixed in selinux-policy-3.11.1-65.fc18

Comment 3 Fedora Update System 2012-12-17 17:39:08 UTC
selinux-policy-3.11.1-66.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-66.fc18

Comment 4 Fedora Update System 2012-12-18 06:53:42 UTC
selinux-policy-3.11.1-66.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.