Re: [PATCH] KVM: x86: Acquire kvm->srcu when handling KVM_SET_VCPU_EVENTS

From: Sean Christopherson
Date: Fri Aug 23 2024 - 19:48:30 EST


On Tue, 23 Jul 2024 16:20:55 -0700, Sean Christopherson wrote:
> Grab kvm->srcu when processing KVM_SET_VCPU_EVENTS, as KVM will forcibly
> leave nested VMX/SVM if SMM mode is being toggled, and leaving nested VMX
> reads guest memory.
>
> Note, kvm_vcpu_ioctl_x86_set_vcpu_events() can also be called from KVM_RUN
> via sync_regs(), which already holds SRCU. I.e. trying to precisely use
> kvm_vcpu_srcu_read_lock() around the problematic SMM code would cause
> problems. Acquiring SRCU isn't all that expensive, so for simplicity,
> grab it unconditionally for KVM_SET_VCPU_EVENTS.
>
> [...]

Applied to kvm-x86 fixes, thanks!

[1/1] KVM: x86: Acquire kvm->srcu when handling KVM_SET_VCPU_EVENTS
https://github.com/kvm-x86/linux/commit/4bcdd831d9d0

--
https://github.com/kvm-x86/linux/tree/next