]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit8bde7ebf8baa7e4655e4dd437311186c0a9b0604
tree65705f6cf4820e2d72e7e4749380139a9483ea32
parenta632bb978805eb6571dbb10c56d053678370fbdc
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: 1621d693642a ("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