From: Steven Price <steven.price@arm.com>
To: "Christian König" <christian.koenig@amd.com>,
"Marc Zyngier" <maz@kernel.org>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Thomas Gleixner" <tglx@kernel.org>
Cc: Steven Price <steven.price@arm.com>,
"T.J. Mercier" <tjmercier@google.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Brian Starkey <Brian.Starkey@arm.com>,
John Stultz <jstultz@google.com>,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
Jason Gunthorpe <jgg@ziepe.ca>, Jiri Pirko <jiri@resnulli.us>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>
Subject: [PATCH v2 0/4] Clear shared pages after private-to-shared conversion
Date: Thu, 20 Aug 2026 16:00:29 +0100 [thread overview]
Message-ID: <20260820150034.88729-1-steven.price@arm.com> (raw)
set_memory_decrypted() doesn't (currently) guarantee to preserve or zero
memory, but both the GICv3 ITS driver and the system_cc_shared dma-buf
heap currently allocate memory with __GFP_ZERO followed by calling
set_memory_decrypted(). On an Arm CCA system with MEC this can cause
ciphertext to be visible to the guest rather than the expected zeros.
Patches 1 and 3 fix this by zeroing after the set_memory_decrypted()
call.
Patches 2 and 4 fix other related bugs that Sashiko found. Patch 2 fixes
the issue that set_memory_decrypted() can be a sleeping call, so moves
the allocation out of an atomic context.
Patch 4 deals with the situation where set_memory_decrypted() fails and
the rollback path could attempt to re-encrypt memory which was never
decrypted.
I've sorted the patches by area, but there's no (semantic) dependency
between them.
Changes in v2:
* Switched to use BIT(n) rather than 1 << n in the GICv3 change.
* Added Jason's R-b.
* Patches 2 and 4 are new.
v1: https://lore.kernel.org/r/20260820105026.53208-1-steven.price@arm.com
Steven Price (4):
irqchip/gic-v3-its: Zero shared pages after conversion
irqchip/gic-v3-its: Allocate VPE tables from sleepable context
dma-buf: heaps: Zero system shared heap pages after conversion
dma-buf: heaps: Fix shared system heap allocation rollback
drivers/dma-buf/heaps/system_heap.c | 24 +++++++++++++-----
drivers/irqchip/irq-gic-v3-its.c | 39 ++++++++++++++++-------------
2 files changed, 40 insertions(+), 23 deletions(-)
--
2.43.0
next reply other threads:[~2026-08-20 15:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 15:00 Steven Price [this message]
2026-08-20 15:00 ` [PATCH v2 1/4] irqchip/gic-v3-its: Zero shared pages after conversion Steven Price
2026-08-20 17:44 ` Catalin Marinas
2026-08-20 17:47 ` Jason Gunthorpe
2026-08-20 18:15 ` Catalin Marinas
2026-08-20 15:00 ` [PATCH v2 2/4] irqchip/gic-v3-its: Allocate VPE tables from sleepable context Steven Price
2026-08-20 15:46 ` Steven Price
2026-08-20 15:00 ` [PATCH v2 3/4] dma-buf: heaps: Zero system shared heap pages after conversion Steven Price
2026-08-20 15:00 ` [PATCH v2 4/4] dma-buf: heaps: Fix shared system heap allocation rollback Steven Price
2026-08-20 16:56 ` Jason Gunthorpe
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=20260820150034.88729-1-steven.price@arm.com \
--to=steven.price@arm.com \
--cc=Brian.Starkey@arm.com \
--cc=benjamin.gaignard@collabora.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jgg@ziepe.ca \
--cc=jiri@resnulli.us \
--cc=jstultz@google.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=maz@kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=suzuki.poulose@arm.com \
--cc=tglx@kernel.org \
--cc=tjmercier@google.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