• Marc Zyngier's avatar
    KVM: arm/arm64: vgic: Avoid injecting reserved IRQ numbers · 4839ddc2
    Marc Zyngier authored
    Commit fd1d0ddf (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: default avatarPeter 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: default avatarMarc Zyngier <marc.zyngier@arm.com>
    4839ddc2
vgic.c 54.9 KB