VDB

CVE-2024-35804

CVE-2024-35804 PUBLISHED CVSS 8.8 HIGH

KVM: x86: Mark target gfn of emulated atomic instruction as dirty

Reported by linux · Published May 17, 2024

In the Linux kernel, the following vulnerability has been resolved: KVM: x86: Mark target gfn of emulated atomic instruction as dirty When emulating an atomic access on behalf of the guest, mark the target gfn dirty if the CMPXCHG by KVM is attempted and doesn't fault. This fixes a bug where KVM effectively corrupts guest memory during live migration by writing to guest memory without informing userspace that the page is dirty. Marking the page dirty got unintentionally dropped when KVM's emulated CMPXCHG was converted to do a user access. Before that, KVM explicitly mapped the guest page into kernel memory, and marked the page dirty during the unmap phase. Mark the page dirty even if the CMPXCHG fails, as the old data is written back on failure, i.e. the page is still written. The value written is guaranteed to be the same because the operation is atomic, but KVM's ABI is that all writes are dirty logged regardless of the value written. And more importantly, that's what KVM did before the buggy commit. Huge kudos to the folks on the Cc list (and many others), who did all the actual work of triaging and debugging. base-commit: 6769ea8da8a93ed4630f1ce64df6aafcaabfce64

Fixed versions

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

PackageEcosystemFixed in
kernel-headersAmazon Linux6.1.84-99.169.amzn2023
kernel-livepatch-6.1.84-99.169Amazon Linux1.0-0.amzn2023
bpftoolAmazon Linux6.1.84-99.169.amzn2023
kernel-libbpfAmazon Linux6.1.84-99.169.amzn2023
kernelAmazon Linux6.1.84-99.169.amzn2023
perfAmazon Linux6.1.84-99.169.amzn2023
python3-perfAmazon Linux6.1.84-99.169.amzn2023
kernel-develAmazon Linux6.1.84-99.169.amzn2023
linux_kernellinux6.7.12, 6.6.24, 6.1.84, 5.18, 5.15.154

Risk scores

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

Affected products

VendorProductVersions
LinuxLinuxd97c0667c1e61ded6639117b4b9584a9c12b7e66, 1c2361f667f3648855ceae25f1332c18413fdb9f, 1c2361f667f3648855ceae25f1332c18413fdb9f
LinuxLinux5.19, 0, 5.15.154
amazon:2023kernel-headers0
amazon:2023kernel-livepatch-6.1.84-99.1690
amazon:2023bpftool0
amazon:2023kernel-libbpf0
amazon:2023kernel0
amazon:2023perf0
amazon:2023python3-perf0
amazon:2023kernel-devel0
linuxlinux_kernel5.15.58, 5.18.2, 5.19
LinuxLinux5.18.2, 6.6.24, 6.7.12
amazon:2023kernel-libbpf-devel0
amazon:2023kernel-libbpf-static0
amazon:2023kernel-tools-devel0
amazon:2023kernel-tools0
amazon:2023kernel-modules-extra0
amazon:2023kernel-modules-extra-common0

Timeline

  • May 17, 2024 CVE Published
  • May 18, 2024 EPSS Score (30 in total, the first dated here)
  • Oct 4, 2024 Coalition ESS Score (5 in total, the first dated here)
  • Jan 10, 2026 Security Advisory (442 in total, the first dated here)
  • Mar 30, 2026 Distribution Patch (337 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-35804
vulnetix vdb fixes CVE-2024-35804

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-35804/fixes/registry"

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

References

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