]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: Implement barriers before accessing kvm->buses[] on SRCU read paths
authorKeir Fraser <keirf@google.com>
Tue, 9 Sep 2025 10:00:06 +0000 (10:00 +0000)
committerMarc Zyngier <maz@kernel.org>
Mon, 15 Sep 2025 09:55:23 +0000 (10:55 +0100)
commit7788255aba6545a27b8d143c5256536f8dfb2c0a
tree30be9801ea7217fb6c5e210cba1c888155efc1f1
parent11490b5ec6bc4fe3a36f90817bbc8021ba8b05cd
KVM: Implement barriers before accessing kvm->buses[] on SRCU read paths

This ensures that, if a VCPU has "observed" that an IO registration has
occurred, the instruction currently being trapped or emulated will also
observe the IO registration.

At the same time, enforce that kvm_get_bus() is used only on the
update side, ensuring that a long-term reference cannot be obtained by
an SRCU reader.

Signed-off-by: Keir Fraser <keirf@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/x86/kvm/vmx/vmx.c
include/linux/kvm_host.h
virt/kvm/kvm_main.c