The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: arm64: vgic: Fixes for ITS table save and init retry
@ 2026-08-05  9:38 Fuad Tabba
  2026-08-05  9:38 ` [PATCH 1/3] KVM: arm64: vgic-its: Don't dereference a NULL collection on ITT save Fuad Tabba
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fuad Tabba @ 2026-08-05  9:38 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton
  Cc: Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
	Will Deacon, Sascha Bischoff, Sebastian Ene, kvmarm,
	linux-arm-kernel, linux-kernel

Hi folks,

Three unrelated vgic fixes.

These came out of reviewing the GIC-related postings on the list lately,
from Sebastian's ITS hardening series [1] to Sascha's GICv5 IRS series
[2]. These three are from the ITS table save paths and vgic init. Stare
into the GIC long enough and it stares back!

The first is the one that matters the most. A guest that issues MAPD,
MAPTI and then MAPC(V=0) leaves an ITE mapped with no collection, and
the next KVM_DEV_ARM_ITS_SAVE_TABLES from the VMM oopses the host. That
is three ITS commands and an ordinary migration save, with no race and
no allocation failure.

The other two are weaker and come after it. The init fix stops the SPI
array leaking when userspace retries KVM_DEV_ARM_VGIC_CTRL_INIT after a
failure. The collection table fix bounds a walk that a guest can drive
past the end of the table KVM computed, which stays inside guest
memory, so the guest only corrupts itself. Its error code is a
judgement call, and the commit message says which one and why.

The first and the last are reproduced, each with a selftest that fails
on an unfixed kernel and passes on a fixed one. Those are not part of
this series, happy to post them separately if they are worth having.
The init leak needs an observed allocation failure rather than a crash,
so there is no reproducer for it.

Based on Linux 7.2-rc6 (075b74841bd00).

Cheers,
/fuad

[1] https://lore.kernel.org/all/20260310124933.830025-1-sebastianene@google.com/
[2] https://lore.kernel.org/all/20260724104819.1296803-1-sascha.bischoff@arm.com/

Fuad Tabba (3):
  KVM: arm64: vgic-its: Don't dereference a NULL collection on ITT save
  KVM: arm64: vgic: Don't leak the SPI array when init is retried
  KVM: arm64: vgic-its: Don't write past the end of the collection table

 arch/arm64/kvm/vgic/vgic-init.c |  3 +++
 arch/arm64/kvm/vgic/vgic-its.c  | 11 +++++++++++
 2 files changed, 14 insertions(+)


base-commit: 075b74841bd0065a3bda3440873c747938e69b68
-- 
2.39.5


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

end of thread, other threads:[~2026-08-06  7:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05  9:38 [PATCH 0/3] KVM: arm64: vgic: Fixes for ITS table save and init retry Fuad Tabba
2026-08-05  9:38 ` [PATCH 1/3] KVM: arm64: vgic-its: Don't dereference a NULL collection on ITT save Fuad Tabba
2026-08-06  4:43   ` Oliver Upton
2026-08-06  7:41     ` Fuad Tabba
2026-08-05  9:38 ` [PATCH 2/3] KVM: arm64: vgic: Don't leak the SPI array when init is retried Fuad Tabba
2026-08-05  9:38 ` [PATCH 3/3] KVM: arm64: vgic-its: Don't write past the end of the collection table Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox