Bug 590713
Summary: | SELinux is preventing /usr/bin/qemu-img "write" access to /home/dbeer/vms/livirt/images. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | David <david.m.beer> |
Component: | libvirt | Assignee: | Daniel Veillard <veillard> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 13 | CC: | berrange, clalance, crobinso, dwalsh, itamar, jforbes, mgrepl, sassmann, veillard, virt-maint |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | setroubleshoot_trace_hash:53ac546f741cb8a7fc56fc84cce06bd6da3803b3e5793836fbabd0e00aa7cb72 | ||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2010-05-18 16:15:52 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
David
2010-05-10 14:31:41 UTC
tried to create a vmdk image in virt-manager Did you disable SELinux support in libvirt? No I haven't changed anything to do with SELinux Well libvirt should have been running your qemu process as svirt_t, so either SELInux is disabled in libvirt or we have a bug in libvirt. > Source Context system_u:system_r:qemu_t:s0-s0:c0.c1023
> Target Context unconfined_u:object_r:user_home_t:s0
> Target Objects /home/dbeer/vms/livirt/images [ dir ]
> Source qemu-img
> Source Path /usr/bin/qemu-img
This is not a virtual machine. The 'qemu-img' binary is a command line helper tool for formatting disks in non-raw formats, eg qcow2, vmdk, etc - think of it as a 'mkfs.ext3 / parted' but for virtual disk images. It is spawned by libvirtd and should probably inherit libvirtd context - it certainly shouldn't be running 'qemu_t' which is the generic QEMU virtual machine domain.
Ok so the labeling on /usr/bin/qemu-img should be bin_t not qemu_exec_t. Any others? /usr/bin/qemu system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-alpha system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-arm system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-armeb system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-cris system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-i386 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-img system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-img-xen system_u:object_r:bin_t:s0 /usr/bin/qemu-io system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-kvm system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-launcher system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-m68k system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-mips system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-mipsel system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-nbd system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-nbd-xen system_u:object_r:bin_t:s0 /usr/bin/qemu-ppc system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-ppc64 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-ppc64abi32 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-sh4 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-sh4eb system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-sparc system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-sparc32plus system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-sparc64 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-arm system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-cris system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-m68k system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-mips system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-mips64 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-mips64el system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-mipsel system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-ppc system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-ppc64 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-ppcemb system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-sh4 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-sh4eb system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-sparc system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-x86_64 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-x86_64 system_u:object_r:qemu_exec_t:s0 Adding /usr/bin/qemu-img -- gen_context(system_u:object_r:bin_t,s0) /usr/bin/qemu-launcher -- gen_context(system_u:object_r:bin_t,s0) Only 'qemu', 'qemu-kvm' 'qemu-system-$ARCH' binaries provide the full virtual machine emulator. The plain 'qemu-$ARCH' are a different type of emulator. Instead of being a full machine emulator, they're a foreign binary emulator. eg you can install PPC fedora to '/opt/fedorappc' and then run 'qemu-ppc /opt/fedorappc/bin/ls'. For this to work the qemu$ARCH binaries effectively need to be unconfined since they can be used to run any binary at all. This capability isn't used by libvirt anyway. So IMHO everything except those ones I list in the first paragraph should be bin_t So keep these as qemu_exec_t: /usr/bin/qemu system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-kvm system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-arm system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-cris system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-m68k system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-mips system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-mips64 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-mips64el system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-mipsel system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-ppc system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-ppc64 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-ppcemb system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-sh4 system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-sh4eb system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-sparc system_u:object_r:qemu_exec_t:s0 /usr/bin/qemu-system-x86_64 system_u:object_r:qemu_exec_t:s0 make the others bin_t (In reply to comment #4) > Well libvirt should have been running your qemu process as svirt_t, so either > SELInux is disabled in libvirt or we have a bug in libvirt. I have only installed the packages, never configured anything for SELinux. I have only added an additional pool for storing my vms. /usr/bin/qemu -- gen_context(system_u:object_r:qemu_exec_t,s0) /usr/bin/qemu-system-.* -- gen_context(system_u:object_r:qemu_exec_t,s0) /usr/bin/qemu-kvm -- gen_context(system_u:object_r:qemu_exec_t,s0) /usr/libexec/qemu.* -- gen_context(system_u:object_r:qemu_exec_t,s0) Ok new labeling above. Fixed in selinux-policy-3.7.19-15.fc13.noarch All other qemu will default back to bin_t. *** Bug 589900 has been marked as a duplicate of this bug. *** selinux-policy-3.7.19-15.fc13.noarch is on its way to stable, so closing this bug. |