From: sashiko-bot@kernel.org
To: "Mikko Perttunen" <mperttunen@nvidia.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 08/11] iommu/tegra-smmu: Defer display client translation to driver handover
Date: Fri, 16 Oct 2026 07:01:06 +0000 [thread overview]
Message-ID: <sashiko-outbox-173894@kernel.org> (raw)
In-Reply-To: <20261016-b4-arm32-iommu-dma-cookie-v2-8-b06842a01938@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] iommu: tegra SMMU isolation bypass for display controllers via defer_enable
--
commit d4d42b6a74ebf50531a4c2f625710578bc863c34
Author: Mikko Perttunen <mperttunen@nvidia.com>
iommu/tegra-smmu: Defer display client translation to driver handover
Bootloaders may leave display controllers scanning out a boot splash
while the kernel boots. Enabling translation for them without special
care during that time would cause translation faults.
Because of this, tegra_smmu_def_domain_type has kept every device on an
identity domain at boot, and TegraDRM has parallel custom IOMMU domain
management code paths for these clients.
> diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
> index 67e7a7b925f0c..6779528a9e7cc 100644
> --- a/drivers/iommu/tegra-smmu.c
> +++ b/drivers/iommu/tegra-smmu.c
> @@ -368,7 +368,13 @@ static void tegra_smmu_enable(struct tegra_smmu *smmu, unsigned int swgroup,
> value = smmu_readl(smmu, group->reg);
> value &= ~SMMU_ASID_MASK;
> value |= SMMU_ASID_VALUE(asid);
> - value |= SMMU_ASID_ENABLE;
> + /*
> + * A deferred client is set up completely, but with translation
> + * gated off, so it stays in bypass until its driver calls
> + * tegra_smmu_enable_translation().
> + */
> + if (!group->defer_enable)
> + value |= SMMU_ASID_ENABLE;
[Severity: Critical]
If a generic driver like vfio-platform binds to this device (for example, to
pass the display controller through to a VM), it attaches an unmanaged IOMMU
domain and expects isolation to be enforced.
Since tegra_smmu_enable() completes without setting SMMU_ASID_ENABLE for
deferred clients, does this silently leave the hardware in bypass mode even
after the IOMMU domain is successfully attached?
This could allow an untrusted guest VM to program the DMA engine to read or
write arbitrary host physical memory, bypassing IOMMU isolation.
> smmu_writel(smmu, value, group->reg);
> } else {
> pr_warn("%s group from swgroup %u not found\n", __func__,
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-b4-arm32-iommu-dma-cookie-v2-0-b06842a01938@nvidia.com?part=8
next prev parent reply other threads:[~2026-10-16 7:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 6:46 [PATCH v2 00/11] Make the 32-bit ARM DMA API work with normal IOMMU DMA default domains (+ Tegra PoC) Mikko Perttunen
2026-10-16 6:46 ` [PATCH v2 01/11] iommu: Add iommu_teardown_dma_ops Mikko Perttunen
2026-10-16 6:46 ` [PATCH v2 02/11] iommu: Add cookie type for ARM_DMA_USE_IOMMU Mikko Perttunen
2026-10-16 6:46 ` [PATCH v2 03/11] ARM: dma-mapping: Split mapping allocation from domain allocation Mikko Perttunen
2026-10-16 6:46 ` [PATCH v2 04/11] ARM: dma-mapping: Implement and expose DMA setup functions Mikko Perttunen
2026-10-16 7:06 ` sashiko-bot
2026-10-16 6:46 ` [PATCH v2 05/11] ARM: dma-mapping: Bypass the legacy path for core-owned DMA API domains Mikko Perttunen
2026-10-16 7:01 ` sashiko-bot
2026-10-16 6:46 ` [PATCH v2 06/11] ARM: dma-mapping: Handle foreign buffers in arm_iommu_get_sgtable Mikko Perttunen
2026-10-16 7:04 ` sashiko-bot
2026-10-16 6:46 ` [PATCH v2 07/11] iommu: Let 32-bit ARM drivers opt into a DMA API default domain Mikko Perttunen
2026-10-16 6:46 ` [PATCH v2 08/11] iommu/tegra-smmu: Defer display client translation to driver handover Mikko Perttunen
2026-10-16 7:01 ` sashiko-bot [this message]
2026-10-16 6:46 ` [PATCH v2 09/11] gpu: host1x: Drop release of legacy 32-bit ARM DMA domain Mikko Perttunen
2026-10-16 6:46 ` [PATCH v2 10/11] drm/tegra: " Mikko Perttunen
2026-10-16 6:46 ` [PATCH v2 11/11] iommu/tegra-smmu: Use a DMA API default domain per swgroup Mikko Perttunen
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=sashiko-outbox-173894@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mperttunen@nvidia.com \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.