]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: vgic: Fix deadlock on error handling
authorMarc Zyngier <marc.zyngier@arm.com>
Thu, 12 Jan 2017 09:21:56 +0000 (09:21 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 13 Jan 2017 11:19:35 +0000 (11:19 +0000)
commit89933b4113e08cfd9c15f9ef4263dc3cd669d02b
tree37d742ae587ab033d9b3a961cf7fbae85c294df0
parent6ac922e0ab3a4ea3b6bd9c9002c9ac531a45b8c7
KVM: arm/arm64: vgic: Fix deadlock on error handling

Dmitry Vyukov reported that the syzkaller fuzzer triggered a
deadlock in the vgic setup code when an error was detected, as
the cleanup code tries to take a lock that is already held by
the setup code.

The fix is to avoid retaking the lock when cleaning up, by
telling the cleanup function that we already hold it.

Cc: stable@vger.kernel.org
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
virt/kvm/arm/vgic/vgic-init.c
virt/kvm/arm/vgic/vgic-v2.c
virt/kvm/arm/vgic/vgic-v3.c