[PATCH 01/12] riscv: acpi: validate RINTC entries before use
From: Jiale Yao
Date: Wed Oct 28 2026 - 01:06:41 EST
The RINTC callback reads flags and other fields from a typed MADT record
without checking that the complete record is present. A truncated
firmware entry can therefore cause out-of-bounds reads during CPU map
initialization.
Reject incomplete RINTC entries before accessing typed fields.
Fixes: f99561199470 ("RISC-V: ACPI: Cache and retrieve the RINTC structure")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
---
arch/riscv/kernel/acpi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
index efd52a5d05b5..9e0658c6a869 100644
--- a/arch/riscv/kernel/acpi.c
+++ b/arch/riscv/kernel/acpi.c
@@ -171,6 +171,9 @@ static int acpi_parse_madt_rintc(union acpi_subtable_headers *header, const unsi
struct acpi_madt_rintc *rintc = (struct acpi_madt_rintc *)header;
int cpuid;
+ if (BAD_MADT_ENTRY(rintc, end))
+ return -EINVAL;
+
if (!(rintc->flags & ACPI_MADT_ENABLED))
return 0;
--
2.34.1