]> git.karo-electronics.de Git - linux-beck.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)
commit1193e6aeecb36c74c48c7cd0f641acbbed9ddeef
tree37d742ae587ab033d9b3a961cf7fbae85c294df0
parent488f94d7212b00a2ec72fb886b155f1b04c5aa98
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