From: Marc Zyngier Do not blindly trust the vINTID field coming from KVM, and reject anything that is out of the boundaries that the hardware ITS is configured to support. These LPIs can still be injected as purely virtual interrupt. Fixes: d011e4e654d7f ("irqchip/gic-v3-its: Add VLPI map/unmap operations") Reported-by: Stefan Teodorescu Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier Signed-off-by: Damiano Melotti Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 282e4bafb084..0bb7a37f2b83 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1922,7 +1922,8 @@ static int its_vlpi_map(struct irq_data *d, struct its_cmd_info *info) struct its_device *its_dev = irq_data_get_irq_chip_data(d); u32 event = its_get_event_id(d); - if (!info->map) + if (!info->map || info->map->vintid < 8192 || + info->map->vintid >= BIT_ULL(LPI_NRBITS)) return -EINVAL; if (!its_dev->event_map.vm) { -- 2.56.1