From: Jiale Yao <yaojiale02@163.com>
To: Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Sunil V L <sunilvl@ventanamicro.com>,
Andrew Jones <andrew.jones@linux.dev>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH v2 09/20] riscv: acpi: validate RINTC entries before use
Date: Thu, 29 Oct 2026 11:52:40 +0800 [thread overview]
Message-ID: <20261029035253.2333852-10-yaojiale02@163.com> (raw)
In-Reply-To: <20261029035253.2333852-1-yaojiale02@163.com>
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@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
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
next prev parent reply other threads:[~2026-10-29 3:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 3:52 [PATCH v2 00/20] ACPI/irqchip: validate MADT " Jiale Yao
2026-10-29 3:52 ` [PATCH v2 01/20] ACPI: irqchip: validate MADT entry bounds before probing Jiale Yao
2026-11-03 14:44 ` Lorenzo Pieralisi
2026-11-03 16:56 ` Rafael J. Wysocki (Intel)
2026-10-29 3:52 ` [PATCH v2 02/20] irqchip/gic-v3-its: validate MADT ITS entries Jiale Yao
2026-10-29 3:52 ` [PATCH v2 03/20] irqchip/gic-v3: validate MADT records before use Jiale Yao
2026-10-29 3:52 ` [PATCH v2 04/20] irqchip/gic-v5-its: validate MADT translate frames Jiale Yao
2026-10-29 3:52 ` [PATCH v2 05/20] irqchip/loongarch-cpu: validate MADT LIO-PIC entries Jiale Yao
2026-10-29 3:52 ` [PATCH v2 06/20] irqchip/loongson-eiointc: validate MADT BIO-PIC entries Jiale Yao
2026-10-29 3:52 ` [PATCH v2 07/20] riscv: validate RINTC entries before use Jiale Yao
2026-10-29 3:52 ` [PATCH v2 08/20] ACPI: riscv: validate interrupt controller MADT entries Jiale Yao
2026-10-29 3:52 ` Jiale Yao [this message]
2026-10-29 3:52 ` [PATCH v2 10/20] irqchip/gic-v5-irs: validate MADT GICC entries Jiale Yao
2026-11-02 14:23 ` [PATCH v2 00/20] ACPI/irqchip: validate MADT entries before use Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261029035253.2333852-10-yaojiale02@163.com \
--to=yaojiale02@163.com \
--cc=alex@ghiti.fr \
--cc=andrew.jones@linux.dev \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=stable@vger.kernel.org \
--cc=sunilvl@ventanamicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®