]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
KVM: arm64: Eagerly init vgic dist/redist on vgic creation
authorMarc Zyngier <maz@kernel.org>
Sat, 28 Feb 2026 16:45:59 +0000 (16:45 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 5 Mar 2026 15:18:38 +0000 (15:18 +0000)
commitac6769c8f948dff33265c50e524aebf9aa6f1be0
treed6051f19d2b5296095367412b0d0cf9e2b6aed90
parent11439c4635edd669ae435eec308f4ab8a0804808
KVM: arm64: Eagerly init vgic dist/redist on vgic creation

If vgic_allocate_private_irqs_locked() fails for any odd reason,
we exit kvm_vgic_create() early, leaving dist->rd_regions uninitialised.

kvm_vgic_dist_destroy() then comes along and walks into the weeds
trying to free the RDs. Got to love this stuff.

Solve it by moving all the static initialisation early, and make
sure that if we fail halfway, we're in a reasonable shape to
perform the rest of the teardown. While at it, reset the vgic model
on failure, just in case...

Reported-by: syzbot+f6a46b038fc243ac0175@syzkaller.appspotmail.com
Tested-by: syzbot+f6a46b038fc243ac0175@syzkaller.appspotmail.com
Fixes: b3aa9283c0c50 ("KVM: arm64: vgic: Hoist SGI/PPI alloc from vgic_init() to kvm_create_vgic()")
Link: https://lore.kernel.org/r/69a2d58c.050a0220.3a55be.003b.GAE@google.com
Link: https://patch.msgid.link/20260228164559.936268-1-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
arch/arm64/kvm/vgic/vgic-init.c