CVE-2024-35804 (GCVE-0-2024-35804)
Vulnerability from cvelistv5
Published
2024-05-17 13:23
Modified
2025-05-04 12:55
Severity ?
Summary
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
Impacted products
Vendor Product Version
Linux Linux Version: d97c0667c1e61ded6639117b4b9584a9c12b7e66
Version: 1c2361f667f3648855ceae25f1332c18413fdb9f
Version: 1c2361f667f3648855ceae25f1332c18413fdb9f
Version: 1c2361f667f3648855ceae25f1332c18413fdb9f
Version: 1c2361f667f3648855ceae25f1332c18413fdb9f
Version: b0f294103f4cf733e23d3f0c4e5fd58e42998921
Version: e964665cc7ca13a16992b205fce63554b9efc78b
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-35804",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-17T17:16:37.328508Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-04T17:33:56.600Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T03:21:47.342Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "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"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/kvm/x86.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "a9bd6bb6f02bf7132c1ab192ba62bbfa52df7d66",
              "status": "affected",
              "version": "d97c0667c1e61ded6639117b4b9584a9c12b7e66",
              "versionType": "git"
            },
            {
              "lessThan": "726374dde5d608b15b9756bd52b6fc283fda7a06",
              "status": "affected",
              "version": "1c2361f667f3648855ceae25f1332c18413fdb9f",
              "versionType": "git"
            },
            {
              "lessThan": "9d1b22e573a3789ed1f32033ee709106993ba551",
              "status": "affected",
              "version": "1c2361f667f3648855ceae25f1332c18413fdb9f",
              "versionType": "git"
            },
            {
              "lessThan": "225d587a073584946c05c9b7651d637bd45c0c71",
              "status": "affected",
              "version": "1c2361f667f3648855ceae25f1332c18413fdb9f",
              "versionType": "git"
            },
            {
              "lessThan": "910c57dfa4d113aae6571c2a8b9ae8c430975902",
              "status": "affected",
              "version": "1c2361f667f3648855ceae25f1332c18413fdb9f",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "b0f294103f4cf733e23d3f0c4e5fd58e42998921",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "e964665cc7ca13a16992b205fce63554b9efc78b",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/kvm/x86.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.19"
            },
            {
              "lessThan": "5.19",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.154",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.84",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.24",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.7.*",
              "status": "unaffected",
              "version": "6.7.12",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.8",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.154",
                  "versionStartIncluding": "5.15.58",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.84",
                  "versionStartIncluding": "5.19",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.24",
                  "versionStartIncluding": "5.19",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.7.12",
                  "versionStartIncluding": "5.19",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.8",
                  "versionStartIncluding": "5.19",
                  "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",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "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\u0027t 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\u0027s 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\u0027s ABI\nis that all writes are dirty logged regardless of the value written.  And\nmore importantly, that\u0027s 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"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-04T12:55:47.713Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "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"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-35804",
    "datePublished": "2024-05-17T13:23:12.895Z",
    "dateReserved": "2024-05-17T12:19:12.341Z",
    "dateUpdated": "2025-05-04T12:55:47.713Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"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\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T03:21:47.342Z\"}}, {\"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-05-23T19:01:24.653Z\"}, \"title\": \"CISA ADP Vulnrichment\"}], \"cna\": {\"title\": \"KVM: x86: Mark target gfn of emulated atomic instruction as dirty\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"d97c0667c1e6\", \"lessThan\": \"a9bd6bb6f02b\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"1c2361f667f3\", \"lessThan\": \"726374dde5d6\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"1c2361f667f3\", \"lessThan\": \"9d1b22e573a3\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"1c2361f667f3\", \"lessThan\": \"225d587a0735\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"1c2361f667f3\", \"lessThan\": \"910c57dfa4d1\", \"versionType\": \"git\"}], \"programFiles\": [\"arch/x86/kvm/x86.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.19\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"5.19\", \"versionType\": \"custom\"}, {\"status\": \"unaffected\", \"version\": \"5.15.154\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"6.1.84\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"6.1.*\"}, {\"status\": \"unaffected\", \"version\": \"6.6.24\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.7.12\", \"versionType\": \"custom\", \"lessThanOrEqual\": \"6.7.*\"}, {\"status\": \"unaffected\", \"version\": \"6.8\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"arch/x86/kvm/x86.c\"], \"defaultStatus\": \"affected\"}], \"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\"}], \"x_generator\": {\"engine\": \"bippy-a5840b7849dd\"}, \"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\u0027t 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\u0027s 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\u0027s ABI\\nis that all writes are dirty logged regardless of the value written.  And\\nmore importantly, that\u0027s 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\"}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2024-05-29T05:29:16.563Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-35804\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2024-08-02T03:21:47.342Z\", \"dateReserved\": \"2024-05-17T12:19:12.341Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-17T13:23:12.895Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…