* Patch "KVM: arm/arm64: vgic: Avoid injecting reserved IRQ numbers" has been added to the 4.1-stable tree
@ 2015-07-08 7:24 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-07-08 7:24 UTC (permalink / raw)
To: marc.zyngier, andre.przywara, gregkh, peter.maydell
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
KVM: arm/arm64: vgic: Avoid injecting reserved IRQ numbers
to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
kvm-arm-arm64-vgic-avoid-injecting-reserved-irq-numbers.patch
and it can be found in the queue-4.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 4839ddc27b7212ec58874f62c97da7400c8523be Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
Date: Wed, 17 Jun 2015 14:43:35 +0100
Subject: KVM: arm/arm64: vgic: Avoid injecting reserved IRQ numbers
From: Marc Zyngier <marc.zyngier@arm.com>
commit 4839ddc27b7212ec58874f62c97da7400c8523be upstream.
Commit fd1d0ddf2ae9 (KVM: arm/arm64: check IRQ number on userland
injection) rightly limited the range of interrupts userspace can
inject in a guest, but failed to consider the (unlikely) case where
a guest is configured with 1024 interrupts.
In this case, interrupts ranging from 1020 to 1023 are unuseable,
as they have a special meaning for the GIC CPU interface.
Make sure that these number cannot be used as an IRQ. Also delete
a redundant (and similarily buggy) check in kvm_set_irq.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
virt/kvm/arm/vgic.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -1561,7 +1561,7 @@ int kvm_vgic_inject_irq(struct kvm *kvm,
goto out;
}
- if (irq_num >= kvm->arch.vgic.nr_irqs)
+ if (irq_num >= min(kvm->arch.vgic.nr_irqs, 1020))
return -EINVAL;
vcpu_id = vgic_update_irq_pending(kvm, cpuid, irq_num, level);
@@ -2161,10 +2161,7 @@ int kvm_set_irq(struct kvm *kvm, int irq
BUG_ON(!vgic_initialized(kvm));
- if (spi > kvm->arch.vgic.nr_irqs)
- return -EINVAL;
return kvm_vgic_inject_irq(kvm, 0, spi, level);
-
}
/* MSI not implemented yet */
Patches currently in stable-queue which might be from marc.zyngier@arm.com are
queue-4.1/kvm-arm-arm64-vgic-avoid-injecting-reserved-irq-numbers.patch
queue-4.1/arm-kvm-psci-fix-handling-of-unimplemented-functions.patch
queue-4.1/arm-kvm-force-execution-of-hcptr-access-on-vm-exit.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-08 7:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 7:24 Patch "KVM: arm/arm64: vgic: Avoid injecting reserved IRQ numbers" has been added to the 4.1-stable tree gregkh
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.