{"id":"CVE-2024-35804","aliases":["CVE-2024-35804"],"related":[],"kind":"vulnerability","state":"published","title":"KVM: x86: Mark target gfn of emulated atomic instruction as dirty","summary":"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","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: KVM: x86: marcar el gfn de destino de la instrucción atómica emulada como sucia Al emular un acceso atómico en nombre del invitado, marque el gfn de destino como sucio si se intenta realizar el CMPXCHG por KVM y no falla. Esto corrige un error por el cual KVM corrompe efectivamente la memoria del invitado durante la migración en vivo al escribir en la memoria del invitado sin informar al espacio de usuario que la página está sucia. Marcar la página como sucia se eliminó involuntariamente cuando el CMPXCHG emulado de KVM se convirtió para realizar un acceso de usuario. Antes de eso, KVM asignaba explícitamente la página invitada a la memoria del kernel y marcaba la página como sucia durante la fase de desasignación. Marque la página como sucia incluso si CMPXCHG falla, ya que los datos antiguos se vuelven a escribir en caso de fallo, es decir, la página aún está escrita. Se garantiza que el valor escrito será el mismo porque la operación es atómica, pero la ABI de KVM es que todas las escrituras se registran de forma sucia independientemente del valor escrito. Y lo que es más importante, eso es lo que hizo KVM antes de la confirmación del error. Felicitaciones enormes a las personas en la lista Cc (y a muchos otros), que hicieron todo el trabajo de clasificación y depuración. confirmación base: 6769ea8da8a93ed4630f1ce64df6aafcaabfce64","source":"nvd"}],"published":"2024-05-17T13:23:12.895Z","modified":"2026-08-05T11:30:02.623Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-401"],"affected":[{"ranges":[{"type":"git","introduced":"d97c0667c1e61ded6639117b4b9584a9c12b7e66","fixed":"a9bd6bb6f02bf7132c1ab192ba62bbfa52df7d66","status":"affected"},{"type":"git","introduced":"1c2361f667f3648855ceae25f1332c18413fdb9f","fixed":"726374dde5d608b15b9756bd52b6fc283fda7a06","status":"affected"},{"type":"git","introduced":"1c2361f667f3648855ceae25f1332c18413fdb9f","fixed":"9d1b22e573a3789ed1f32033ee709106993ba551","status":"affected"},{"type":"git","introduced":"1c2361f667f3648855ceae25f1332c18413fdb9f","fixed":"225d587a073584946c05c9b7651d637bd45c0c71","status":"affected"},{"type":"git","introduced":"1c2361f667f3648855ceae25f1332c18413fdb9f","fixed":"910c57dfa4d113aae6571c2a8b9ae8c430975902","status":"affected"},{"type":"git","version":"b0f294103f4cf733e23d3f0c4e5fd58e42998921","status":"affected"},{"type":"git","version":"e964665cc7ca13a16992b205fce63554b9efc78b","status":"affected"},{"type":"semver","introduced":"5.15.58","fixed":"5.15.154","status":"affected"},{"type":"semver","introduced":"5.17.13","fixed":"5.18","status":"affected"},{"type":"semver","introduced":"5.18.2","fixed":"5.19","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.19","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.19","status":"unaffected"},{"type":"semver","introduced":"5.15.154","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.84","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.24","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.7.12","lastAffected":"6.7.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.8","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.15.58","fixed":"5.15.154"},{"status":"affected","introduced":"5.17.13","fixed":"5.18"},{"status":"affected","introduced":"5.18.2","fixed":"6.1.84"},{"status":"affected","introduced":"6.2","fixed":"6.6.24"},{"status":"affected","introduced":"6.7","fixed":"6.7.12"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/a9bd6bb6f02bf7132c1ab192ba62bbfa52df7d66","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/726374dde5d608b15b9756bd52b6fc283fda7a06","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9d1b22e573a3789ed1f32033ee709106993ba551","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/225d587a073584946c05c9b7651d637bd45c0c71","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/910c57dfa4d113aae6571c2a8b9ae8c430975902","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-05-17T17:16:37.328Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-35804","url":"https://www.cve.org/CVERecord?id=CVE-2024-35804","licence":"CVE Terms of Use","modified":"2026-08-05T11:30:02.623Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-35804","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35804","licence":"Public domain","modified":"2026-08-04T11:17:54.413Z"}],"updatedAt":"2026-11-25T22:58:40.517Z","epss":{"score":0.00236,"percentile":0.15603,"date":"2026-12-02T12:00:21.000Z"}}