CVE-2026-99336 (GCVE-0-2026-99336)

Vulnerability from cvelistv5 – Published: 2026-11-19 14:21 – Updated: 2026-11-22 11:07
VLAI
Title
KVM: guest_memfd: take the invalidate lock when unbinding a dying file
Summary
In the Linux kernel, the following vulnerability has been resolved: KVM: guest_memfd: take the invalidate lock when unbinding a dying file kvm_gmem_unbind() takes mapping->invalidate_lock only if the get_file_active() succeeds. When the guest_memfd file is dying, its reference count is already zero so get_file_active fails and the binding is removed without holding the invalidate lock. kvm_gmem_invalidate_{start,end}() checks f->bindings independently to decide whether to begin or end KVM MMU invalidation. So, the bindings must therefore remain stable between the two calls. Otherwise, unbind can remove a binding after start increments mmu_invalidate_in_progress, but before end finds the binding and decrements it. Example, unbind race with memory failure: CPU 0: memory failure CPU 1: memslot delete ---------------------------------- --------------------------- (guest_memfd file is dying) kvm_gmem_error_folio() kvm_gmem_invalidate_start() finds binding mmu_invalidate_in_progress++ kvm_gmem_unbind() get_file_active() fails removes binding kvm_gmem_invalidate_end() no binding found counter stays elevated mmu_invalidate_retry() then returns 1 forever, so guest page faults retry without ever installing a mapping and the guest hangs. Remove the distinction between live and dying files in the unbind path. Always use slot->gmem.file and take the invalidate lock when it's non-NULL. Normal unbind callers hold slots_lock, which prevents release from clearing the pointer or freeing the file state until unbind completes. Final VM teardown can only see a NULL pointer because guest_memfd pins the KVM until release has cleared all bindings.
Assigner
Linux CNA under the mitre root
CNA scorecard D 52/100 over 8648 records in the last 180 days details
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: a8ac2bd0f98e1a230f1eb3260fa552bf2ef1753b , < 4ae4316682cdc78d8f5a856ab0712a8281f211ca (git)
Affected: ae431059e75d36170a5ae6b44cc4d06d43613215 , < 3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a (git)
Affected: ae431059e75d36170a5ae6b44cc4d06d43613215 , < 024be82ac4c4df650cc6daca6d7db79daee95470 (git)
Affected: ae431059e75d36170a5ae6b44cc4d06d43613215 , < 0ee2c883b62deb74d8c43007e8049dc006d3a2fb (git)
Affected: 393893693a523e053f84d69320d090b93503f79f (git)
Affected: 6.12.59 , < 6.12.118 (semver)
Affected: 6.17.9 , < 6.18 (semver)
guessed Create a notification for this product.
Linux Linux Affected: 6.18
Unaffected: 0 , < 6.18 (semver)
Unaffected: 6.12.118 , ≤ 6.12.* (semver)
Unaffected: 6.18.64 , ≤ 6.18.* (semver)
Unaffected: 7.3.2 , ≤ 7.3.* (semver)
Unaffected: 7.4-rc1 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "virt/kvm/guest_memfd.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "4ae4316682cdc78d8f5a856ab0712a8281f211ca",
              "status": "affected",
              "version": "a8ac2bd0f98e1a230f1eb3260fa552bf2ef1753b",
              "versionType": "git"
            },
            {
              "lessThan": "3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a",
              "status": "affected",
              "version": "ae431059e75d36170a5ae6b44cc4d06d43613215",
              "versionType": "git"
            },
            {
              "lessThan": "024be82ac4c4df650cc6daca6d7db79daee95470",
              "status": "affected",
              "version": "ae431059e75d36170a5ae6b44cc4d06d43613215",
              "versionType": "git"
            },
            {
              "lessThan": "0ee2c883b62deb74d8c43007e8049dc006d3a2fb",
              "status": "affected",
              "version": "ae431059e75d36170a5ae6b44cc4d06d43613215",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "393893693a523e053f84d69320d090b93503f79f",
              "versionType": "git"
            },
            {
              "lessThan": "6.12.118",
              "status": "affected",
              "version": "6.12.59",
              "versionType": "semver"
            },
            {
              "lessThan": "6.18",
              "status": "affected",
              "version": "6.17.9",
              "versionType": "semver"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "virt/kvm/guest_memfd.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.18"
            },
            {
              "lessThan": "6.18",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.118",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.18.*",
              "status": "unaffected",
              "version": "6.18.64",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "7.3.*",
              "status": "unaffected",
              "version": "7.3.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "7.4-rc1",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.118",
                  "versionStartIncluding": "6.12.59",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18.64",
                  "versionStartIncluding": "6.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "7.3.2",
                  "versionStartIncluding": "6.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "7.4-rc1",
                  "versionStartIncluding": "6.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionStartIncluding": "6.17.9",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: guest_memfd: take the invalidate lock when unbinding a dying file\n\nkvm_gmem_unbind() takes mapping-\u003einvalidate_lock only if the\nget_file_active() succeeds. When the guest_memfd file is dying, its\nreference count is already zero so get_file_active fails and the binding\nis removed without holding the invalidate lock.\n\nkvm_gmem_invalidate_{start,end}() checks f-\u003ebindings independently to\ndecide whether to begin or end KVM MMU invalidation. So, the bindings\nmust therefore remain stable between the two calls. Otherwise, unbind\ncan remove a binding after start increments mmu_invalidate_in_progress,\nbut before end finds the binding and decrements it.\nExample, unbind race with memory failure:\n\n  CPU 0: memory failure               CPU 1: memslot delete\n  ----------------------------------  ---------------------------\n                                      (guest_memfd file is dying)\n  kvm_gmem_error_folio()\n    kvm_gmem_invalidate_start()\n      finds binding\n      mmu_invalidate_in_progress++\n                                      kvm_gmem_unbind()\n                                        get_file_active() fails\n                                        removes binding\n    kvm_gmem_invalidate_end()\n      no binding found\n      counter stays elevated\n\nmmu_invalidate_retry() then returns 1 forever, so guest page faults\nretry without ever installing a mapping and the guest hangs.\n\nRemove the distinction between live and dying files in the unbind path.\nAlways use slot-\u003egmem.file and take the invalidate lock when it\u0027s non-NULL.\nNormal unbind callers hold slots_lock, which prevents release from clearing\nthe pointer or freeing the file state until unbind completes. Final VM\nteardown can only see a NULL pointer because guest_memfd pins the KVM until\nrelease has cleared all bindings."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - kvm_gmem_unbind() runs only from kvm_free_memslot() when KVM_SET_USER_MEMORY_REGION deletes a slot (kvm_vm_ioctl -\u003e kvm_vm_ioctl_set_memory_region -\u003e kvm_set_memslot -\u003e kvm_commit_memory_region). The racer, kvm_gmem_error_folio(), is entered from memory_failure(), not from a remote protocol message.\nAC:H - The invalidate lock is skipped only after get_file_active() fails on a dying guest_memfd, and the bad window is kvm_gmem_invalidate_start() through kvm_gmem_invalidate_end() in kvm_gmem_error_folio(). That callback runs only from memory_failure() on an ECC/MCE the attacker cannot schedule.\nPR:L - kvm_vm_ioctl() accepts KVM_CREATE_GUEST_MEMFD and KVM_SET_USER_MEMORY_REGION after checking only that kvm-\u003emm equals current-\u003emm. A user who can open /dev/kvm can create the guest_memfd, close it, and delete the slot; CAP_SYS_ADMIN is not checked.\nUI:N - The process that owns the VM fd closes the guest_memfd and issues the memslot deletion itself. No other user has to mount, open, or approve anything.\nS:U - The stuck kvm-\u003emmu_invalidate_in_progress counter and the freed kvm_memory_slot belong to the host KVM instance the caller already controls via the VM fd. The guest cannot invoke kvm_gmem_unbind(), so this does not cross a guest/host boundary.\nC:H - kvm_free_memslot() kfree()s the slot as soon as the unlocked kvm_gmem_unbind() returns, while kvm_gmem_invalidate_start() can still be in kvm_unmap_gfn_range() reading slot-\u003eas_id and, once shadow roots exist, gfn_to_rmap() on slot-\u003earch.rmap[]. Reclaiming that object exposes those reads.\nI:H - With shadow rmaps allocated, gfn_to_rmap() indexes slot-\u003earch.rmap[] and kvm_zap_rmap() writes through that pointer while kvm_unmap_gfn_range() still holds the slot kvm_free_memslot() has kfree\u0027d. Reclaiming the slab is a kernel write primitive.\nA:H - If kvm_gmem_invalidate_end() no longer finds the binding, mmu_invalidate_in_progress stays non-zero and mmu_invalidate_retry() returns 1 forever, so faults in gmem_abort() re-enter the guest with no mapping and the vCPU livelocks. The slot use-after-free can also oops the host."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-11-22T11:07:43.269Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/4ae4316682cdc78d8f5a856ab0712a8281f211ca"
        },
        {
          "url": "https://git.kernel.org/stable/c/3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a"
        },
        {
          "url": "https://git.kernel.org/stable/c/024be82ac4c4df650cc6daca6d7db79daee95470"
        },
        {
          "url": "https://git.kernel.org/stable/c/0ee2c883b62deb74d8c43007e8049dc006d3a2fb"
        }
      ],
      "title": "KVM: guest_memfd: take the invalidate lock when unbinding a dying file",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2026-99336",
    "datePublished": "2026-11-19T14:21:42.304Z",
    "dateReserved": "2026-09-25T10:25:14.408Z",
    "dateUpdated": "2026-11-22T11:07:43.269Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2026-99336",
      "date": "2026-12-04",
      "epss": "0.00165",
      "percentile": "0.0591"
    },
    "microsoft_vex": {
      "current_release_date": "2026-11-24T01:35:19.000Z",
      "cve": "CVE-2026-99336",
      "id": "msrc_CVE-2026-99336",
      "initial_release_date": "2026-11-20T01:09:28.000Z",
      "product_status:fixed": "1",
      "product_status:known_affected": "1",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "KVM: guest_memfd: take the invalidate lock when unbinding a dying file",
      "url": "https://msrc.microsoft.com/csaf/vex/2026/msrc_cve-2026-99336.json",
      "version": "3"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "virt/kvm/guest_memfd.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "4ae4316682cdc78d8f5a856ab0712a8281f211ca",
                    "status": "affected",
                    "version": "a8ac2bd0f98e1a230f1eb3260fa552bf2ef1753b",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a",
                    "status": "affected",
                    "version": "ae431059e75d36170a5ae6b44cc4d06d43613215",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "024be82ac4c4df650cc6daca6d7db79daee95470",
                    "status": "affected",
                    "version": "ae431059e75d36170a5ae6b44cc4d06d43613215",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "0ee2c883b62deb74d8c43007e8049dc006d3a2fb",
                    "status": "affected",
                    "version": "ae431059e75d36170a5ae6b44cc4d06d43613215",
                    "versionType": "git"
                  },
                  {
                    "status": "affected",
                    "version": "393893693a523e053f84d69320d090b93503f79f",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "6.12.118",
                    "status": "affected",
                    "version": "6.12.59",
                    "versionType": "semver"
                  },
                  {
                    "lessThan": "6.18",
                    "status": "affected",
                    "version": "6.17.9",
                    "versionType": "semver"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "virt/kvm/guest_memfd.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "6.18"
                  },
                  {
                    "lessThan": "6.18",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.12.*",
                    "status": "unaffected",
                    "version": "6.12.118",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.18.*",
                    "status": "unaffected",
                    "version": "6.18.64",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "7.3.*",
                    "status": "unaffected",
                    "version": "7.3.2",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "7.4-rc1",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: guest_memfd: take the invalidate lock when unbinding a dying file\n\nkvm_gmem_unbind() takes mapping-\u003einvalidate_lock only if the\nget_file_active() succeeds. When the guest_memfd file is dying, its\nreference count is already zero so get_file_active fails and the binding\nis removed without holding the invalidate lock.\n\nkvm_gmem_invalidate_{start,end}() checks f-\u003ebindings independently to\ndecide whether to begin or end KVM MMU invalidation. So, the bindings\nmust therefore remain stable between the two calls. Otherwise, unbind\ncan remove a binding after start increments mmu_invalidate_in_progress,\nbut before end finds the binding and decrements it.\nExample, unbind race with memory failure:\n\n  CPU 0: memory failure               CPU 1: memslot delete\n  ----------------------------------  ---------------------------\n                                      (guest_memfd file is dying)\n  kvm_gmem_error_folio()\n    kvm_gmem_invalidate_start()\n      finds binding\n      mmu_invalidate_in_progress++\n                                      kvm_gmem_unbind()\n                                        get_file_active() fails\n                                        removes binding\n    kvm_gmem_invalidate_end()\n      no binding found\n      counter stays elevated\n\nmmu_invalidate_retry() then returns 1 forever, so guest page faults\nretry without ever installing a mapping and the guest hangs.\n\nRemove the distinction between live and dying files in the unbind path.\nAlways use slot-\u003egmem.file and take the invalidate lock when it\u0027s non-NULL.\nNormal unbind callers hold slots_lock, which prevents release from clearing\nthe pointer or freeing the file state until unbind completes. Final VM\nteardown can only see a NULL pointer because guest_memfd pins the KVM until\nrelease has cleared all bindings."
          }
        ],
        "id": "CVE-2026-99336",
        "lastModified": "2026-11-22T11:16:47.793",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "HIGH",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.0,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.0,
              "impactScore": 5.9,
              "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
              "type": "Secondary"
            }
          ]
        },
        "published": "2026-11-19T15:17:44.610",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/024be82ac4c4df650cc6daca6d7db79daee95470"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/0ee2c883b62deb74d8c43007e8049dc006d3a2fb"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/4ae4316682cdc78d8f5a856ab0712a8281f211ca"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Received"
      }
    },
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-11-26T03:52:24+00:00",
      "cve": "CVE-2026-99336",
      "id": "CVE-2026-99336",
      "initial_release_date": "2026-11-19T14:21:42.304000+00:00",
      "product_status:known_not_affected": "280",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: kernel: Denial of Service via race condition in KVM guest memory unbinding",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-99336.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.