lkml.org 
[lkml]   [2012]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/6] kvm: Sanitize KVM_IRQFD flags
On Tue, Jun 26, 2012 at 11:09:32PM -0600, Alex Williamson wrote:
> We only know of one so far.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

Ugh. So we have a bug: we should have sanitized the fields.
If there's buggy userspace that only set the low bit
it will break with this change.
Is it too late now? Do we need KVM_IRQFD2 which
sanitized fields properly? Avi?

> ---
>
> virt/kvm/eventfd.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index c307c24..7d7e2aa 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -340,6 +340,9 @@ kvm_irqfd_deassign(struct kvm *kvm, struct kvm_irqfd *args)
> int
> kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
> {
> + if (args->flags & ~KVM_IRQFD_FLAG_DEASSIGN)
> + return -EINVAL;
> +
> if (args->flags & KVM_IRQFD_FLAG_DEASSIGN)
> return kvm_irqfd_deassign(kvm, args);
>


\
 
 \ /
  Last update: 2012-06-27 12:01    [W:0.217 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site