* [PATCH] kvm: remove CAP_SYS_RAWIO requirement from kvm_vm_ioctl_assign_irq
@ 2010-05-12 13:46 Alex Williamson
2010-05-13 22:06 ` Chris Wright
2010-05-13 22:54 ` Marcelo Tosatti
0 siblings, 2 replies; 4+ messages in thread
From: Alex Williamson @ 2010-05-12 13:46 UTC (permalink / raw)
To: kvm; +Cc: linux-kernel, chrisw, alex.williamson
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.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
virt/kvm/assigned-dev.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c
index 4d10b1e..64672e2 100644
--- a/virt/kvm/assigned-dev.c
+++ b/virt/kvm/assigned-dev.c
@@ -448,9 +448,6 @@ static int kvm_vm_ioctl_assign_irq(struct kvm *kvm,
struct kvm_assigned_dev_kernel *match;
unsigned long host_irq_type, guest_irq_type;
- if (!capable(CAP_SYS_RAWIO))
- return -EPERM;
-
if (!irqchip_in_kernel(kvm))
return r;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm: remove CAP_SYS_RAWIO requirement from kvm_vm_ioctl_assign_irq
2010-05-12 13:46 [PATCH] kvm: remove CAP_SYS_RAWIO requirement from kvm_vm_ioctl_assign_irq Alex Williamson
@ 2010-05-13 22:06 ` Chris Wright
2010-05-13 22:22 ` Alex Williamson
2010-05-13 22:54 ` Marcelo Tosatti
1 sibling, 1 reply; 4+ messages in thread
From: Chris Wright @ 2010-05-13 22:06 UTC (permalink / raw)
To: Alex Williamson; +Cc: kvm, linux-kernel, chrisw
* Alex Williamson (alex.williamson@redhat.com) 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().
thanks,
-chris
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm: remove CAP_SYS_RAWIO requirement from kvm_vm_ioctl_assign_irq
2010-05-13 22:06 ` Chris Wright
@ 2010-05-13 22:22 ` Alex Williamson
0 siblings, 0 replies; 4+ messages in thread
From: Alex Williamson @ 2010-05-13 22:22 UTC (permalink / raw)
To: Chris Wright; +Cc: kvm, linux-kernel
On Thu, 2010-05-13 at 15:06 -0700, Chris Wright wrote:
> * Alex Williamson (alex.williamson@redhat.com) 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm: remove CAP_SYS_RAWIO requirement from kvm_vm_ioctl_assign_irq
2010-05-12 13:46 [PATCH] kvm: remove CAP_SYS_RAWIO requirement from kvm_vm_ioctl_assign_irq Alex Williamson
2010-05-13 22:06 ` Chris Wright
@ 2010-05-13 22:54 ` Marcelo Tosatti
1 sibling, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2010-05-13 22:54 UTC (permalink / raw)
To: Alex Williamson; +Cc: kvm, linux-kernel, chrisw
On Wed, May 12, 2010 at 09:46:31AM -0400, Alex Williamson 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.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-13 22:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12 13:46 [PATCH] kvm: remove CAP_SYS_RAWIO requirement from kvm_vm_ioctl_assign_irq Alex Williamson
2010-05-13 22:06 ` Chris Wright
2010-05-13 22:22 ` Alex Williamson
2010-05-13 22:54 ` Marcelo Tosatti
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).