CVE-2024-35804

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

8.8 high EPSS 0.24%

Published 17 May 2024 Updated 5 Aug 2026 CNA: Linux

Check your servers for CVE-2024-35804

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-35804 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.

Check my servers

Description

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

Severity (CVSS)

8.8 high CVSS 3.1 from Linux (CNA)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/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 high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.24%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 15.6% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 17 May 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.

ProductVersions
Linux
affected from d97c0667c1e61ded6639117b4b9584a9c12b7e66, before a9bd6bb6f02bf7132c1ab192ba62bbfa52df7d66
affected from 1c2361f667f3648855ceae25f1332c18413fdb9f, before 726374dde5d608b15b9756bd52b6fc283fda7a06
affected from 1c2361f667f3648855ceae25f1332c18413fdb9f, before 9d1b22e573a3789ed1f32033ee709106993ba551
affected from 1c2361f667f3648855ceae25f1332c18413fdb9f, before 225d587a073584946c05c9b7651d637bd45c0c71
affected from 1c2361f667f3648855ceae25f1332c18413fdb9f, before 910c57dfa4d113aae6571c2a8b9ae8c430975902
affected b0f294103f4cf733e23d3f0c4e5fd58e42998921
affected e964665cc7ca13a16992b205fce63554b9efc78b
affected from 5.15.58, before 5.15.154
affected from 5.17.13, before 5.18
affected from 5.18.2, before 5.19
Other versions: unaffected
Linux
affected 5.19
unaffected before 5.19
unaffected from 5.15.154 up to and including 5.15.*
unaffected from 6.1.84 up to and including 6.1.*
unaffected from 6.6.24 up to and including 6.6.*
unaffected from 6.7.12 up to and including 6.7.*
unaffected 6.8 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-35804 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-35804

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-35804
trivy image --scanners vuln IMAGE | grep CVE-2024-35804

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

Source: the record CVE-2024-35804 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.