All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Ying Xiao <eagleshaw@google.com>,
	"Aneesh Kumar K.V (Arm)" <aneesh.kumar@kernel.org>
Cc: "Sumit Semwal" <sumit.semwal@linaro.org>,
	"T . J . Mercier" <tjmercier@google.com>,
	"Jiri Pirko" <jiri@nvidia.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
	"Brian Starkey" <Brian.Starkey@arm.com>,
	"John Stultz" <jstultz@google.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Philipp Stanner" <phasta@kernel.org>,
	"Jacob Moroni" <jmoroni@google.com>,
	"Xuehao Hu" <xuehaohu@google.com>,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma-buf: heaps: system: zero pages after set_memory_decrypted()
Date: Wed, 18 Nov 2026 09:44:11 -0400	[thread overview]
Message-ID: <20261118134411.GQ2245175@nvidia.com> (raw)
In-Reply-To: <20261117155431.1654298-1-eagleshaw@google.com>

On Tue, Nov 17, 2026 at 03:54:31PM +0000, Ying Xiao wrote:
> system_heap_allocate() allocates pages via order_flags[] with __GFP_ZERO
> while the direct map still has the memory encryption bit set. For the
> system_cc_shared heap, set_memory_decrypted() subsequently clears the
> encryption bit without re-zeroing, leaving ciphertext in DRAM on
> confidential computing (CoCo) guests instead of plaintext zeros.
> 
> Skip __GFP_ZERO during alloc_pages() for cc_shared allocations, and zero
> the pages once in system_heap_set_page_decrypted() after
> set_memory_decrypted() succeeds.
> 
> Fixes: 78b30c50a7ac ("dma-buf: heaps: system: add system_cc_shared heap for explicitly shared memory")
> Reviewed-by: Jacob Moroni <jmoroni@google.com>
> Signed-off-by: Ying Xiao <eagleshaw@google.com>
> ---
>  drivers/dma-buf/heaps/system_heap.c | 24 ++++++++++++++++++++----
>  1 file changed, 20 insertions(+), 4 deletions(-)

This seems fine, but Aneesh is fixing this in a more complete way with
this other series.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

      parent reply	other threads:[~2026-11-18 13:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20261117155436eucas1p2fa7d030f5557d1c88d943226d65f69ca@eucas1p2.samsung.com>
2026-11-17 15:54 ` [PATCH] dma-buf: heaps: system: zero pages after set_memory_decrypted() Ying Xiao
2026-11-17 16:27   ` sashiko-bot
2026-11-18  8:05   ` Marek Szyprowski
2026-11-18 13:15   ` Jiri Pirko
2026-11-18 13:44   ` Jason Gunthorpe [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=20261118134411.GQ2245175@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=Brian.Starkey@arm.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=benjamin.gaignard@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eagleshaw@google.com \
    --cc=jiri@nvidia.com \
    --cc=jmoroni@google.com \
    --cc=jstultz@google.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=phasta@kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tjmercier@google.com \
    --cc=xuehaohu@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 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.