[PATCH 04/12] irqchip/gic-v5: validate MADT IRS records
Jiale Yao
yaojiale02 at 163.com
Tue Oct 27 22:00:31 PDT 2026
The ACPI probe validator reads the version from a typed IRS record
without first establishing its minimum size. The accepted record is
later used by the initialization callback for further typed field
accesses.
Reject incomplete IRS records in the validator before either callback
can use 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.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-gic-v5.c
index 8c0303af71e7..8451b780b0ea 100644
--- a/drivers/irqchip/irq-gic-v5.c
+++ b/drivers/irqchip/irq-gic-v5.c
@@ -1309,6 +1309,9 @@ static bool __init acpi_validate_gic_table(struct acpi_subtable_header *header,
{
struct acpi_madt_gicv5_irs *irs = (struct acpi_madt_gicv5_irs *)header;
+ if (BAD_MADT_ENTRY(irs, (unsigned long)header + header->length))
+ return false;
+
return (irs->version == ape->driver_data);
}
--
2.34.1
More information about the linux-arm-kernel
mailing list