Bug 532478 - SELinux is preventing /usr/bin/qemu-kvm "write" access on sr0.
SELinux is preventing /usr/bin/qemu-kvm "write" access on sr0.
Status: CLOSED DUPLICATE of bug 537163
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-11-02 10:07 EST by Adam Plumb
Modified: 2009-12-01 15:25 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-12-01 15:25:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Guest XML file (1.26 KB, text/xml)
2009-11-02 13:16 EST, Adam Plumb
no flags Details

  None (edit)
Description Adam Plumb 2009-11-02 10:07:15 EST

SELinux is preventing /usr/bin/qemu-kvm "write" access on sr0.

Detailed Description:

SELinux denied access requested by qemu-kvm. It is not expected that this access
is required by qemu-kvm and this access may signal an intrusion attempt. It is
also possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Please file a bug

Additional Information:

Source Context                system_u:system_r:svirt_t:s0:c98,c190
Target Context                system_u:object_r:virt_content_t:s0
Target Objects                sr0 [ blk_file ]
Source                        qemu-kvm
Source Path                   /usr/bin/qemu-kvm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           qemu-system-x86-0.11.0-9.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-35.fc12
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed) #1 SMP Fri
                              Oct 23 19:39:36 EDT 2009 i686 i686
Alert Count                   1
First Seen                    Mon 02 Nov 2009 10:01:28 AM EST
Last Seen                     Mon 02 Nov 2009 10:01:28 AM EST
Local ID                      cb8b356d-8544-42c2-9b13-8ddb417b8778
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1257174088.30:27390): avc:  denied  { write } for  pid=4663 comm="qemu-kvm" name="sr0" dev=tmpfs ino=3508 scontext=system_u:system_r:svirt_t:s0:c98,c190 tcontext=system_u:object_r:virt_content_t:s0 tclass=blk_file

node=(removed) type=SYSCALL msg=audit(1257174088.30:27390): arch=40000003 syscall=5 success=no exit=-13 a0=bfd6fcb7 a1=9002 a2=0 a3=bfd6fcb7 items=0 ppid=1 pid=4663 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:c98,c190 key=(null)

Hash String generated from  selinux-policy-3.6.32-35.fc12,catchall,qemu-kvm,svirt_t,virt_content_t,blk_file,write
audit2allow suggests:

#============= svirt_t ==============
allow svirt_t virt_content_t:blk_file write;
Comment 1 Daniel Walsh 2009-11-02 11:09:52 EST
I think libvirt has labeled this device incorrectly.  If the image is r/w and shared it should be labled


If it is not share it should be labled svirt_image_t:s0:c98.c190

If it is readonly it is labeled correctly.
Comment 2 Daniel Berrange 2009-11-02 11:19:23 EST
Can you provide the guest XML configuration for this guest.

ie, the 'virsh dumpxml GUESTNAME'  output, or the /etc/libvirt/qemu/$GUESTNAME.log file, and also the /var/log/libvirt/qemu/$GUESTNAME.log logfile

I suspect this may in fact be a QEMU bug, with it trying to write to a device it should be treating as readonly.
Comment 3 Adam Plumb 2009-11-02 13:16:54 EST
Created attachment 367176 [details]
Guest XML file
Comment 4 Adam Plumb 2009-11-02 13:18:09 EST
I've attached the guest.log file as requested.

FYI, this is on an updated Fedora 12 Rawhide machine.  The guest is CentOS 5 and I'm using a DVD to install, not an ISO that is on the computer.  My cdrom device is /dev/sr0.
Comment 5 Bug Zapper 2009-11-16 09:53:11 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
Comment 6 Andre Robatino 2009-11-17 10:44:13 EST
Seeing this on F12 Final x86_64 when attempting to create a F12 ppc guest.
Comment 7 Daniel Walsh 2009-12-01 15:25:44 EST

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

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