Bug 1221945

Summary: SELinux is preventing qemu-system-x86 from 'open' accesses on the file /dev/shm/lttng-ust-wait-5.
Product: [Fedora] Fedora Reporter: Joachim Frieben <jfrieben>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: agedosier, berrange, clalancette, crobinso, devin, dgilbert, dominick.grift, dwalsh, dzrudy, itamar, jforbes, jlayton, jorti, juliux.pigface, laine, libvirt-maint, lvrabec, mgrepl, quintela, rjt, sbonazzo, veillard, virt-maint, vpodzime
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:d414ea10879c368a141d360cd49a030f71043c7cc562d4b64fb6b36bb311c003
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-25 23:47:08 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:
Bug Depends On:    
Bug Blocks: 1186650    

Description Joachim Frieben 2015-05-15 10:10:40 UTC
Description of problem:
SELinux is preventing qemu-system-x86 from 'open' accesses on the file /dev/shm/lttng-ust-wait-5.

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

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

Additional Information:
Source Context                unconfined_u:unconfined_r:svirt_t:s0:c160,c405
Target Context                system_u:object_r:tmpfs_t:s0
Target Objects                /dev/shm/lttng-ust-wait-5 [ file ]
Source                        qemu-system-x86
Source Path                   qemu-system-x86
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-126.fc22.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.0.3-300.fc22.x86_64 #1 SMP Wed
                              May 13 18:43:52 UTC 2015 x86_64 x86_64
Alert Count                   5
First Seen                    2015-05-15 12:07:59 CEST
Last Seen                     2015-05-15 12:08:19 CEST
Local ID                      b1ad018c-283e-4d8d-8ae4-b22e4cfe615f

Raw Audit Messages
type=AVC msg=audit(1431684499.522:567): avc:  denied  { open } for  pid=2840 comm="qemu-system-x86" path="/dev/shm/lttng-ust-wait-5" dev="tmpfs" ino=21718 scontext=unconfined_u:unconfined_r:svirt_t:s0:c160,c405 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=0


Hash: qemu-system-x86,svirt_t,tmpfs_t,file,open

Version-Release number of selected component:
selinux-policy-3.13.1-126.fc22.noarch

Additional info:
reporter:       libreport-2.5.1
hashmarkername: setroubleshoot
kernel:         4.0.3-300.fc22.x86_64
type:           libreport

Comment 1 Jeff Layton 2015-05-15 14:15:54 UTC
Description of problem:
Recently updated from f21 to f22. Started a VM that I had created under f21 on the new installation.

Version-Release number of selected component:
selinux-policy-3.13.1-126.fc22.noarch

Additional info:
reporter:       libreport-2.5.1
hashmarkername: setroubleshoot
kernel:         4.0.2-300.fc22.x86_64
type:           libreport

Comment 2 Juan Orti 2015-05-15 22:19:00 UTC
Description of problem:
Starting a VM

Version-Release number of selected component:
selinux-policy-3.13.1-126.fc22.noarch

Additional info:
reporter:       libreport-2.5.1
hashmarkername: setroubleshoot
kernel:         4.0.3-300.fc22.x86_64
type:           libreport

Comment 3 Miroslav Grepl 2015-05-18 08:25:12 UTC
OK, it relates with lttng support. 

Are you able to create/start a virtual machine even this error?

Comment 4 Miroslav Grepl 2015-05-18 08:25:35 UTC
*** Bug 1221961 has been marked as a duplicate of this bug. ***

Comment 5 Miroslav Grepl 2015-05-18 09:35:54 UTC
*** Bug 1222190 has been marked as a duplicate of this bug. ***

Comment 6 Juan Orti 2015-05-18 09:46:07 UTC
This error pops up, but the VMs start/stop correctly.

Comment 7 Miroslav Grepl 2015-05-18 09:47:51 UTC
It relates with #1222157. We need to add a support for it in SELinux policy but I believe we don't want to allow it until we get a separation on it by libvirt.

Comment 8 Richard J. Turner 2015-05-19 08:19:28 UTC
Description of problem:
I have two VMs set to start on host boot. This AVC denial notification occurred upon log-in.

Version-Release number of selected component:
selinux-policy-3.13.1-126.fc22.noarch

Additional info:
reporter:       libreport-2.5.1
hashmarkername: setroubleshoot
kernel:         4.0.3-300.fc22.x86_64
type:           libreport

Comment 9 Cole Robinson 2015-05-19 15:31:23 UTC
(In reply to Miroslav Grepl from comment #7)
> It relates with #1222157. We need to add a support for it in SELinux policy
> but I believe we don't want to allow it until we get a separation on it by
> libvirt.

Not sure what you mean 'separation on it by libvirt'

FWIW this doesn't seem to be anything explicitly used by libvirt or qemu, but instead used automatically by ceph/librados (which both libvirt and qemu link to). So I don't think this is something that libvirt's svirt labelling should explicitly know about

Comment 10 Daniel Walsh 2015-05-20 18:11:11 UTC
How do these files get created with the wrong label?  Is this the kernel creating the files?

Comment 11 Cole Robinson 2015-05-25 23:36:36 UTC
There's a similar issue WRT apparmor: https://bugs.launchpad.net/ubuntu/+source/ust/+bug/1404302

Comment 12 Cole Robinson 2015-05-25 23:47:08 UTC
Turns out fedora ceph disabled the lttng bits in the most recent builds for other reasons, so duping to that: https://bugzilla.redhat.com/show_bug.cgi?id=1223319

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