Bug 528264 - SELinux is preventing qemu-kvm (svirt_t) "write" virt_content_t.
SELinux is preventing qemu-kvm (svirt_t) "write" virt_content_t.
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
11
x86_64 Linux
low Severity high
: ---
: ---
Assigned To: Justin M. Forbes
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-10 06:46 EDT by masssimino
Modified: 2010-06-28 10:59 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-28 10:59:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
selinux-alerts guest.log guest.xml virt-manager.log (76.82 KB, text/plain)
2009-10-15 13:00 EDT, masssimino
no flags Details

  None (edit)
Description masssimino 2009-10-10 06:46:46 EDT
Description of problem: SELinux troubleshooter: "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." 


Version-Release number of selected component (if applicable): qemu-system-x86-0.10.6-6.fc11


How reproducible: always


Steps to Reproduce:
1.
2.
3.
  
Actual results: There is impossible to create qemu-kvm virtual machine. Only if to change SELinux to permissive mode. 


Expected results:


Additional info: Raw Audit Messages :node=whiteboxx64 type=AVC msg=audit(1255170200.739:362): avc: denied { write } for pid=4190 comm="qemu-kvm" name="RIPLinuX-8.1.iso" dev=sda6 ino=1081348 scontext=system_u:system_r:svirt_t:s0:c575,c678 tcontext=system_u:object_r:virt_content_t:s0 tclass=file node=whiteboxx64 type=SYSCALL msg=audit(1255170200.739:362): arch=c000003e syscall=2 success=no exit=-13 a0=7fffae77c9b0 a1=1002 a2=1a4 a3=30 items=0 ppid=1 pid=4190 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="qemu-kvm" exe="/usr/bin/qemu-kvm" subj=system_u:system_r:svirt_t:s0:c575,c678 key=(null)
Comment 1 Daniel Berrange 2009-10-12 05:57:21 EDT
Please provide the guest XML config file, and the log file /var/log/libvirt/qemu/$GUEST.log
Comment 2 masssimino 2009-10-12 13:56:45 EDT
(In reply to comment #1)
> Please provide the guest XML config file, and the log file
> /var/log/libvirt/qemu/$GUEST.log  

Unfortunately I deleted all of my vm's. I have only one XML-config but a lot of log-files. I'm not sure if I should post all of them. Here is the last log. 
One more comment: I was need RIP-linux to format virtual disk to FAT32 with the purpose that BeOS could see that disk. 


#########RIP.log-20091012

LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -cpu qemu32 -m 512 -smp 1 -name RIP -uuid 255469cd-448d-e1d7-265f-6643d7fc4d67 -monitor pty -pidfile /var/run/libvirt/qemu//RIP.pid -no-reboot -boot d -drive file=/var/lib/libvirt/images/isos/RIPLinuX-8.1.iso,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/RIP.img,if=virtio,index=0 -net nic,macaddr=54:52:00:07:85:20,vlan=0,model=virtio -net tap,fd=18,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:1 
char device redirected to /dev/pts/0
char device redirected to /dev/pts/1
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -cpu qemu32 -m 512 -smp 1 -name RIP -uuid 255469cd-448d-e1d7-265f-6643d7fc4d67 -monitor pty -pidfile /var/run/libvirt/qemu//RIP.pid -boot a -drive file=/var/lib/libvirt/images/isos/BeOS5PEMaxEditionV4b1.iso,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/floppies/FLOPPY.img,if=floppy,index=0 -drive file=/var/lib/libvirt/images/RIP.img,if=virtio,index=0 -net nic,macaddr=54:52:00:07:85:20,vlan=0,model=virtio -net tap,fd=18,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:1 
char device redirected to /dev/pts/0
char device redirected to /dev/pts/1
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -cpu qemu32 -m 512 -smp 1 -name RIP -uuid 255469cd-448d-e1d7-265f-6643d7fc4d67 -monitor pty -pidfile /var/run/libvirt/qemu//RIP.pid -boot a -drive file=/var/lib/libvirt/images/isos/BeOS5PEMaxEditionV4b1.iso,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/floppies/FLOPPY.img,if=floppy,index=0 -drive file=/var/lib/libvirt/images/RIP.img,if=virtio,index=0 -net nic,macaddr=54:52:00:07:85:20,vlan=0,model=virtio -net tap,fd=19,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:1 
char device redirected to /dev/pts/0
char device redirected to /dev/pts/1
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -cpu qemu32 -m 512 -smp 1 -name RIP -uuid 255469cd-448d-e1d7-265f-6643d7fc4d67 -monitor pty -pidfile /var/run/libvirt/qemu//RIP.pid -boot a -drive file=/var/lib/libvirt/images/isos/BeOS5PEMaxEditionV4b1.iso,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/floppies/FLOPPY.img,if=floppy,index=0 -drive file=/var/lib/libvirt/images/RIP.img,if=virtio,index=0 -net nic,macaddr=54:52:00:07:85:20,vlan=0,model=virtio -net tap,fd=19,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:1 
char device redirected to /dev/pts/0
char device redirected to /dev/pts/1
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -cpu qemu32 -m 512 -smp 1 -name RIP -uuid 255469cd-448d-e1d7-265f-6643d7fc4d67 -monitor pty -pidfile /var/run/libvirt/qemu//RIP.pid -boot a -drive file=/var/lib/libvirt/images/BeOS-1.img,if=ide,index=0 -drive file=/var/lib/libvirt/images/isos/BeOS5PEMaxEditionV4b1.iso,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/floppies/FLOPPY.img,if=floppy,index=0 -net nic,macaddr=54:52:00:07:85:20,vlan=0,model=virtio -net tap,fd=19,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:1 
char device redirected to /dev/pts/0
char device redirected to /dev/pts/1
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -cpu qemu32 -m 512 -smp 1 -name RIP -uuid 255469cd-448d-e1d7-265f-6643d7fc4d67 -monitor pty -pidfile /var/run/libvirt/qemu//RIP.pid -boot a -drive file=/var/lib/libvirt/images/BeOS-1.img,if=ide,index=0 -drive file=/var/lib/libvirt/images/isos/BeOS5PEMaxEditionV4b1.iso,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/floppies/FLOPPY.img,if=floppy,index=0 -net nic,macaddr=54:52:00:07:85:20,vlan=0,model=virtio -net tap,fd=19,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:1 
char device redirected to /dev/pts/0
char device redirected to /dev/pts/1
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin XAUTHORITY=/home/masssimino/.Xauthority DISPLAY=:0.0 /usr/bin/qemu-kvm -S -M pc -cpu qemu32 -m 512 -smp 1 -name RIP -uuid 255469cd-448d-e1d7-265f-6643d7fc4d67 -monitor pty -pidfile /var/run/libvirt/qemu//RIP.pid -boot a -drive file=/var/lib/libvirt/images/BeOS-1.img,if=ide,index=0 -drive file=/var/lib/libvirt/images/isos/BeOS5PEMaxEditionV4b1.iso,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/floppies/FLOPPY.img,if=floppy,index=0 -net nic,macaddr=54:52:00:07:85:20,vlan=0,model=virtio -net tap,fd=19,vlan=0 -serial pty -parallel none -usb 
char device redirected to /dev/pts/0
char device redirected to /dev/pts/1
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin XAUTHORITY=/home/masssimino/.Xauthority DISPLAY=:0.0 /usr/bin/qemu-kvm -S -M pc -cpu qemu32 -m 512 -smp 1 -name RIP -uuid 255469cd-448d-e1d7-265f-6643d7fc4d67 -monitor pty -pidfile /var/run/libvirt/qemu//RIP.pid -boot a -drive file=/var/lib/libvirt/images/BeOS-1.img,if=ide,index=0 -drive file=/var/lib/libvirt/images/isos/BeOS5PEMaxEditionV4b1.iso,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/floppies/FLOPPY.img,if=floppy,index=0 -net nic,macaddr=54:52:00:07:85:20,vlan=0,model=virtio -net tap,fd=19,vlan=0 -serial pty -parallel none -usb 
char device redirected to /dev/pts/0
char device redirected to /dev/pts/1
-----------------------------------------------------------------------------
########RIP.xml

<domain type='kvm'>
  <name>RIP</name>
  <uuid>255469cd-448d-e1d7-265f-6643d7fc4d67</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686' machine='pc'>hvm</type>
    <boot dev='fd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/var/lib/libvirt/images/BeOS-1.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk type='file' device='cdrom'>
      <source file='/var/lib/libvirt/images/isos/BeOS5PEMaxEditionV4b1.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>
    <disk type='file' device='floppy'>
      <source file='/var/lib/libvirt/images/floppies/FLOPPY.img'/>
      <target dev='fda' bus='fdc'/>
    </disk>
    <interface type='network'>
      <mac address='54:52:00:07:85:20'/>
      <source network='default'/>
      <model type='virtio'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='sdl' display=':0.0' xauth='/home/masssimino/.Xauthority'/>
    <sound model='es1370'/>
  </devices>
</domain>
-----------------------------------------------------------------------------
Comment 3 Mark McLoughlin 2009-10-13 06:29:59 EDT
It looks like qemu was trying to write to the ISO

However, we really need your help in reproducing this in order for us to fix it

Please try installing again using RIPLinuX-8.1.iso and see if you get the issue again

If you're using virt-manager, retain ~/.virt-manager/virt-manager.log.

See http://fedoraproject.org/wiki/Reporting_virtualization_bugs for more details on the kind of info that is helpful
Comment 4 masssimino 2009-10-15 13:00:07 EDT
Created attachment 364969 [details]
selinux-alerts guest.log guest.xml virt-manager.log

'1-selinux-before.txt' contains SELinux alerts that were appearing before guest OS' files installation on the virtual 'hda'. '1-selinux-after.txt' contains alerts after installation. There was no alerts during installation process.
Comment 5 masssimino 2009-10-15 14:35:16 EDT
(In reply to comment #3)
> It looks like qemu was trying to write to the ISO
> 
> However, we really need your help in reproducing this in order for us to fix it
> 
> Please try installing again using RIPLinuX-8.1.iso and see if you get the issue
> again
> 
> If you're using virt-manager, retain ~/.virt-manager/virt-manager.log.
> 
> See http://fedoraproject.org/wiki/Reporting_virtualization_bugs for more
> details on the kind of info that is helpful  

I've submitted an attachment. It's archive with the *.log files. I have reproduced installation of vm again by almost the same way as earlier. The sequence of my operations was the following. I formatted raw hd-image to fat32 with the PartedMagic.iso. Further I've booted with BeOS 'FLOPPY.img' and switched to boot with CD-image 'BeOS5PEMaxEditionV4b1.iso'. This iso ran in LiveCD-mode as well as in the Installation-mode. Installation process took about 3-4 hours. After that the system didn't start because 'hda' appeared non-bootable. I really can fix this, because I already installed BeOS in kvm successfully with this iso. The issue that I want to be resolved is a huge amount of SELinux warnings.
Comment 6 Mark McLoughlin 2009-10-16 10:00:05 EDT
Okay, I don't see the same (or similar) AVC as you posted in comment #1

The other AVCs seem to be from bug #515521 

Could you make sure your devpts line in /etc/fstab looks like:

  devpts     /dev/pts   devpts  gid=5,mode=620   0 0

If not, fix it up, reboot and try again. Thanks
Comment 7 Mark McLoughlin 2009-11-20 14:43:20 EST
any update masssimino?
Comment 8 masssimino 2009-11-20 16:26:39 EST
I've changed fstab as you wrote above and the warnings disappeared. I've had no updates so far because on Nov 19th I updated to Fedora 12 and haven't run kvm yet.
Comment 9 Fedora Admin XMLRPC Client 2010-03-09 11:53:34 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 10 Fedora Admin XMLRPC Client 2010-03-09 12:17:20 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 11 Bug Zapper 2010-04-28 06:46:53 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 12 Bug Zapper 2010-06-28 10:59:27 EDT
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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