]> xenbits.xensource.com Git - libvirt.git/commit
Set SELinux context label of pipes used for qemu migration
authorLaine Stump <laine@laine.org>
Sun, 23 Jan 2011 21:09:40 +0000 (16:09 -0500)
committerLaine Stump <laine@laine.org>
Wed, 26 Jan 2011 14:03:21 +0000 (09:03 -0500)
commit34a19dda1c525e3e94a7b51cd161fafba8f2fbe8
tree6538c597fd66fa029f49537709c49e8acc7ec598
parentd89608f994025aef9809bcb224e2d71f35fb85e9
Set SELinux context label of pipes used for qemu migration

This patch is a partial resolution to the following bug:

   https://bugzilla.redhat.com/show_bug.cgi?id=667756

(to complete the fix, an updated selinux-policy package is required,
to add the policy that allows libvirt to set the context of a fifo,
which was previously not allowed).

Explanation : When an incoming migration is over a pipe (for example,
if the image was compressed and is being fed through gzip, or was on a
root-squash nfs server, so needed to be opened by a child process
running as a different uid), qemu cannot read it unless the selinux
context label for the pipe has been set properly.

The solution is to check the fd used as the source of the migration
just before passing it to qemu; if it's a fifo (implying that it's a
pipe), we call the newly added virSecurityManagerSetFDLabel() function
to set the context properly.
src/qemu/qemu_driver.c