OSDN Git Service

KVM: PPC: Fix kvm_arch_vcpu_ioctl vcpu_load leak
authorNicholas Piggin <npiggin@gmail.com>
Fri, 16 Jul 2021 02:43:10 +0000 (12:43 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 17 Jul 2021 04:33:18 +0000 (14:33 +1000)
commitbc4188a2f56e821ea057aca6bf444e138d06c252
tree65705f6cf4820e2d72e7e4749380139a9483ea32
parentbd31ecf44b8e18ccb1e5f6b50f85de6922a60de3
KVM: PPC: Fix kvm_arch_vcpu_ioctl vcpu_load leak

vcpu_put is not called if the user copy fails. This can result in preempt
notifier corruption and crashes, among other issues.

Fixes: b3cebfe8c1ca ("KVM: PPC: Move vcpu_load/vcpu_put down to each ioctl case in kvm_arch_vcpu_ioctl")
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210716024310.164448-2-npiggin@gmail.com
arch/powerpc/kvm/powerpc.c