qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	libvir-list@redhat.com, Corey Bryant <coreyb@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, Blue Swirl <blauwirbel@gmail.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [Qemu-devel] [libvirt] [PATCH v4] Add support for fd: protocol
Date: Tue, 23 Aug 2011 16:51:31 +0100	[thread overview]
Message-ID: <20110823155131.GM5728@redhat.com> (raw)
In-Reply-To: <4E53CC2B.4000604@redhat.com>

On Tue, Aug 23, 2011 at 05:50:03PM +0200, Kevin Wolf wrote:
> Am 23.08.2011 17:26, schrieb Daniel P. Berrange:
> > On Tue, Aug 23, 2011 at 11:13:34AM -0400, Corey Bryant wrote:
> >>
> >>
> >> On 08/22/2011 02:39 PM, Blue Swirl wrote:
> >>> On Mon, Aug 22, 2011 at 5:42 PM, Corey Bryant<coreyb@linux.vnet.ibm.com>  wrote:
> >>>>>
> >>>>>
> >>>>>  On 08/22/2011 01:25 PM, Anthony Liguori wrote:
> >>>>>>>
> >>>>>>>  On 08/22/2011 11:50 AM, Daniel P. Berrange wrote:
> >>>>>>>>>
> >>>>>>>>>  On Mon, Aug 22, 2011 at 11:29:12AM -0500, Anthony Liguori wrote:
> >>>>>>>>>>>
> >>>>>>>>>>>  I don't think it makes sense to have qemu-fe do dynamic labelling.
> >>>>>>>>>>>  You certainly could avoid the fd passing by having qemu-fe do the
> >>>>>>>>>>>  open though and just let qemu-fe run without the restricted security
> >>>>>>>>>>>  context.
> >>>>>>>>>
> >>>>>>>>>  qemu-fe would also not be entirely simple,
> >>>>>>>
> >>>>>>>  Indeed.
> >>>>>>>
> >>>>>
> >>>>>  I do like the idea of a privileged qemu-fe performing the open and passing
> >>>>>  the fd to a restricted qemu.
> >>> Me too.
> >>>
> >>>>>    However, I get the impression that this won't
> >>>>>  get delivered nearly as quickly as fd: passing could be.  How soon do we
> >>>>>  need image isolation for NFS?
> >>>>>
> >>>>>  Btw, this sounds similar to what Blue Swirl recommended here on v1 of this
> >>>>>  patch:http://lists.gnu.org/archive/html/qemu-devel/2011-05/msg02187.html
> >>> I was thinking about simply doing fork() + setuid() at some point and
> >>> using the FD passing structures directly. But would it bring
> >>> advantages to have two separate executables, are they different from
> >>> access control point of view vs. single but forked one?
> >>>
> >>
> >> We could put together an SELinux policy that would transition
> >> qemu-fe to a more restricted domain (ie. no open privilege on NFS
> >> files) when it executes qemu-system-x86_64.
> > 
> > Thinking about this some more, I don't really think the idea of delegating
> > open of NFS files to a separate qemu-fe is very desirable. Libvirt makes the
> > decision on the security policy that the VM will run under, and provides
> > audit records to log what resources are being assigned to the VM. From that
> > point onwards, we must be able to guarantee that MAC will be enforced on
> > the VM, according to what we logged via the auditd system.
> > 
> > In the case where we delegate opening of the files to qemu-fe, and allow
> > its policy to open NFS files, we no longer have a guarentee that the MAC
> > policy will be enforced as we originally intended. Yes, qemu-fe will very
> > likely honour what we tell it and open the correct files, and yes qmeu-fe
> > has lower attack surface wrt the guest than the real qemu does, but we
> > still loose the guarentee of MAC enforcement from libvirt's POV.
> 
> On the other hand, from a qemu POV libvirt is only one possible
> management tool. In practice, another very popular "management tool" for
> qemu is bash. With qemu-fe all the other tools, including direct
> invocation from the command line, would get some protection, too.

That's why I said a qemu-fe like tool need not be mutually exclusive
with exposing FD passing to a management tool like libvirt. Both
qemu-fe and libvirt need to some mechanism to pass open FDs to the
real QEMU.  We could needlessly invent a new communication channel
between qemu-fe and qemu that only it can use, or we can use the
channel we already have - QMP - to provide an interface that either
qemu-fe or libvirt, can use to pass FDs into the real QEMU.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2011-08-23 15:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 14:50 [Qemu-devel] [PATCH v4] Add support for fd: protocol Corey Bryant
2011-08-22 15:38 ` Christoph Hellwig
2011-08-22 16:06   ` Corey Bryant
2011-08-22 16:24   ` [Qemu-devel] [libvirt] " Daniel P. Berrange
2011-08-22 16:29     ` Anthony Liguori
2011-08-22 16:50       ` Daniel P. Berrange
2011-08-22 17:25         ` Anthony Liguori
2011-08-22 17:42           ` Corey Bryant
2011-08-22 18:39             ` Blue Swirl
2011-08-23 15:13               ` Corey Bryant
2011-08-23 15:26                 ` Daniel P. Berrange
2011-08-23 15:50                   ` Kevin Wolf
2011-08-23 15:51                     ` Daniel P. Berrange [this message]
2011-08-23 16:04                       ` Daniel P. Berrange
2011-08-23 16:14                     ` Corey Bryant
2011-08-22 18:22           ` Daniel P. Berrange
2011-08-22 18:54             ` Blue Swirl
2011-08-22 19:25             ` Anthony Liguori
2011-08-23 14:26               ` Corey Bryant
2011-08-23 14:33                 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110823155131.GM5728@redhat.com \
    --to=berrange@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=coreyb@linux.vnet.ibm.com \
    --cc=hch@lst.de \
    --cc=kwolf@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).