From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjB1d-00058K-E2 for qemu-devel@nongnu.org; Tue, 19 Jul 2011 10:11:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjB1b-0001Xq-WB for qemu-devel@nongnu.org; Tue, 19 Jul 2011 10:11:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjB1b-0001XW-GQ for qemu-devel@nongnu.org; Tue, 19 Jul 2011 10:11:51 -0400 Message-ID: <4E25902D.2000403@redhat.com> Date: Tue, 19 Jul 2011 16:09:49 +0200 From: Jes Sorensen MIME-Version: 1.0 References: <4E2055AE.8090107@redhat.com> <4E253136.4080509@redhat.com> <4E258635.2040108@redhat.com> <4E258D70.6000205@redhat.com> In-Reply-To: <4E258D70.6000205@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] live snapshot wiki updated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Stefan Hajnoczi , QEMU Developers , Stefan Hajnoczi On 07/19/11 15:58, Eric Blake wrote: > On 07/19/2011 07:27 AM, Jes Sorensen wrote: >> Eric, what happens if libvirt in an selinux environment tells QEMU to >> launch using an image file that is backed by backing file(s)? > > Before starting qemu, libvirt first parses all the image files, to see > if any of them have backing images. For every qcow2 or qed image with a > backing file, libvirt sets the SELinux context of both the qcow2 image > and its backing file so that qemu will be able to successfully open() > them. But if any of those files reside on NFS, then it is not possible > to label individual files, so it requires setting the SELinux bool > virt_use_nfs, which thus gives qemu the power to open() arbitrary files > on NFS, and you've lost security. Urgh, libvirt parsing image files is really unfortunate, it really doesn't give me warm fuzzy feelings :( libvirt really should not know about internals of image formats. > It would be nice if libvirt had a way to pass fds for every disk and > backing file up front; then, SELinux can work around the lack of NFS > per-file labelling by blocking open() in qemu. In fact, this has > already been proposed: A cleaner solution seems to have libvirt provide a call-back allowing QEMU to call out and have libvirt open a file descriptor instead. This way libvirt can validate it and open it for QEMU and pass it back. If we cannot do something like this, I would prefer to have backing files on NFS should simply not be supported when running in an selinux setup. Cheers, Jes