[PATCH 04/12] irqchip/gic-v5: validate MADT IRS records

From: Jiale Yao

Date: Wed Oct 28 2026 - 01:01:57 EST


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@xxxxxxxxxxxxxxx
Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
---
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