[PATCH 08/12] irqchip/loongson-htvec: validate MADT BIO-PIC entries
From: Jiale Yao
Date: Wed Oct 28 2026 - 01:02:24 EST
The HT-vector cascade callback passes a typed BIO-PIC record to
initialization code without checking that the complete structure is
present. Reject truncated entries before dispatching them.
Fixes: 70f7b6c008b3 ("irqchip/loongson-htvec: Add ACPI init support")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
---
drivers/irqchip/irq-loongson-htvec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/irqchip/irq-loongson-htvec.c b/drivers/irqchip/irq-loongson-htvec.c
index 75e40ba6069d..725f30b7574b 100644
--- a/drivers/irqchip/irq-loongson-htvec.c
+++ b/drivers/irqchip/irq-loongson-htvec.c
@@ -269,6 +269,9 @@ static int __init pch_pic_parse_madt(union acpi_subtable_headers *header,
{
struct acpi_madt_bio_pic *pchpic_entry = (struct acpi_madt_bio_pic *)header;
+ if (BAD_MADT_ENTRY(pchpic_entry, end))
+ return -EINVAL;
+
return pch_pic_acpi_init(htvec_priv->htvec_domain, pchpic_entry);
}
--
2.34.1