]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: vgic: Avoid injecting reserved IRQ numbers
authorMarc Zyngier <marc.zyngier@arm.com>
Wed, 17 Jun 2015 13:43:35 +0000 (14:43 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 17 Jun 2015 14:18:59 +0000 (15:18 +0100)
commit0f69d18213eef49111af2406f75c1600b4777802
tree5278f3b4580f010ed2ca9692cefd25d1ab591123
parente49349dc24576e3f5ee13945f2072a025801d371
KVM: arm/arm64: vgic: Avoid injecting reserved IRQ numbers

Commit 08a98d1c2457 (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>
Cc: <stable@vger.kernel.org> # 4.1, 4.0, 3.19, 3.18
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
virt/kvm/arm/vgic.c