From: Marc Zyngier <maz@kernel.org>
To: Shanker Donthineni <sdonthineni@nvidia.com>
Cc: Thomas Gleixner <tglx@kernel.org>,
"Steven\ Price" <steven.price@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] irqchip/gic-v3-its: zero ITS tables in the shared view after decryption
Date: Mon, 24 Aug 2026 17:49:35 +0100 [thread overview]
Message-ID: <878q5vo44g.wl-maz@kernel.org> (raw)
In-Reply-To: <20260824155928.2396620-1-sdonthineni@nvidia.com>
On Mon, 24 Aug 2026 16:59:27 +0100,
Shanker Donthineni <sdonthineni@nvidia.com> wrote:
>
> its_alloc_pages_node() allocates pages, some with __GFP_ZERO, before
> calling set_memory_decrypted() to share them with the untrusted
> hypervisor. In an Arm CCA Realm, allocator clearing occurs through the
> Protected IPA.
>
> set_memory_decrypted() changes the RIPAS of the Protected IPA from
> RIPAS_RAM to RIPAS_EMPTY. The RMM architecture requires the backing
> DATA Granule to be wiped before it becomes GRAN_UNDELEGATED. Wiping is
> a confidentiality operation, not a zero-initialization guarantee: it
> may be implemented by changing the MEC or writing random data.
> Consequently, zeroes written through the Protected IPA are not
> guaranteed to be observed through the corresponding Unprotected IPA
> alias.
>
> This is harmless for tables that the guest fully populates before use,
> but the GICv3 ITS indirect device table is sparse. The guest writes only
> the L1 entries for devices it maps, while both the guest and the
> hypervisor's ITS emulation rely on unused entries being zero.
> Unspecified nonzero values can make an unpopulated entry appear valid,
> causing the guest to skip the required L2 allocation and the hypervisor
> to consume a bogus pointer. Interrupt translation then fails,
> potentially hanging the guest when it first uses the device. This is
> exposed when guest_memfd reuses the same backing Granule for the
> Unprotected IPA mapping rather than supplying a fresh Host page.
>
> Strip __GFP_ZERO before allocation and clear the page through the
> Unprotected IPA alias after set_memory_decrypted(), so the requested
> zeroes are written in Non-secure PAS and are visible to both the guest
> and the Host. This also matches dma_direct_alloc(), which clears memory
> after dma_set_decrypted().
>
> Fixes: b08e2f42e86b ("irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor")
> Cc: <stable@vger.kernel.org> # 6.18+
> Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com>
https://lore.kernel.org/r/20260820105026.53208-1-steven.price@arm.com
M.
--
Jazz isn't dead. It just smells funny.
prev parent reply other threads:[~2026-08-24 16:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 15:59 [PATCH] irqchip/gic-v3-its: zero ITS tables in the shared view after decryption Shanker Donthineni
2026-08-24 16:49 ` Marc Zyngier [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=878q5vo44g.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sdonthineni@nvidia.com \
--cc=stable@vger.kernel.org \
--cc=steven.price@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=tglx@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