All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: arm64: Fix the hyp pool size on large machines, plus two hardening patches
@ 2026-11-05 22:28 ` Xuheng Li via B4 Relay
  0 siblings, 0 replies; 9+ messages in thread
From: Xuheng Li @ 2026-11-05 22:28 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton
  Cc: Quentin Perret, Will Deacon, Catalin Marinas, Mark Rutland,
	Fuad Tabba, Joey Gouly, Steffen Eiden, Suzuki K Poulose,
	Zenghui Yu, kvmarm, linux-arm-kernel, linux-kernel, Xuheng Li,
	stable

Three changes for issues we found in pKVM as part of our research
project.

Patch 1 fixes a 32-bit size computation in hyp_pool_init(): a pool of
4 GiB or more gets a truncated range and maximum order.  hpool and
host_s2_pool reach that size on machines with about 2 TiB of RAM.

Patch 2 checks the host stage-2 PGD allocation for NULL before using
it.  With patch 1 applied that allocation cannot fail, so this only
turns a mis-sized pool into a clean -ENOMEM instead of a hyp panic.

Patch 3 makes hyp_map_walker() refuse to replace a valid block mapping
with a table, which would skip break-before-make and unmap the rest of
the block.  Nothing in mainline maps into an existing hyp block, so this
is hardening; Android's interface for EL2 modules to map pages can reach
it.

Signed-off-by: Xuheng Li <xuheng@cs.columbia.edu>
---
Xuheng Li (3):
      KVM: arm64: Compute the hyp pool size in 64 bits
      KVM: arm64: Check the host stage-2 PGD allocation for NULL
      KVM: arm64: Don't replace a valid hyp block mapping with a table

 arch/arm64/kvm/hyp/nvhe/mem_protect.c | 3 +++
 arch/arm64/kvm/hyp/nvhe/page_alloc.c  | 6 +++---
 arch/arm64/kvm/hyp/pgtable.c          | 7 +++++++
 3 files changed, 13 insertions(+), 3 deletions(-)
---
base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d
change-id: 20261105-hyp-pool-and-map-b5e7be9a1191

Best regards,
-- 
Xuheng Li <xuheng@cs.columbia.edu>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-05 22:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-05 22:28 [PATCH 0/3] KVM: arm64: Fix the hyp pool size on large machines, plus two hardening patches Xuheng Li
2026-11-05 22:28 ` Xuheng Li via B4 Relay
2026-11-05 22:28 ` [PATCH 1/3] KVM: arm64: Compute the hyp pool size in 64 bits Xuheng Li
2026-11-05 22:28   ` Xuheng Li via B4 Relay
2026-11-05 22:43   ` sashiko-bot
2026-11-05 22:28 ` [PATCH 2/3] KVM: arm64: Check the host stage-2 PGD allocation for NULL Xuheng Li
2026-11-05 22:28   ` Xuheng Li via B4 Relay
2026-11-05 22:28 ` [PATCH 3/3] KVM: arm64: Don't replace a valid hyp block mapping with a table Xuheng Li
2026-11-05 22:28   ` Xuheng Li via B4 Relay

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.