Bug 1016326 - SELinux is preventing /usr/bin/qemu-system-x86_64 from 'attach_queue' accesses on the tun_socket .
SELinux is preventing /usr/bin/qemu-system-x86_64 from 'attach_queue' accesse...
Status: CLOSED DUPLICATE of bug 1147057
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-10-07 19:07 EDT by Cole Robinson
Modified: 2016-04-26 09:35 EDT (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-10-07 11:35:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Cole Robinson 2013-10-07 19:07:02 EDT
Description of problem:
Configured multiqueue virtio-net with libvirt, then ran this inside the guest:

ethtool -L eth0 combined 4

Where there should be 4 tap FDs allocated to the guest for each queue. FWIW I think this is supposed to work
SELinux is preventing /usr/bin/qemu-system-x86_64 from 'attach_queue' accesses on the tun_socket .

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

If you believe that qemu-system-x86_64 should be allowed attach_queue access on the  tun_socket 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 qemu-system-x86 /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:svirt_t:s0:c194,c501
Target Context                system_u:system_r:virtd_t:s0-s0:c0.c1023
Target Objects                 [ tun_socket ]
Source                        qemu-system-x86
Source Path                   /usr/bin/qemu-system-x86_64
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           qemu-system-x86-1.6.0-8.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-83.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.11.3-301.fc20.x86_64 #1 SMP Thu
                              Oct 3 00:57:21 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-10-07 19:04:31 EDT
Last Seen                     2013-10-07 19:04:31 EDT
Local ID                      a137a3fd-1922-4b2d-ba88-b30cd8472aa0

Raw Audit Messages
type=AVC msg=audit(1381187071.716:2194): avc:  denied  { attach_queue } for  pid=27690 comm="qemu-system-x86" scontext=system_u:system_r:svirt_t:s0:c194,c501 tcontext=system_u:system_r:virtd_t:s0-s0:c0.c1023 tclass=tun_socket

type=SYSCALL msg=audit(1381187071.716:2194): arch=x86_64 syscall=ioctl success=yes exit=0 a0=1e a1=400454d9 a2=7feb9926d850 a3=0 items=0 ppid=1 pid=27690 auid=4294967295 uid=107 gid=107 euid=107 suid=107 fsuid=107 egid=107 sgid=107 fsgid=107 ses=4294967295 tty=(none) comm=qemu-system-x86 exe=/usr/bin/qemu-system-x86_64 subj=system_u:system_r:svirt_t:s0:c194,c501 key=(null)

Hash: qemu-system-x86,svirt_t,virtd_t,tun_socket,attach_queue

Additional info:
reporter:       libreport-2.1.7
hashmarkername: setroubleshoot
kernel:         3.11.3-301.fc20.x86_64
type:           libreport
Comment 1 Daniel Walsh 2013-10-09 10:10:26 EDT
I think libvirt would need to relabel the tun_socket to match the svirt_t label to make this secure.
Comment 2 Cole Robinson 2014-10-07 11:35:31 EDT

*** This bug has been marked as a duplicate of bug 1147057 ***

Note You need to log in before you can comment on or make changes to this bug.