# CVE-2024-40953: KVM: Fix a data race on last\_boosted\_vcpu in kvm\_vcpu\_on\_spin()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.9
- **CVSS:** 7.9 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: Low; Integrity impact: Low; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.25% (percentile 10, 2026-11-26)
- **CWE:** CWE-362
- **Published:** 2024-07-12T12:31:56.832Z
- **Modified:** 2026-08-05T11:34:12.855Z

## Who should check

- Anyone running Linux \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 11a772d5376aa6d3e2e69b5b5c585f79b60c0e17; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 4c141136a28421b78f34969b25a4fa32e06e2180; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 82bd728a06e55f5b5f93d10ce67f4fe7e689853a; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 92c77807d938145c7c3350c944ef9f39d7f6017c; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< a937ef951bba72f48d2402451419d725d70dba20; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 95c8dd79f3a14df96b3820b35b8399bd91b2be60; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 49f683b41f28918df3e51ddc0d928cb2e934ccdb
- Anyone running Linux 2.6.39

## 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 and fixed versions

- Linux: \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 11a772d5376aa6d3e2e69b5b5c585f79b60c0e17; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 4c141136a28421b78f34969b25a4fa32e06e2180; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 82bd728a06e55f5b5f93d10ce67f4fe7e689853a; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 92c77807d938145c7c3350c944ef9f39d7f6017c; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< a937ef951bba72f48d2402451419d725d70dba20; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 95c8dd79f3a14df96b3820b35b8399bd91b2be60; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 49f683b41f28918df3e51ddc0d928cb2e934ccdb (cvelist)
- Linux: 2.6.39 (cvelist)

## Mitigation

- Upgrade Linux to 49f683b41f28918df3e51ddc0d928cb2e934ccdb or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-40953. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-40953.md
Affected: Linux >= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, < 11a772d5376aa6d3e2e69b5b5c585f79b60c0e17; >= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, < 4c141136a28421b78f34969b25a4fa32e06e2180; >= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, < 71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84; >= 217ece6129f2d3b4fdd18d9…
Fixed in: Linux 11a772d5376aa6d3e2e69b5b5c585f79b60c0e17, Linux 4c141136a28421b78f34969b25a4fa32e06e2180, Linux 71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84, Linux 82bd728a06e55f5b5f93d10ce67f4fe7e689853a, Linux 92c77807d938145c7c3350c944ef9f39d7f6017c, Linux 95c8dd79f3a14df96b3820b35b8399bd91b2be60, Linux 49f68…

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-40953 being exploited?

There is no confirmed exploitation: CVE-2024-40953 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.25% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-40953?

High: CVSS 7.9 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-40953?

Linux \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 11a772d5376aa6d3e2e69b5b5c585f79b60c0e17; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 4c141136a28421b78f34969b25a4fa32e06e2180; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 82bd728a06e55f5b5f93d10ce67f4fe7e689853a; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 92c77807d938145c7c3350c944ef9f39d7f6017c; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< a937ef951bba72f48d2402451419d725d70dba20; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 95c8dd79f3a14df96b3820b35b8399bd91b2be60; \>= 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, \< 49f683b41f28918df3e51ddc0d928cb2e934ccdb; Linux 2.6.39.

### Is there a fix for CVE-2024-40953?

Yes. Fixed in Linux 11a772d5376aa6d3e2e69b5b5c585f79b60c0e17, Linux 4c141136a28421b78f34969b25a4fa32e06e2180, Linux 71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84, Linux 82bd728a06e55f5b5f93d10ce67f4fe7e689853a, Linux 92c77807d938145c7c3350c944ef9f39d7f6017c, Linux 95c8dd79f3a14df96b3820b35b8399bd91b2be60, Linux 49f683b41f28918df3e51ddc0d928cb2e934ccdb. Upgrade Linux to 49f683b41f28918df3e51ddc0d928cb2e934ccdb or later.

### How do I check if I'm affected by CVE-2024-40953?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/11a772d5376aa6d3e2e69b5b5c585f79b60c0e17>
- patch: <https://git.kernel.org/stable/c/4c141136a28421b78f34969b25a4fa32e06e2180>
- patch: <https://git.kernel.org/stable/c/71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84>
- patch: <https://git.kernel.org/stable/c/82bd728a06e55f5b5f93d10ce67f4fe7e689853a>
- patch: <https://git.kernel.org/stable/c/92c77807d938145c7c3350c944ef9f39d7f6017c>
- patch: <https://git.kernel.org/stable/c/a937ef951bba72f48d2402451419d725d70dba20>
- patch: <https://git.kernel.org/stable/c/95c8dd79f3a14df96b3820b35b8399bd91b2be60>
- patch: <https://git.kernel.org/stable/c/49f683b41f28918df3e51ddc0d928cb2e934ccdb>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-40953>

HTML: <https://flawdb.com/CVE-2024-40953> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-40953>
