[PATCH 02/12] irqchip/gic-v5-irs: validate MADT GICC entries
Jiale Yao
yaojiale02 at 163.com
Tue Oct 27 22:00:29 PDT 2026
The IAFFID parser reads fields from a typed GICC record without checking
that the MADT entry contains the fields it accesses. Reject truncated
entries before reading them.
Fixes: 35866efa52fe ("irqchip/gic-v5: Add ACPI IRS probing")
Cc: stable at vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02 at 163.com>
---
drivers/irqchip/irq-gic-v5-irs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c
index 9d60f474aa4f..4e60a1caaba5 100644
--- a/drivers/irqchip/irq-gic-v5-irs.c
+++ b/drivers/irqchip/irq-gic-v5-irs.c
@@ -891,6 +891,9 @@ static int __init gic_acpi_parse_iaffid(union acpi_subtable_headers *header,
struct acpi_madt_generic_interrupt *gicc = (struct acpi_madt_generic_interrupt *)header;
int cpu;
+ if (BAD_MADT_GICC_ENTRY(gicc, end))
+ return -EINVAL;
+
if (!(gicc->flags & (ACPI_MADT_ENABLED | ACPI_MADT_GICC_ONLINE_CAPABLE)))
return 0;
--
2.34.1
More information about the linux-arm-kernel
mailing list