Skip to content

Clear shared pages after private-to-shared conversion

Steven Price dri-devel linux-arm-kernel linux-media lkml 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 5 repliesIn review
  2. v12 patches 6 repliesSuperseded

Changes in v2 from the cover letter

* Switched to use BIT(n) rather than 1 << n in the GICv3 change.
* Added Jason's R-b.
* Patches 2 and 4 are new.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4irqchip/gic-v3-its: Zero shared pages after conversiondrivers/irqchip/irq-gic-v3-its.c+7 -23 replies
2/4irqchip/gic-v3-its: Allocate VPE tables from sleepable contextdrivers/irqchip/irq-gic-v3-its.c+15 -151 reply
3/4dma-buf: heaps: Zero system shared heap pages after conversiondrivers/dma-buf/heaps/system_heap.c+11 -30 replies
4/4dma-buf: heaps: Fix shared system heap allocation rollbackdrivers/dma-buf/heaps/system_heap.c+7 -31 reply

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchJason Gunthorpe
1/4R-b
2/4
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] Clear shared pages after private-to-shared conversion

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/[email protected]

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(-)
Signature · 1 line
2.43.0