All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Mark McLoughlin <markmc@redhat.com>,
	Arnd Bergmann <arndbergmann@googlemail.com>,
	Michael Tsirkin <mst@redhat.com>,
	Dustin Kirkland <kirkland@canonical.com>,
	qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [Qemu-devel] [PATCH 4/4] Add support for -net bridge
Date: Tue, 10 Nov 2009 14:23:05 +0200	[thread overview]
Message-ID: <4AF95B29.5060103@redhat.com> (raw)
In-Reply-To: <4AF82524.8080805@us.ibm.com>

On 11/09/2009 04:20 PM, Anthony Liguori wrote:
> Avi Kivity wrote:
>> On 11/08/2009 12:11 AM, Anthony Liguori wrote:
>>>
>>>>  You don't need root privileges to use a tap device.
>>>
>>> You can access a preconfigured tap device but you cannot allocate a 
>>> tap device and connect it to a bridge without CAP_NET_ADMIN.
>>
>> btw, shouldn't we, in the general case, create a bridge per user and 
>> use IP NAT?  If we have a global bridge, users can spoof each other's 
>> MAC addresses and interfere with their virtual machines.
>
> qemu-bridge-helper supports that model quite well :-)  You would 
> create a NAT'd bridge for each user as the administrator, then create 
> a bridge.conf that consisted of per-user includes with appropriate 
> permissions set on each of those files.

Except that the out-of-the-box experience is "go and configure things" 
again.

Really, bridging is fairly complex.  You have to set up the bridge, 
perhaps with NAT, perhaps to the physical device (possibly fighting a 
bit with NetworkManager in that case), allocate MAC addresses in a 
nonconflicting way, set up DHCP, and if you are multiuser, protect users 
from each other, and protect the host from guests.

>
>>   They can also interfere with the real network.
>>
>> That's not a concern with most one-user-per-machine configurations, 
>> but the default configuration should be safe.
>
> Let's not kid ourselves, no matter what we do we're giving a user 
> elevated privileges.  Even with NAT, if the host can access the NAT'ed 
> network, then you can run a privileged service (like NFS) in that 
> network.  Like it or not, some networks rely on privileged services 
> being trusted as part of their security model (consider NIS).

At least on commercial Linux vendor exports NFS home directories with 
the 'secure' option, requiring a privileged port to mount NFS shares.  
If your patch falls into the wrong hands, virtualization developers 
working at such a vendor might be able to access their home directories 
from guests, which would annoy IT immensely.

> I think the best we can do is provide a tool that allows an 
> administrator to grant users additional privileges in the tiniest 
> increments possible.  Putting people in wheel just so they can do 
> virtualization is too much.

I'm concerned that we're confusing the situation instead of clearing 
it.  Telling users to "edit /etc/foo/bar" so you can run bridging 
without fully explaining the impact is not responsible.  Trusting 
libvirt to do it end-to-end is fine, but in this case it can also set up 
the tap itself.

>
> I don't see having an fscap-based helper as creating policy.  I see it 
> as adding a mechanism for administrators to create policy.
>

I'll summarize my current issues with the patchset:

- by introducing an suid/fscap helper we're expanding the scope of 
security in qemu.  In addition to protecting qemu against malicious 
guests trying to gain local user privileges, we need to protect it 
against malicious local users trying to gain root (or CAP_NET_ADMIN) 
privileges

- we're introducing yet another authorization mechanism.  We have 
enough.  We already have feedback that policykit is wanted in at least 
some cases.  Given that authorization is best kept consistent in a 
distro, and that distros try to be as inconsistent from each other as 
possible, we can't please everyone.

- for the command-line user, we aren't providing a full solution; they 
still have a lot of configuration to do before things work (especially 
if they don't already have a network segment with DHCP)

- for libvirt and other management systems, it is insufficient since 
they will at least in some cases need to perform privileged 
configuration before handing the tap to the guest.  So they still need 
to be privileged and they can't use -net bridge for hotplug.

I would be happier if we drop suid/fscap from the helper.  We can have a 
user-provided script or binary gain the necessary privileges (using sudo 
or policykit or whatever).  This way we don't need to deal with local 
privilege escalation vulnerabilities.

-- 
error compiling committee.c: too many arguments to function

  parent reply	other threads:[~2009-11-10 12:23 UTC|newest]

Thread overview: 125+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 1/4] Add basic version of bridge helper Anthony Liguori
2009-11-04  0:28 ` [Qemu-devel] [PATCH 2/4] Add access control support to qemu-bridge-helper Anthony Liguori
2009-11-04 13:38   ` [Qemu-devel] [PATCH 2/4] Add access control support toqemu-bridge-helper Krumme, Chris
2009-11-04 14:23     ` Anthony Liguori
2009-11-04 14:37       ` Krumme, Chris
2009-11-05 15:06   ` [Qemu-devel] [PATCH 2/4] Add access control support to qemu-bridge-helper Daniel P. Berrange
2009-11-04  0:28 ` [Qemu-devel] [PATCH 3/4] Add cap reduction support to enable use as SUID binary Anthony Liguori
2009-11-04  0:28 ` [Qemu-devel] [PATCH 4/4] Add support for -net bridge Anthony Liguori
2009-11-04 13:49   ` Krumme, Chris
2009-11-04 14:23     ` Anthony Liguori
2009-11-05 14:41   ` Avi Kivity
2009-11-05 14:45     ` Anthony Liguori
2009-11-05 14:49       ` Avi Kivity
2009-11-06  2:29       ` Jamie Lokier
2009-11-07 17:29   ` David Woodhouse
2009-11-07 22:11     ` Anthony Liguori
2009-11-08  8:27       ` Avi Kivity
2009-11-08  8:43         ` Arnd Bergmann
2009-11-08  8:55           ` Avi Kivity
2009-11-09 14:20         ` Anthony Liguori
2009-11-09 15:39           ` Jamie Lokier
2009-11-09 15:43             ` Anthony Liguori
2009-11-09 19:19               ` Jamie Lokier
2009-11-10 12:23           ` Avi Kivity [this message]
2009-11-04 12:02 ` [Qemu-devel] [PATCH 0/4] net-bridge: rootless bridge support for qemu Alexander Graf
2009-11-04 14:42   ` Anthony Liguori
2009-11-04 15:02     ` Alexander Graf
2009-11-04 16:02       ` Anthony Liguori
2009-11-04 17:04 ` [Qemu-devel] " Michael S. Tsirkin
2009-11-04 19:48   ` Anthony Liguori
2009-11-04 20:04     ` Michael S. Tsirkin
2009-11-04 20:44       ` Anthony Liguori
2009-11-05  8:17         ` Michael S. Tsirkin
2009-11-05 13:05           ` Anthony Liguori
2009-11-04 22:40 ` Dustin Kirkland
2009-11-05  0:52   ` Anthony Liguori
2009-11-05  2:12     ` Dustin Kirkland
2009-11-05  4:12 ` [Qemu-devel] " Jamie Lokier
2009-11-05  8:21   ` Michael S. Tsirkin
2009-11-06  2:03     ` Jamie Lokier
2009-11-06 11:58       ` Arnd Bergmann
2009-11-06 20:26         ` Jamie Lokier
2009-11-08 11:55           ` Michael S. Tsirkin
2009-11-05 13:11   ` Anthony Liguori
2009-11-05 14:33 ` Avi Kivity
2009-11-05 14:36   ` Avi Kivity
2009-11-05 14:46     ` Daniel P. Berrange
2009-11-05 14:53       ` Anthony Liguori
2009-11-05 16:41         ` Jamie Lokier
2009-11-05 16:51           ` Daniel P. Berrange
2009-11-06  1:53             ` Jamie Lokier
2009-11-05 14:50     ` Anthony Liguori
2009-11-05 15:05       ` Avi Kivity
2009-11-05 15:50         ` Anthony Liguori
2009-11-05 16:02           ` Avi Kivity
2009-11-05 16:19             ` Anthony Liguori
2009-11-05 16:28               ` Avi Kivity
2009-11-05 16:37               ` Jamie Lokier
2009-11-05 16:45                 ` Anthony Liguori
2009-11-05 17:20                   ` Arnd Bergmann
2009-11-05 17:42                     ` Anthony Liguori
2009-11-05 18:02                       ` Arnd Bergmann
2009-11-05 19:54                         ` Anthony Liguori
2009-11-05 18:14                       ` Avi Kivity
2009-11-05 18:11                     ` Avi Kivity
2009-11-05 19:58                       ` Anthony Liguori
2009-11-06  1:48                         ` Jamie Lokier
2009-11-06  7:22                         ` Avi Kivity
2009-11-06 10:54                           ` Jamie Lokier
2009-11-06 12:42                             ` Anthony Liguori
2009-11-07  3:44                               ` Jamie Lokier
2009-11-06 14:19                           ` Anthony Liguori
2009-11-07  9:14                             ` Avi Kivity
2009-11-07  9:43                               ` Avi Kivity
2009-11-07 14:07                                 ` Anthony Liguori
2009-11-07 21:50                                   ` Arnd Bergmann
2009-11-07 22:12                                     ` Anthony Liguori
2009-11-08  8:11                                       ` Avi Kivity
2009-11-07 14:04                               ` Anthony Liguori
2009-11-06  0:29                       ` Anthony Liguori
2009-11-06  7:26                         ` Avi Kivity
2009-11-06 16:09                           ` Anthony Liguori
2009-11-07  9:27                             ` Avi Kivity
2009-11-07 10:44                               ` Jamie Lokier
2009-11-07 11:23                                 ` Avi Kivity
2009-11-09 19:35                                   ` Jamie Lokier
2009-11-10 12:25                                     ` Avi Kivity
2009-11-10 13:33                                       ` Jamie Lokier
2009-11-07 13:59                               ` Anthony Liguori
2009-11-05 16:29         ` Jamie Lokier
2009-11-05 14:57   ` Anthony Liguori
2009-11-05 15:11     ` Avi Kivity
2009-11-05 15:33       ` Avi Kivity
2009-11-05 15:58         ` Anthony Liguori
2009-11-05 16:07           ` Avi Kivity
2009-11-06  2:19             ` Jamie Lokier
2009-11-05 16:06       ` Anthony Liguori
2009-11-05 16:15         ` Avi Kivity
2009-11-05 16:25           ` Anthony Liguori
2009-11-05 16:33             ` Avi Kivity
2009-11-05 16:50               ` Anthony Liguori
2009-11-05 17:16                 ` Scott Tsai
2009-11-05 18:19                   ` Avi Kivity
2009-11-06  2:16                     ` Jamie Lokier
2009-11-05 18:19                 ` Avi Kivity
2009-11-06  2:17                   ` Jamie Lokier
2009-11-05 15:11     ` Daniel P. Berrange
2009-11-05 15:14       ` Avi Kivity
2009-11-05 15:20         ` Daniel P. Berrange
2009-11-05 15:59         ` Anthony Liguori
2009-11-05 16:20           ` Avi Kivity
2009-11-05 16:28             ` Anthony Liguori
2009-11-05 16:35               ` Avi Kivity
2009-11-05 16:53                 ` Daniel P. Berrange
2009-11-05 17:03                   ` Anthony Liguori
2009-11-05 17:16                     ` Daniel P. Berrange
2009-11-06  2:08                       ` Jamie Lokier
2009-11-05 17:26                     ` Arnd Bergmann
2009-11-05 19:54                       ` Gerhard Stenzel
2009-11-06  2:11             ` Jamie Lokier
2009-11-05 15:00 ` [Qemu-devel] " Mark McLoughlin
2009-11-05 15:14   ` Daniel P. Berrange
2009-11-05 15:28     ` Dustin Kirkland
2009-11-05 15:06 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF95B29.5060103@redhat.com \
    --to=avi@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=arndbergmann@googlemail.com \
    --cc=dwmw2@infradead.org \
    --cc=kirkland@canonical.com \
    --cc=markmc@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.