Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7567cae1 authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity
Browse files

KVM: take srcu lock before call to complete_pio()



complete_pio() may use slot table which is protected by srcu.

Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Cc: stable@kernel.org
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 01bf0b64
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4483,7 +4483,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
		kvm_set_cr8(vcpu, kvm_run->cr8);

	if (vcpu->arch.pio.cur_count) {
		vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
		r = complete_pio(vcpu);
		srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
		if (r)
			goto out;
	}