From: Robin Murphy <robin.murphy@arm.com>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Hanjun Guo <guohanjun@huawei.com>
Cc: Sudeep Holla <sudeep.holla@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Shameer Kolothum <skolothumtho@nvidia.com>,
Joerg Roedel <jroedel@suse.de>,
linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/2] ACPI: IORT: validate node and RMR extents
Date: Thu, 13 Aug 2026 19:35:25 +0100 [thread overview]
Message-ID: <5b01a446-929a-4b35-8f6f-174175a87ff4@arm.com> (raw)
In-Reply-To: <20260813160118.69153-1-pengpeng@iscas.ac.cn>
On 13/08/2026 5:01 pm, Pengpeng Hou wrote:
> The original patch combined the generic IORT node walk with the
> IOMMU-specific RMR descriptor and ID-mapping arrays. This version
> separates those contracts as requested.
>
> Patch 1 validates the root node area, complete node headers and advertised
> node lengths in each generic walker. Patch 2, built only with
> CONFIG_IOMMU_API, validates the fixed RMR payload and both arrays before
> walking them.
But why? If a platform really did have an IORT that's so obviously
malformed or corrupted, why would we assume that all its other ACPI
tables are valid enough to even be able to boot as far as running this
code? Or conversely, what if the table does happen to have the correct
structure but is still full of nonsense such that we end up exploding
later when a driver touches bogus iomem?
Mainline Linux is not a firmware validation suite; if we can't assume
basic stuff like table headers are correct then there's basically not
much point in even trying. Also it is highly unlikely that people who
write firmware would ship it without doing any testing; if Linux crashes
horribly the first time they try to boot their new build, they're
probably going to notice that something's wrong. However, from
experience, if Linux does successfully boot to a shell then they may
assume it's fine and ship it even if the IORT node ID mapping offsets
are bogus so MSIs don't work and devices have fallen back to legacy
interrupts...
Thus if anything there's an argument to be made that the more we try to
be robust against unreasonably broken firmware, the more unreasonably
broken firmware will propagate into the wild. And if you think people
will care about kernel warnings, try looking at the boot logs of just
about any production Android device ;)
Thanks,
Robin.
>
> Changes since v1:
> https://lore.kernel.org/all/20260706094300.82618-1-pengpeng@iscas.ac.cn/
> - split generic traversal from RMR array validation
> - validate root node_offset and node_count before pointer construction
> - scope RMR helpers with their CONFIG_IOMMU_API users
> - document why a zero-count array needs no offset validation
>
> Testing used Linux 3d6d817622b0 plus this series, GCC 13.3 and QEMU
> 8.2.2 with a Cortex-A57 arm64 CPU model. A temporary KUnit harness in
> iort.c called the actual static validation helpers; the harness is not
> part of this series. The acpi_iort_bounds suite passed both tests,
> covering invalid root offsets, truncated node and RMR payload extents,
> and out-of-bounds RMR descriptor and ID-mapping arrays.
>
> This did not exercise a platform-provided IORT table through the complete
> boot-time discovery path.
>
> Pengpeng Hou (2):
> ACPI: IORT: validate table and node extents before traversal
> ACPI: IORT: validate RMR node array extents
>
> drivers/acpi/arm64/iort.c | 117 +++++++++++++++++++++++++++++++++++---
> 1 file changed, 109 insertions(+), 8 deletions(-)
>
>
> base-commit: 3d6d817622b0a9721e3cc404df3469171582be13
prev parent reply other threads:[~2026-08-13 18:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 16:01 Pengpeng Hou
2026-08-13 16:04 ` [PATCH v2 1/2] ACPI: IORT: validate table and node extents before traversal Pengpeng Hou
2026-08-13 16:05 ` [PATCH v2 2/2] ACPI: IORT: validate RMR node array extents Pengpeng Hou
2026-08-13 18:35 ` Robin Murphy [this message]
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=5b01a446-929a-4b35-8f6f-174175a87ff4@arm.com \
--to=robin.murphy@arm.com \
--cc=catalin.marinas@arm.com \
--cc=guohanjun@huawei.com \
--cc=jroedel@suse.de \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=pengpeng@iscas.ac.cn \
--cc=rafael@kernel.org \
--cc=skolothumtho@nvidia.com \
--cc=sudeep.holla@kernel.org \
--cc=will@kernel.org \
/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®