CVE-2024-35804
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.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel-headers | Amazon Linux | 6.1.84-99.169.amzn2023 |
| kernel-livepatch-6.1.84-99.169 | Amazon Linux | 1.0-0.amzn2023 |
| bpftool | Amazon Linux | 6.1.84-99.169.amzn2023 |
| kernel-libbpf | Amazon Linux | 6.1.84-99.169.amzn2023 |
| kernel | Amazon Linux | 6.1.84-99.169.amzn2023 |
| perf | Amazon Linux | 6.1.84-99.169.amzn2023 |
| python3-perf | Amazon Linux | 6.1.84-99.169.amzn2023 |
| kernel-devel | Amazon Linux | 6.1.84-99.169.amzn2023 |
| linux_kernel | linux | 6.7.12, 6.6.24, 6.1.84, 5.18, 5.15.154 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | d97c0667c1e61ded6639117b4b9584a9c12b7e66, 1c2361f667f3648855ceae25f1332c18413fdb9f, 1c2361f667f3648855ceae25f1332c18413fdb9f |
| Linux | Linux | 5.19, 0, 5.15.154 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | kernel-livepatch-6.1.84-99.169 | 0 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | python3-perf | 0 |
| amazon:2023 | kernel-devel | 0 |
| linux | linux_kernel | 5.15.58, 5.18.2, 5.19 |
| Linux | Linux | 5.18.2, 6.6.24, 6.7.12 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
| amazon:2023 | kernel-tools-devel | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
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