CVE-2024-40953
KVM: Fix a data race on last_boosted_vcpu in kvm_vcpu_on_spin()
Check your servers for CVE-2024-40953
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-40953 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- changed: the damage reaches other components, such as the host of a container or other users
- Impact
- confidentiality low, integrity low, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.20%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 10.1% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 10 Sep 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, before 11a772d5376aa6d3e2e69b5b5c585f79b60c0e17 affected from 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, before 4c141136a28421b78f34969b25a4fa32e06e2180 affected from 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, before 71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84 affected from 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, before 82bd728a06e55f5b5f93d10ce67f4fe7e689853a affected from 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, before 92c77807d938145c7c3350c944ef9f39d7f6017c affected from 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, before a937ef951bba72f48d2402451419d725d70dba20 affected from 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, before 95c8dd79f3a14df96b3820b35b8399bd91b2be60 affected from 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, before 49f683b41f28918df3e51ddc0d928cb2e934ccdb
Other versions: unaffected
|
| Linux |
affected 2.6.39 unaffected before 2.6.39 unaffected from 4.19.323 up to and including 4.19.* unaffected from 5.4.285 up to and including 5.4.* unaffected from 5.10.228 up to and including 5.10.* unaffected from 5.15.169 up to and including 5.15.* unaffected from 6.1.96 up to and including 6.1.* unaffected from 6.6.36 up to and including 6.6.* unaffected from 6.9.7 up to and including 6.9.* unaffected 6.10 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-40953 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-40953
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-40953
trivy image --scanners vuln IMAGE | grep CVE-2024-40953
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/11a772d5376aa6d3e2e69b5b5c585f79b60c0e17 git.kernel.org
- https://git.kernel.org/stable/c/4c141136a28421b78f34969b25a4fa32e06e2180 git.kernel.org
- https://git.kernel.org/stable/c/71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84 git.kernel.org
- https://git.kernel.org/stable/c/82bd728a06e55f5b5f93d10ce67f4fe7e689853a git.kernel.org
- https://git.kernel.org/stable/c/92c77807d938145c7c3350c944ef9f39d7f6017c git.kernel.org
- https://git.kernel.org/stable/c/a937ef951bba72f48d2402451419d725d70dba20 git.kernel.org
- https://git.kernel.org/stable/c/95c8dd79f3a14df96b3820b35b8399bd91b2be60 git.kernel.org
- https://git.kernel.org/stable/c/49f683b41f28918df3e51ddc0d928cb2e934ccdb git.kernel.org
- https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html lists.debian.org
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html lists.debian.org
Source: the record CVE-2024-40953 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse