Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HFqvd-0001Z1-Cx for qemu-devel@nongnu.org; Sat, 10 Feb 2007 07:02:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HFqvb-0001YD-MO for qemu-devel@nongnu.org; Sat, 10 Feb 2007 07:02:04 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFqvb-0001Y8-I9 for qemu-devel@nongnu.org; Sat, 10 Feb 2007 07:02:03 -0500 Received: from eastrmmtao04.cox.net ([68.230.240.35]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HFqva-0004qY-V0 for qemu-devel@nongnu.org; Sat, 10 Feb 2007 07:02:03 -0500 Message-ID: <24712216.1171108920762.JavaMail.root@eastrmwml08.mgt.cox.net> Date: Sat, 10 Feb 2007 7:02:00 -0500 From: Ben Taylor Subject: Re: CAP_NET_ADMIN (was Re: [Qemu-devel] Two quick requests.) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Reply-To: sol10x86@cox.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ---- "Kevin F. Quinn" wrote: > On Fri, 9 Feb 2007 22:48:51 +0000 > Paul Brook wrote: > > > I've very little sympathy (read: none) for people who "accidentally" > > break things by running them as root. > > On a related note, I've been running qemu(-system 0.8.2) as root > recently as a hopefully temporary measure so that it can setup the > network interfaces. Recent linux kernels require CAP_NET_ADMIN for the > tun network configuration that qemu does (specifically the TUNSETIFF > ioctl), and the only way to get the capability is to start the process > as root. > > Other capabilities could be dropped; as indeed could CAP_NET_ADMIN once > the network configuration is done, but that means modifications to qemu > itself to release the capabilities, and would still leave qemu as a > suid-root binary, which it would be nicer to avoid. > > Is there any way around this? I expected to be able to configure > capabilities for executables in the filesystem, but it appears there > are serious problems with that concept so the kernel doesn't support > it. I just dealt with that. I got a patch for tap for Solaris and I have a setuid script that creates the tap and uses the /etc/qemu-ifup script to configure the interface, then calls a script with the file descriptor of the tap interface to a script which then invokes qemu with the right parameteres. Ben