From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKwlH-0005yK-SB for qemu-devel@nongnu.org; Mon, 31 Oct 2011 14:39:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKwlG-0004DS-Sd for qemu-devel@nongnu.org; Mon, 31 Oct 2011 14:39:07 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:33775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKwlG-0004DO-IG for qemu-devel@nongnu.org; Mon, 31 Oct 2011 14:39:06 -0400 Received: from /spool/local by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 31 Oct 2011 12:37:23 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9VIaX3t114810 for ; Mon, 31 Oct 2011 12:36:36 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9VIaWh6002777 for ; Mon, 31 Oct 2011 12:36:32 -0600 From: Corey Bryant Date: Mon, 31 Oct 2011 14:36:27 -0400 Message-Id: <1320086191-23641-1-git-send-email-coreyb@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v3 0/4] -net bridge: rootless bridge support for qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, rmarwah@linux.vnet.ibm.com With qemu it is possible to run a guest from an 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 backend and a new network option for -net tap. This is less flexible when compared to existing -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 these cases attaching the tap device to the default br0 bridge): qemu -hda linux.img -net bridge -net nic or: qemu -hda linux.img -net tap,helper=/usr/local/libexec/qemu-bridge-helper -net nic 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. v2: - Updated signed-off-by's - Updated author's email - Set default bridge to br0 - Added -net bridge - Updated ACL example - Moved from libcap to libcap-ng - Fail helper when libcap-ng not configured v3: - Use simple queue to store ACLs - Added goto cleanup to helper's main - Allow helper execution if libcap-ng not configured - Completed static analysis and memory analysis on helper Corey Bryant (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 net bridge Makefile | 12 ++- configure | 37 +++++ net.c | 29 ++++- net.h | 3 + net/tap.c | 190 +++++++++++++++++++++++- net/tap.h | 3 + qemu-bridge-helper.c | 406 ++++++++++++++++++++++++++++++++++++++++++++++++++ qemu-options.hx | 73 ++++++++-- 8 files changed, 730 insertions(+), 23 deletions(-) create mode 100644 qemu-bridge-helper.c -- 1.7.3.4