]> 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)
commit34e18328c85f822f01516d3725ce9046b8a1b424
tree65705f6cf4820e2d72e7e4749380139a9483ea32
parent624764fbe7a7066de3f49c1254575777573c2d1c
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: 9cd702fc9074 ("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