{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-35804","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2024-05-17T12:19:12.341Z","datePublished":"2024-05-17T13:23:12.895Z","dateUpdated":"2026-08-05T11:30:02.623Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T11:30:02.623Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: x86: Mark target gfn of emulated atomic instruction as dirty\n\nWhen emulating an atomic access on behalf of the guest, mark the target\ngfn dirty if the CMPXCHG by KVM is attempted and doesn't fault.  This\nfixes a bug where KVM effectively corrupts guest memory during live\nmigration by writing to guest memory without informing userspace that the\npage is dirty.\n\nMarking the page dirty got unintentionally dropped when KVM's emulated\nCMPXCHG was converted to do a user access.  Before that, KVM explicitly\nmapped the guest page into kernel memory, and marked the page dirty during\nthe unmap phase.\n\nMark the page dirty even if the CMPXCHG fails, as the old data is written\nback on failure, i.e. the page is still written.  The value written is\nguaranteed to be the same because the operation is atomic, but KVM's ABI\nis that all writes are dirty logged regardless of the value written.  And\nmore importantly, that's what KVM did before the buggy commit.\n\nHuge kudos to the folks on the Cc list (and many others), who did all the\nactual work of triaging and debugging.\n\nbase-commit: 6769ea8da8a93ed4630f1ce64df6aafcaabfce64"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","baseScore":8.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - Reaching `emulator_cmpxchg_emulated()` requires executing instructions inside a guest on the affected host — a locked RMW against a write-tracked/emulated gfn — which is local code execution on the vulnerable component, not a network-delivered input. No remote protocol handler in the host reaches this path.\nAC:L - The missing dirty-marking is unconditional and deterministic — no race, no timing window, and no dependence on memory layout the attacker cannot influence; every emulated atomic write during dirty logging is silently dropped. Live migration and dirty-ring/framebuffer dirty tracking are routine, automated, recurring operations in cloud and virtualization deployments, so an attacker running a shadow-paged or nested workload only has to keep it running for the corruption to occur, and Google observed the defect in ordinary production migrations.\nPR:L - From the host KVM's perspective the attacker only needs the ability to run code in a guest, which is a low-privileged position on the vulnerable component. Inside the guest even an unprivileged CPL=3 process suffices, because the guest kernel performs the locked page-table RMWs (`ptep_test_and_clear_young`, `ptep_get_and_clear`, COW/mprotect/fork updates) on its behalf, and those PTE pages are exactly the write-tracked gfns routed to the emulator.\nUI:N - No victim action is needed — dirty logging is enabled by the orchestrator or device model automatically (host maintenance/rebalancing migrations, dirty-ring checkpointing, framebuffer tracking), with no human in the loop. Once logging is active, the guest's own execution triggers the lost write with no cooperation from anyone else.\nS:C - The defect lives in the host kernel's KVM module, but the damage is realized entirely in a different security authority — the guest VM's memory, governed by the guest OS — and lets a low-privileged guest context cause corruption of guest-kernel and other-process memory it could never write directly. The write also escapes the host's dirty-tracking ABI, so state changes cross out of the host hypervisor's accounting boundary into the guest.\nC:H - The pages funneled through this path are predominantly write-tracked guest page tables, so a dropped update leaves the migrated guest with a stale PTE that still maps a physical page since reassigned to another process or the kernel, yielding an arbitrary-read window across intra-guest boundaries. Any page whose emulated atomic write is lost also retains its previous contents into a new owner's security context, exposing data the new owner should never see.\nI:H - Guest memory is silently corrupted: writes the guest architecturally committed are reverted on the migrated VM, which for page-table pages is a rollback of mapping and permission state (write-protect and accessed/dirty bits) into an arbitrary-write primitive over other processes' or the kernel's memory. KVM's own commit message describes this as KVM \"effectively corrupting guest memory,\" and the same rollback can revert security-relevant guest state such as reference counts, lock words, and credential structures.\nA:H - A migrated guest resuming with inconsistent memory — particularly stale page tables or reverted kernel data structures — panics, hangs, or corrupts its filesystem, taking down the entire VM and every workload on it. The corruption is silent and unrecoverable after the fact, since the source VM is discarded once migration completes."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/x86.c"],"versions":[{"version":"d97c0667c1e61ded6639117b4b9584a9c12b7e66","lessThan":"a9bd6bb6f02bf7132c1ab192ba62bbfa52df7d66","status":"affected","versionType":"git"},{"version":"1c2361f667f3648855ceae25f1332c18413fdb9f","lessThan":"726374dde5d608b15b9756bd52b6fc283fda7a06","status":"affected","versionType":"git"},{"version":"1c2361f667f3648855ceae25f1332c18413fdb9f","lessThan":"9d1b22e573a3789ed1f32033ee709106993ba551","status":"affected","versionType":"git"},{"version":"1c2361f667f3648855ceae25f1332c18413fdb9f","lessThan":"225d587a073584946c05c9b7651d637bd45c0c71","status":"affected","versionType":"git"},{"version":"1c2361f667f3648855ceae25f1332c18413fdb9f","lessThan":"910c57dfa4d113aae6571c2a8b9ae8c430975902","status":"affected","versionType":"git"},{"version":"b0f294103f4cf733e23d3f0c4e5fd58e42998921","status":"affected","versionType":"git"},{"version":"e964665cc7ca13a16992b205fce63554b9efc78b","status":"affected","versionType":"git"},{"version":"5.15.58","lessThan":"5.15.154","status":"affected","versionType":"semver"},{"version":"5.17.13","lessThan":"5.18","status":"affected","versionType":"semver"},{"version":"5.18.2","lessThan":"5.19","status":"affected","versionType":"semver"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/x86.c"],"versions":[{"version":"5.19","status":"affected"},{"version":"0","lessThan":"5.19","status":"unaffected","versionType":"semver"},{"version":"5.15.154","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.84","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.24","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.7.12","lessThanOrEqual":"6.7.*","status":"unaffected","versionType":"semver"},{"version":"6.8","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15.58","versionEndExcluding":"5.15.154"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.1.84"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.6.24"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.7.12"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.17.13"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18.2"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/a9bd6bb6f02bf7132c1ab192ba62bbfa52df7d66"},{"url":"https://git.kernel.org/stable/c/726374dde5d608b15b9756bd52b6fc283fda7a06"},{"url":"https://git.kernel.org/stable/c/9d1b22e573a3789ed1f32033ee709106993ba551"},{"url":"https://git.kernel.org/stable/c/225d587a073584946c05c9b7651d637bd45c0c71"},{"url":"https://git.kernel.org/stable/c/910c57dfa4d113aae6571c2a8b9ae8c430975902"}],"title":"KVM: x86: Mark target gfn of emulated atomic instruction as dirty","x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-35804","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-05-17T17:16:37.328508Z"}}}],"providerMetadata":{"orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP","dateUpdated":"2024-06-04T17:33:56.600Z"}},{"providerMetadata":{"orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE","dateUpdated":"2024-08-02T03:21:47.342Z"},"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/a9bd6bb6f02bf7132c1ab192ba62bbfa52df7d66","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/726374dde5d608b15b9756bd52b6fc283fda7a06","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/9d1b22e573a3789ed1f32033ee709106993ba551","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/225d587a073584946c05c9b7651d637bd45c0c71","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/910c57dfa4d113aae6571c2a8b9ae8c430975902","tags":["x_transferred"]}]}]}}