Re: [PATCH] kvm: remove CAP_SYS_RAWIO requirement fromkvm_vm_ioctl_assign_irq

From: Alex Williamson
Date: Thu May 13 2010 - 19:14:31 EST


On Thu, 2010-05-13 at 15:06 -0700, Chris Wright wrote:
> * Alex Williamson (alex.williamson@xxxxxxxxxx) wrote:
> > Remove this check in an effort to allow kvm guests to run without
> > root privileges. This capability check doesn't seem to add any
> > security since the device needs to have already been added via the
> > assign device ioctl and the io actually occurs through the pci
> > sysfs interface.
>
> Right, so irq resource allocation can't be directly abused (by calling
> this ioctl out of order, for example) because the device must be assigned
> first via kvm_vm_ioctl_assign_device(). My only concern isn't with this
> patch per-se, but the exising kvm_vm_ioctl_assign_device().

Yep, I agree. How do we decide the caller of the assign device ioctl
has sufficient rights to the device without introducing another
capabilities check? We won't get far if the resources are already
claimed by a running driver, but we don't necessarily want anyone
with /dev/kvm rights to be able to grab the remaining devices in the
system.

Alex

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/