Sean Christopherson 2d08935682 KVM: x86: Don't re-acquire SRCU lock in complete_emulated_io()
Don't re-acquire SRCU in complete_emulated_io() now that KVM acquires the
lock in kvm_arch_vcpu_ioctl_run().  More importantly, don't overwrite
vcpu->srcu_idx.  If the index acquired by complete_emulated_io() differs
from the one acquired by kvm_arch_vcpu_ioctl_run(), KVM will effectively
leak a lock and hang if/when synchronize_srcu() is invoked for the
relevant grace period.

Fixes: 8d25b7beca7e ("KVM: x86: pull kvm->srcu read-side to kvm_arch_vcpu_ioctl_run")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20220415004343.2203171-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-21 13:16:10 -04:00
..
2022-03-26 12:19:04 -07:00
2022-03-31 11:59:03 -07:00
2022-01-16 15:53:00 +02:00
2021-11-01 21:17:39 -07:00
2022-04-17 09:55:59 -07:00
2022-04-17 09:55:59 -07:00
2022-04-03 12:15:47 -07:00
2022-04-07 11:27:02 +02:00
2022-03-28 14:32:39 -07:00
2021-12-11 09:09:45 +01:00