qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] -net tap: rootless bridge support for qemu
@ 2011-10-06 15:38 Richa Marwaha
  2011-10-06 15:38 ` [Qemu-devel] [PATCH 1/4] Add basic version of bridge helper Richa Marwaha
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Richa Marwaha @ 2011-10-06 15:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, coreyb, Richa Marwaha

With qemu it possible to run guest with unprivileged user but if
we wanted to communicate with the outside world we had to switch
to root.

We address this problem by introducing a new network option.This
option is less flexible as compare to other -net tap options because
it relies on a helper with elevated privileges to do the heavy lifting
of allocating and attaching a tap device to a bridge.  We use a special
purpose helper because we don't want to elevate the privileges of more
generic tools like brctl.

Qemu can be run with the default network helper as follows (in
this case attaching the tap device to the default qemubr0 bridge):

     qemu -hda linux.img -net tap,helper=/usr/local/libexec/qemu-bridge-helper -net nic

We're not overly thrilled with having to spell out the helper file name,
however we didn't want to regress any current behavior of -net tap.
Additionally, we feel that this support makes sense in the -net tap backend.
Any suggestions to improve on this are more than welcome.

The default helper uses it's own ACL mechanism for access control,but
future network helpers could be developed, for example, to support PolicyKit
for access control.

More details are included in individual patches.The helper is broken into
a series of patches to improve reviewabilty.

Richa Marwaha (4):
  Add basic version of bridge helper
  Add access control support to qemu-bridge-helper
  Add cap reduction support to enable use as SUID
  Add support for bridge

 Makefile             |   12 ++-
 configure            |   37 +++++
 net.c                |    8 +
 net.h                |    2 +
 net/tap.c            |  150 ++++++++++++++++++-
 qemu-bridge-helper.c |  402 ++++++++++++++++++++++++++++++++++++++++++++++++++
 qemu-options.hx      |   48 +++++--
 7 files changed, 637 insertions(+), 22 deletions(-)
 create mode 100644 qemu-bridge-helper.c

^ permalink raw reply	[flat|nested] 25+ messages in thread
* [Qemu-devel] [PATCH 0/4] net-bridge: rootless bridge support for qemu
@ 2009-11-04  0:28 Anthony Liguori
  2009-11-04  0:28 ` [Qemu-devel] [PATCH 2/4] Add access control support to qemu-bridge-helper Anthony Liguori
  0 siblings, 1 reply; 25+ messages in thread
From: Anthony Liguori @ 2009-11-04  0:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Mark McLoughlin, Michael Tsirkin, Arnd Bergmann, Juan Quintela,
	Dustin Kirkland

This series solves a problem that I've been struggling with for a few years now.
One of the best things about qemu is that it's possible to run guests as an
unprivileged user to improve security.  However, if you want to have your guests
communicate with the outside world, you're pretty much forced to run qemu as
root.

At least with KVM support, this is probably the most common use case which means
that most of our users are running qemu as root.  That's terrible.

We address this problem by introducing a new network backend: -net bridge.  This
backend is less flexible than -net tap because it relies on a helper with
elevated privileges to do the heavy lifting of allocating and attaching a tap
device to a bridge.  We use a special purpose helper because we don't want
to elevate the privileges of more generic tools like brctl.

>From a user perspective, to use bridged networking with a guest, you simply use:

  qemu -hda linux.img -net bridge -net nic

And assuming a bridge is defined named qemubr0 and the administrator has setup
permissions accordingly, it will Just Work.  My hope is that distributions will
do this work as part of the qemu packaging process such that for most users,
the out-of-the-box experience will also Just Work.

More details are included in individual patches.  I broke up the helper into
a series of patches to improve reviewabilty.

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

end of thread, other threads:[~2011-10-07 14:54 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 15:38 [Qemu-devel] [PATCH 0/4] -net tap: rootless bridge support for qemu Richa Marwaha
2011-10-06 15:38 ` [Qemu-devel] [PATCH 1/4] Add basic version of bridge helper Richa Marwaha
2011-10-06 16:41   ` Daniel P. Berrange
2011-10-06 18:04     ` Anthony Liguori
2011-10-06 18:38       ` Corey Bryant
2011-10-07  9:04         ` Daniel P. Berrange
2011-10-07 14:40           ` Corey Bryant
2011-10-07 14:45             ` Daniel P. Berrange
2011-10-07 14:51               ` Corey Bryant
2011-10-07 14:52               ` Corey Bryant
2011-10-06 17:44   ` Anthony Liguori
2011-10-06 18:10     ` Corey Bryant
2011-10-06 15:38 ` [Qemu-devel] [PATCH 2/4] Add access control support to qemu-bridge-helper Richa Marwaha
2011-10-06 15:38 ` [Qemu-devel] [PATCH 3/4] Add cap reduction support to enable use as SUID Richa Marwaha
2011-10-06 16:34   ` Daniel P. Berrange
2011-10-06 17:42     ` Anthony Liguori
2011-10-06 18:05       ` Corey Bryant
2011-10-06 18:08       ` Corey Bryant
2011-10-06 15:38 ` [Qemu-devel] [PATCH 4/4] Add support for bridge Richa Marwaha
2011-10-06 17:49   ` Anthony Liguori
2011-10-06 18:15     ` Corey Bryant
2011-10-06 18:19       ` Anthony Liguori
2011-10-06 18:24         ` Corey Bryant
  -- strict thread matches above, loose matches on Subject: below --
2009-11-04  0:28 [Qemu-devel] [PATCH 0/4] net-bridge: rootless bridge support for qemu Anthony Liguori
2009-11-04  0:28 ` [Qemu-devel] [PATCH 2/4] Add access control support to qemu-bridge-helper Anthony Liguori
2009-11-05 15:06   ` Daniel P. Berrange

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