All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] KVM: arm64: vgic-v3: Fix yet another lock ordering turd
@ 2025-09-04  6:23 Oliver Upton
  2025-09-04  6:23 ` [PATCH 1/5] KVM: arm64: vgic-v3: Use bare refcount for VGIC LPIs Oliver Upton
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Oliver Upton @ 2025-09-04  6:23 UTC (permalink / raw)
  To: kvmarm; +Cc: Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
	Oliver Upton

syzkaller found yet another locking bug in the VGIC [*], this time due
to nesting a 'plain' spinlock (xa_lock) inside of a raw spinlock
(ap_list_lock). Given the way we do refcounts on LPIs it is possible
for this exact sort of issue to crop up where the last reference may
be dropped in unexpected places.

Small series to fix the issue by deferring xarray modifications outside
of the ap_list_lock critical section along with some slight lockdep
hinting to make these rare bugs a bit more obvious.

Applies to 6.17-rc4.

Oliver Upton (5):
  KVM: arm64: vgic-v3: Use bare refcount for VGIC LPIs
  KVM: arm64: Spin off release helper from vgic_put_irq()
  KVM: arm64: vgic-v3: Erase LPIs from xarray outside of raw spinlocks
  KVM: arm64: vgic-v3: Don't require IRQs be disabled for LPI xarray
    lock
  KVM: arm64: vgic-v3: Indicate vgic_put_irq() may take LPI xarray lock

 arch/arm64/kvm/vgic/vgic-debug.c |  2 +-
 arch/arm64/kvm/vgic/vgic-init.c  |  6 +--
 arch/arm64/kvm/vgic/vgic-its.c   | 15 +++---
 arch/arm64/kvm/vgic/vgic-v4.c    |  2 +-
 arch/arm64/kvm/vgic/vgic.c       | 78 +++++++++++++++++++++++---------
 arch/arm64/kvm/vgic/vgic.h       |  8 ++--
 include/kvm/arm_vgic.h           | 10 ++--
 7 files changed, 80 insertions(+), 41 deletions(-)


base-commit: b320789d6883cc00ac78ce83bccbfe7ed58afcf0
-- 
2.39.5


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

end of thread, other threads:[~2025-09-05 12:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04  6:23 [PATCH 0/5] KVM: arm64: vgic-v3: Fix yet another lock ordering turd Oliver Upton
2025-09-04  6:23 ` [PATCH 1/5] KVM: arm64: vgic-v3: Use bare refcount for VGIC LPIs Oliver Upton
2025-09-04  6:23 ` [PATCH 2/5] KVM: arm64: Spin off release helper from vgic_put_irq() Oliver Upton
2025-09-04  6:23 ` [PATCH 3/5] KVM: arm64: vgic-v3: Erase LPIs from xarray outside of raw spinlocks Oliver Upton
2025-09-05  7:44   ` Marc Zyngier
2025-09-05  7:19     ` Oliver Upton
2025-09-04  6:23 ` [PATCH 4/5] KVM: arm64: vgic-v3: Don't require IRQs be disabled for LPI xarray lock Oliver Upton
2025-09-05  8:13   ` Marc Zyngier
2025-09-05  8:55     ` Oliver Upton
2025-09-04  6:23 ` [PATCH 5/5] KVM: arm64: vgic-v3: Indicate vgic_put_irq() may take " Oliver Upton
2025-09-04 10:25   ` Ben Horgan
2025-09-04  8:19     ` Oliver Upton
2025-09-05  8:29 ` [PATCH 0/5] KVM: arm64: vgic-v3: Fix yet another lock ordering turd Marc Zyngier

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.