VDB

CVE-2024-40953

CVE-2024-40953 PUBLISHED CVSS 7.9 HIGH

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

Reported by linux · Published July 12, 2024

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

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
kernel-modules-extraAmazon Linux6.1.96-102.177.amzn2023
kernel-libbpfAmazon Linux6.1.96-102.177.amzn2023
kernel-develAmazon Linux6.1.96-102.177.amzn2023
kernel-livepatch-6.1.96-102.177Amazon Linux1.0-0.amzn2023
linux_kernellinux6.9.7, 6.6.36, 6.1.96, 5.15.169, 5.10.228, 5.4.285, 4.19.323
LinuxLinuxa937ef951bba72f48d2402451419d725d70dba20, 95c8dd79f3a14df96b3820b35b8399bd91b2be60, 82bd728a06e55f5b5f93d10ce67f4fe7e689853a, 71fbc3af3dacb26c3aa2f30bb3ab05c44d082c84, 4c141136a28421b78f34969b25a4fa32e06e2180, 11a772d5376aa6d3e2e69b5b5c585f79b60c0e17

Risk scores

CVSS 3.1
7.9
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:H

Affected products

VendorProductVersions
LinuxLinux217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42
LinuxLinux2.6.39, 0, 4.19.323
amazon:2023kernel-modules-extra0
amazon:2023kernel-libbpf0
amazon:2023kernel-devel0
amazon:2023kernel-livepatch-6.1.96-102.1770
LinuxLinux2.6.39, 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42, 217ece6129f2d3b4fdd18d9e79be9e43d8d14a42
amazon:2023bpftool0
amazon:2023kernel-tools0
amazon:2023kernel-tools-devel0
amazon:2023kernel-headers0
amazon:2023kernel0
amazon:2023kernel-libbpf-static0
amazon:2023kernel-modules-extra-common0
amazon:2023kernel-libbpf-devel0
linuxlinux_kernel2.6.39, 2.6.39, 2.6.39
amazon:2023perf0
amazon:2023python3-perf0

Timeline

  • Jul 12, 2024 CVE Published
  • Jul 13, 2024 EPSS Score (30 in total, the first dated here)
  • Oct 4, 2024 Coalition ESS Score (8 in total, the first dated here)
  • Jan 7, 2026 Security Advisory (321 in total, the first dated here)
  • Jan 7, 2026 CVE Updated
  • Apr 29, 2026 Distribution Patch (224 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-40953
vulnetix vdb fixes CVE-2024-40953

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-40953/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›