qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH V4 00/13] Proxy FS driver for VirtFS
@ 2011-12-05 16:18 M. Mohan Kumar
  2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 01/13] hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file M. Mohan Kumar
                   ` (13 more replies)
  0 siblings, 14 replies; 22+ messages in thread
From: M. Mohan Kumar @ 2011-12-05 16:18 UTC (permalink / raw)
  To: qemu-devel, aneesh.kumar, stefanha; +Cc: M. Mohan Kumar

From: "M. Mohan Kumar" <mohan@in.ibm.com>

Pass-through security model in QEMU 9p server needs root privilege to do
few file operations (like chown, chmod to any mode/uid:gid).  There are two
issues in pass-through security model

1) TOCTTOU vulnerability: Following symbolic links in the server could
provide access to files beyond 9p export path.

2) Running QEMU with root privilege could be a security issue.

To overcome above issues, following approach is used: A new filesytem
type 'proxy' is introduced. Proxy FS uses chroot + socket combination
for securing the vulnerability known with following symbolic links.
Intention of adding a new filesystem type is to allow qemu to run
in non-root mode, but doing privileged operations using socket IO.

Proxy helper(a stand alone binary part of qemu) is invoked with
root privileges. Proxy helper chroots into 9p export path and creates
a socket pair or a named socket based on the command line parameter.
Qemu and proxy helper communicate using this socket. QEMU proxy fs
driver sends filesystem request to proxy helper and receives the
response from it.

Proxy helper is designed so that it can drop the root privilege but
retaining capbilities that are needed for doing filesystem operations
(like CAP_DAC_OVERRIDE, CAP_FOWNER etc)

Changes from previous version V3:
* Improve error handling in marshaling/unmarshaling code
* Return ENOBUFS when request/response size exceeds maximum buffer size

Changes from previous version V2:
* Added check to handle failures in marshaling/unmarshaling code. Also make
  sure that request/response will not exceed maximum buffer size (BUFF_SZ)
* Addressed Stefan's review comments

Changes from previous version:
*) Communication between qemu and helper process is similar to 9p way of packing
elements (pdu marshaling).

M. Mohan Kumar (13):
  hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file
  hw/9pfs: Add validation to {un}marshal code
  hw/9pfs: Add new proxy filesystem driver
  hw/9pfs: File system helper process for qemu 9p proxy FS
  hw/9pfs: Open and create files
  hw/9pfs: Create other filesystem objects
  hw/9pfs: Add stat/readlink/statfs for proxy FS
  hw/9pfs: File ownership and others
  hw/9pfs: xattr interfaces in proxy filesystem driver
  hw/9pfs: Proxy getversion
  hw/9pfs: Documentation changes related to proxy fs
  hw/9pfs: man page for proxy helper
  hw/9pfs: Add support to use named socket for proxy FS

 Makefile                       |   15 +-
 Makefile.objs                  |    3 +-
 configure                      |   19 +
 fsdev/file-op-9p.h             |    2 +
 fsdev/qemu-fsdev.c             |    1 +
 fsdev/qemu-fsdev.h             |    1 +
 fsdev/virtfs-proxy-helper.c    | 1134 ++++++++++++++++++++++++++++++++++++
 fsdev/virtfs-proxy-helper.texi |   63 ++
 fsdev/virtio-9p-marshal.c      |  360 ++++++++++++
 fsdev/virtio-9p-marshal.h      |   90 +++
 hw/9pfs/virtio-9p-proxy.c      | 1230 ++++++++++++++++++++++++++++++++++++++++
 hw/9pfs/virtio-9p-proxy.h      |   95 +++
 hw/9pfs/virtio-9p.c            |  756 +++++++++++--------------
 hw/9pfs/virtio-9p.h            |   83 +---
 qemu-config.c                  |   13 +
 qemu-options.hx                |   32 +-
 vl.c                           |   10 +-
 17 files changed, 3406 insertions(+), 501 deletions(-)
 create mode 100644 fsdev/virtfs-proxy-helper.c
 create mode 100644 fsdev/virtfs-proxy-helper.texi
 create mode 100644 fsdev/virtio-9p-marshal.c
 create mode 100644 fsdev/virtio-9p-marshal.h
 create mode 100644 hw/9pfs/virtio-9p-proxy.c
 create mode 100644 hw/9pfs/virtio-9p-proxy.h

-- 
1.7.6

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

end of thread, other threads:[~2011-12-12 15:56 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-05 16:18 [Qemu-devel] [PATCH V4 00/13] Proxy FS driver for VirtFS M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 01/13] hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 02/13] hw/9pfs: Add validation to {un}marshal code M. Mohan Kumar
2011-12-08 18:10   ` Stefan Hajnoczi
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 03/13] hw/9pfs: Add new proxy filesystem driver M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 04/13] hw/9pfs: File system helper process for qemu 9p proxy FS M. Mohan Kumar
2011-12-08 18:31   ` Stefan Hajnoczi
2011-12-09 16:42     ` M. Mohan Kumar
2011-12-12 12:08       ` Stefan Hajnoczi
2011-12-12 15:21         ` Aneesh Kumar K.V
2011-12-12 15:56           ` Stefan Hajnoczi
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 05/13] hw/9pfs: Open and create files M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 06/13] hw/9pfs: Create other filesystem objects M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 07/13] hw/9pfs: Add stat/readlink/statfs for proxy FS M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 08/13] hw/9pfs: File ownership and others M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 09/13] hw/9pfs: xattr interfaces in proxy filesystem driver M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 10/13] hw/9pfs: Proxy getversion M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 11/13] hw/9pfs: Documentation changes related to proxy fs M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 12/13] hw/9pfs: man page for proxy helper M. Mohan Kumar
2011-12-05 16:18 ` [Qemu-devel] [PATCH V4 13/13] hw/9pfs: Add support to use named socket for proxy FS M. Mohan Kumar
2011-12-08 17:46 ` [Qemu-devel] [PATCH V4 00/13] Proxy FS driver for VirtFS Stefan Hajnoczi
2011-12-09 14:47   ` M. Mohan Kumar

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