CVE-2024-40953

KVM: Fix a data race on last_boosted_vcpu in kvm_vcpu_on_spin()

MEDIUM
4.7
CVSS Score
Published: July 12, 2024 at 12:31 PM UTC
Updated: August 5, 2026 at 12:04 PM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM4.7
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: KVM: Fix a data race on last_boosted_vcpu in kvm_vcpu_on_spin() Use {READ,WRITE}_ONCE() to access kvm->last_boosted_vcpu to ensure the loads and stores are atomic. In the extremely unlikely scenario the compiler tears the stores, it's theoretically possible for KVM to attempt to get a vCPU using an out-of-bounds index, e.g. if the write is split into multiple 8-bit stores, and is paired with a 32-bit load on a VM with 257 vCPUs: CPU0 CPU1 last_boosted_vcpu = 0xff; (last_boosted_vcpu = 0x100) last_boosted_vcpu[15:8] = 0x01; i = (last_boosted_vcpu = 0x1ff) last_boosted_vcpu[7:0] = 0x00; vcpu = kvm->vcpu_array[0x1ff]; As detected by KCSAN: BUG: KCSAN: data-race in kvm_vcpu_on_spin [kvm] / kvm_vcpu_on_spin [kvm] write to 0xffffc90025a92344 of 4 bytes by task 4340 on cpu 16: kvm_vcpu_on_spin (arch/x86/kvm/../../../virt/kvm/kvm_main.c:4112) kvm handle_pause (arch/x86/kvm/vmx/vmx.c:5929) kvm_intel vmx_handle_exit (arch/x86/kvm/vmx/vmx.c:? arch/x86/kvm/vmx/vmx.c:6606) kvm_intel vcpu_run (arch/x86/kvm/x86.c:11107 arch/x86/kvm/x86.c:11211) kvm kvm_arch_vcpu_ioctl_run (arch/x86/kvm/x86.c:?) kvm kvm_vcpu_ioctl (arch/x86/kvm/../../../virt/kvm/kvm_main.c:?) kvm __se_sys_ioctl (fs/ioctl.c:52 fs/ioctl.c:904 fs/ioctl.c:890) __x64_sys_ioctl (fs/ioctl.c:890) x64_sys_call (arch/x86/entry/syscall_64.c:33) do_syscall_64 (arch/x86/entry/common.c:?) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) read to 0xffffc90025a92344 of 4 bytes by task 4342 on cpu 4: kvm_vcpu_on_spin (arch/x86/kvm/../../../virt/kvm/kvm_main.c:4069) kvm handle_pause (arch/x86/kvm/vmx/vmx.c:5929) kvm_intel vmx_handle_exit (arch/x86/kvm/vmx/vmx.c:? arch/x86/kvm/vmx/vmx.c:6606) kvm_intel vcpu_run (arch/x86/kvm/x86.c:11107 arch/x86/kvm/x86.c:11211) kvm kvm_arch_vcpu_ioctl_run (arch/x86/kvm/x86.c:?) kvm kvm_vcpu_ioctl (arch/x86/kvm/../../../virt/kvm/kvm_main.c:?) kvm __se_sys_ioctl (fs/ioctl.c:52 fs/ioctl.c:904 fs/ioctl.c:890) __x64_sys_ioctl (fs/ioctl.c:890) x64_sys_call (arch/x86/entry/syscall_64.c:33) do_syscall_64 (arch/x86/entry/common.c:?) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) value changed: 0x00000012 -> 0x00000000

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

2.6.39 ≤ v < 4.19.3232.6.39 ≤ v < 5.10.2282.6.39 ≤ v < 5.15.1692.6.39 ≤ v < 5.4.2852.6.39 ≤ v < 6.1.962.6.39 ≤ v < 6.102.6.39 ≤ v < 6.6.362.6.39 ≤ v < 6.9.74.20 ≤ v < 5.4.2855.11 ≤ v < 5.15.1695.16 ≤ v < 6.1.965.5 ≤ v < 5.10.2286.2 ≤ v < 6.6.366.7 ≤ v < 6.9.7217ece6129f2d3b4fdd18d9e79be9e43d8d14a426.10 rc16.10 rc26.10 rc36.10 rc4
Vendor states this is fixed in 11a772d5376aa6d3e2e69b5b5c585f79b60c0e17 (fixed)
Vendor states this is fixed in 49f683b41f28918df3e51ddc0d928cb2e934ccdb (fixed)
Vendor states this is fixed in 4c141136a28421b78f34969b25a4fa32e06e2180 (fixed)
Vendor states this is fixed in 71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84 (fixed)
Vendor states this is fixed in 82bd728a06e55f5b5f93d10ce67f4fe7e689853a (fixed)
Vendor states this is fixed in 92c77807d938145c7c3350c944ef9f39d7f6017c (fixed)
Vendor states this is fixed in 95c8dd79f3a14df96b3820b35b8399bd91b2be60 (fixed)
Vendor states this is fixed in a937ef951bba72f48d2402451419d725d70dba20 (fixed)
Vendor states this is fixed in 2.6.39 (unaffected)
Vendor states this is fixed in 4.19.323 (unaffected)
Vendor states this is fixed in 5.10.228 (unaffected)
Vendor states this is fixed in 5.15.169 (unaffected)
Vendor states this is fixed in 5.4.285 (unaffected)
Vendor states this is fixed in 6.1.96 (unaffected)
Vendor states this is fixed in 6.10 (unaffected)
Vendor states this is fixed in 6.6.36 (unaffected)
Vendor states this is fixed in 6.9.7 (unaffected)

References (10)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/11a772d5376aa6d3e2e69b5b5c585f79b60c0e17
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/49f683b41f28918df3e51ddc0d928cb2e934ccdb
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/4c141136a28421b78f34969b25a4fa32e06e2180
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/82bd728a06e55f5b5f93d10ce67f4fe7e689853a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/92c77807d938145c7c3350c944ef9f39d7f6017c
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/95c8dd79f3a14df96b3820b35b8399bd91b2be60
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a937ef951bba72f48d2402451419d725d70dba20

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
HIGH
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-362

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card