qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/5] file descriptor passing using pass-fd
@ 2012-06-14 15:55 Corey Bryant
  2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 1/5] qapi: Convert getfd and closefd Corey Bryant
                   ` (5 more replies)
  0 siblings, 6 replies; 36+ messages in thread
From: Corey Bryant @ 2012-06-14 15:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, aliguori, stefanha, libvir-list, lcapitulino, pbonzini,
	eblake

libvirt's sVirt security driver provides SELinux MAC isolation for
Qemu guest processes and their corresponding image files.  In other
words, sVirt uses SELinux to prevent a QEMU process from opening
files that do not belong to it.

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, and therefore cannot support sVirt
isolation.

A solution to this problem is to provide fd passing support, where
libvirt opens files and passes file descriptors to QEMU.  This,
along with SELinux policy to prevent QEMU from opening files, can
provide image file isolation for NFS files stored on the same NFS
mount.

This patch series adds the pass-fd QMP monitor command, which allows
an fd to be passed via SCM_RIGHTS, and returns the received file
descriptor.  Support is also added to the block layer to allow QEMU
to dup the fd when the filename is of the /dev/fd/X format.  This
is useful if MAC policy prevents QEMU from opening specific types
of files.

One nice thing about this approach is that no new SELinux policy is
required to prevent open of NFS files (files with type nfs_t).  The
virt_use_nfs boolean type simply needs to be set to false, and open
will be prevented (and dup will be allowed).  For example:

    # setsebool virt_use_nfs 0
    # getsebool virt_use_nfs
    virt_use_nfs --> off

Corey Bryant (5):
  qapi: Convert getfd and closefd
  qapi: Add pass-fd QMP command
  osdep: Enable qemu_open to dup pre-opened fd
  block: Convert open calls to qemu_open
  block: Prevent /dev/fd/X filename from being detected as floppy

 block/raw-posix.c |   22 ++++++++++---------
 block/raw-win32.c |    4 ++--
 block/vdi.c       |    5 +++--
 block/vmdk.c      |   21 ++++++++----------
 block/vpc.c       |    2 +-
 block/vvfat.c     |   21 +++++++++---------
 hmp-commands.hx   |    6 ++----
 hmp.c             |   18 ++++++++++++++++
 hmp.h             |    2 ++
 monitor.c         |   61 +++++++++++++++++++++++++++++++++++++++--------------
 osdep.c           |   13 ++++++++++++
 qapi-schema.json  |   54 +++++++++++++++++++++++++++++++++++++++++++++++
 qmp-commands.hx   |   48 +++++++++++++++++++++++++++++++++++++----
 13 files changed, 216 insertions(+), 61 deletions(-)

-- 
1.7.10.2

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2012-06-20 16:32 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 15:55 [Qemu-devel] [PATCH v3 0/5] file descriptor passing using pass-fd Corey Bryant
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 1/5] qapi: Convert getfd and closefd Corey Bryant
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 2/5] qapi: Add pass-fd QMP command Corey Bryant
2012-06-15 14:32   ` Luiz Capitulino
2012-06-15 15:04     ` Corey Bryant
2012-06-15 15:14       ` Luiz Capitulino
2012-06-15 15:29         ` Corey Bryant
2012-06-15 16:26           ` Luiz Capitulino
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 3/5] osdep: Enable qemu_open to dup pre-opened fd Corey Bryant
2012-06-15 15:16   ` Eric Blake
2012-06-15 18:16     ` Corey Bryant
2012-06-15 18:42       ` Eric Blake
2012-06-15 19:02         ` Corey Bryant
2012-06-15 18:46       ` Kevin Wolf
2012-06-15 19:19         ` Corey Bryant
2012-06-15 20:00           ` Eric Blake
2012-06-15 20:49             ` Corey Bryant
2012-06-18  8:10             ` Kevin Wolf
2012-06-19 13:59               ` Corey Bryant
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 4/5] block: Convert open calls to qemu_open Corey Bryant
2012-06-15 14:36   ` Luiz Capitulino
2012-06-15 15:10     ` Corey Bryant
2012-06-15 15:21   ` Eric Blake
2012-06-15 18:32     ` Corey Bryant
2012-06-14 15:55 ` [Qemu-devel] [PATCH v3 5/5] block: Prevent /dev/fd/X filename from being detected as floppy Corey Bryant
2012-06-15 14:38   ` Luiz Capitulino
2012-06-15 15:12     ` Corey Bryant
2012-06-19 15:46 ` [Qemu-devel] [PATCH v3 0/5] file descriptor passing using pass-fd Eric Blake
2012-06-19 15:57   ` Kevin Wolf
2012-06-19 16:14     ` Eric Blake
2012-06-20  7:25       ` Kevin Wolf
2012-06-20  8:31         ` Daniel P. Berrange
2012-06-20 11:24           ` Eric Blake
2012-06-20 13:31             ` Corey Bryant
2012-06-20 14:53               ` Eric Blake
2012-06-20 16:24                 ` Corey Bryant

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).