mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 15:44:13 +08:00
a6816314af
Introduce vcpu->wants_to_run to indicate when a vCPU is in its core run loop, i.e. when the vCPU is running the KVM_RUN ioctl and immediate_exit was not set. Replace all references to vcpu->run->immediate_exit with !vcpu->wants_to_run to avoid TOCTOU races with userspace. For example, a malicious userspace could invoked KVM_RUN with immediate_exit=true and then after KVM reads it to set wants_to_run=false, flip it to false. This would result in the vCPU running in KVM_RUN with wants_to_run=false. This wouldn't cause any real bugs today but is a dangerous landmine. Signed-off-by: David Matlack <dmatlack@google.com> Link: https://lore.kernel.org/r/20240503181734.1467938-2-dmatlack@google.com Signed-off-by: Sean Christopherson <seanjc@google.com> |
||
---|---|---|
.. | ||
aia_aplic.c | ||
aia_device.c | ||
aia_imsic.c | ||
aia.c | ||
Kconfig | ||
main.c | ||
Makefile | ||
mmu.c | ||
tlb.c | ||
vcpu_exit.c | ||
vcpu_fp.c | ||
vcpu_insn.c | ||
vcpu_onereg.c | ||
vcpu_pmu.c | ||
vcpu_sbi_base.c | ||
vcpu_sbi_hsm.c | ||
vcpu_sbi_pmu.c | ||
vcpu_sbi_replace.c | ||
vcpu_sbi_sta.c | ||
vcpu_sbi_v01.c | ||
vcpu_sbi.c | ||
vcpu_switch.S | ||
vcpu_timer.c | ||
vcpu_vector.c | ||
vcpu.c | ||
vm.c | ||
vmid.c |