From: Corey Bryant <bryntcor@us.ibm.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Blue Swirl <blauwirbel@gmail.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Tyler C Hicks <tchicks@us.ibm.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Add support for fd: protocol
Date: Mon, 23 May 2011 14:20:14 -0400 [thread overview]
Message-ID: <4DDAA55E.5000701@us.ibm.com> (raw)
In-Reply-To: <m3k4dhv3r6.fsf@blackfin.pond.sub.org>
On 05/23/2011 11:24 AM, Markus Armbruster wrote:
> Kevin Wolf<kwolf@redhat.com> writes:
>
>> Am 20.05.2011 21:53, schrieb Blue Swirl:
>>> On Fri, May 20, 2011 at 10:42 PM, Anthony Liguori<anthony@codemonkey.ws> wrote:
>>>> On 05/20/2011 02:25 PM, Blue Swirl wrote:
>>>>>
>>>>> On Fri, May 20, 2011 at 9:48 PM, Corey Bryant<bryntcor@us.ibm.com> wrote:
>>>>>>
>>>>>> sVirt provides SELinux MAC isolation for Qemu guest processes and their
>>>>>> corresponding resources (image files). sVirt provides this support
>>>>>> by labeling guests and resources with security labels that are stored
>>>>>> in file system extended attributes. Some file systems, such as NFS, do
>>>>>> not support the extended attribute security namespace, which is needed
>>>>>> for image file isolation when using the sVirt SELinux security driver
>>>>>> in libvirt.
>>>>>>
>>>>>> The proposed solution entails a combination of Qemu, libvirt, and
>>>>>> SELinux patches that work together to isolate multiple guests' images
>>>>>> when they're stored in the same NFS mount. This results in an
>>>>>> environment where sVirt isolation and NFS image file isolation can both
>>>>>> be provided.
>>>>>
>>>>> Very nice. QEMU should use this to support privilege separation. We
>>>>> already have chroot and runas switches, a new switch should convert
>>>>> all file references to fd references internally for that process. If
>>>>> this can be made transparent, this should even be the default way of
>>>>> operation.
>>>>
>>>> You mean, QEMU starts up, opens all disk images, reinvokes itself in a
>>>> confined context, and then passes fds to the child?
>>>
>>> And exit after that, or do the same without forking.
>>>
>>> This wouldn't work now for the native CDROM devices which need to
>>> reopen the device. For that, an explicit reopen method could be added.
>>> The method could even chat with the privileged process to get that to
>>> do the reopening, but I'd leave that to libvirt and fail without it
>>> for plain QEMU.
>>
>> There are more cases where we reopen the image file. One example is the
>> 'commit' monitor command which temporarily reopens the backing file r/w.
>> Or Christoph's patch that allows guests to toggle the write-cache
>> enabled bit. Same for live snapshots. So we'll need a solution for them
>> before doing anything like this.
>>
>> And breaking qemu without libvirt isn't really an option for me.
>
> Reopening files is evil. Sometimes flaws in the system call API make it
> the only option. You can mitigate via /dev/fd/%d, but only on some
> systems. The less we reopen, the better.
>
> An fd: protocol can't easily support reopen. So fail it. This doesn't
> break any existing usage. It's just a restriction on the new protocol.
> Restrictions can render the new protocol useless in practice, but we're
> not "breaking qemu without libvirt" there.
>
> Perhaps we can make relax the restriction on some system by avoiding the
> reopen in a system-dependent way.
A lot of great points here. Thanks everyone.
I'd like to see if we can go forward with the suggestion of restricting
the fd: protocol, at least for the initial patch. Perhaps this first
pass at the protocol can limit it to no reopen and no backing file
support. Even with this limited support, the fd: protocol can still
provide added security for NFS users.
Corey
next prev parent reply other threads:[~2011-05-23 18:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-20 18:48 [Qemu-devel] [PATCH] Add support for fd: protocol Corey Bryant
2011-05-20 19:05 ` Anthony Liguori
2011-05-20 19:25 ` Blue Swirl
2011-05-20 19:42 ` Anthony Liguori
2011-05-20 19:53 ` Blue Swirl
2011-05-23 14:28 ` Kevin Wolf
2011-05-23 15:24 ` Markus Armbruster
2011-05-23 15:56 ` Kevin Wolf
2011-05-23 19:50 ` Blue Swirl
2011-05-23 21:55 ` Anthony Liguori
2011-05-23 18:20 ` Corey Bryant [this message]
2011-05-23 9:45 ` Daniel P. Berrange
2011-05-23 10:19 ` Stefan Hajnoczi
2011-05-23 10:30 ` Daniel P. Berrange
2011-05-23 12:59 ` Anthony Liguori
2011-05-23 14:35 ` Markus Armbruster
2011-05-23 22:49 ` Jamie Lokier
2011-05-24 8:39 ` Stefan Hajnoczi
2011-05-24 15:31 ` Jamie Lokier
2011-05-23 12:50 ` Anthony Liguori
2011-05-23 13:06 ` Daniel P. Berrange
2011-05-23 13:09 ` Stefan Hajnoczi
2011-05-23 13:21 ` Anthony Liguori
2011-05-23 13:26 ` Stefan Hajnoczi
2011-05-23 13:42 ` Daniel P. Berrange
2011-05-23 9:48 ` Daniel P. Berrange
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=4DDAA55E.5000701@us.ibm.com \
--to=bryntcor@us.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tchicks@us.ibm.com \
/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).