From: Alex Williamson Date: Fri, 29 Jun 2012 15:56:24 +0000 (-0600) Subject: KVM: Sanitize KVM_IRQFD flags X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=326cf0334bacfdf43039cf75997a022b9e51535d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git KVM: Sanitize KVM_IRQFD flags We only know of one so far. Signed-off-by: Alex Williamson Signed-off-by: Marcelo Tosatti --- diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index c307c24c147a..7d7e2aaffece 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);