{
  "id": "CVE-2026-63950",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-63950",
  "published_at": "2026-07-19T14:55:43.404Z",
  "title": "mm/rmap: initialize nr_pages to 1 at loop start in try_to_unmap_one",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm/rmap: initialize nr_pages to 1 at loop start in try_to_unmap_one\n\nInitialize nr_pages to 1 at the start of each loop iteration, like\nfolio_referenced_one() does.\n\nWithout this, nr_pages computed by a previous folio_unmap_pte_batch() call\ncan be reused on a later iteration that does not run\nfolio_unmap_pte_batch() again.\n\nmmap a 64K large folio with MAP_ANONYMOUS | MAP_DROPPABLE, then call\nmadvise(MADV_FREE), then make the last page device-exclusive via\nHMM_DMIRROR_EXCLUSIVE.\n\nTrigger node reclaim through sysfs.  Now, in try_to_unmap_one(), we will\nfirst clear the first 15 out of 16 entries mapping the lazyfree folio. \nThis will set nr_pages to 15.  In the next pvmw walk, this nr_pages gets\nreused on a device-exclusive pte, thus potentially corrupting folio\nrefcount/mapcount.\n\nAt the moment, I have a userspace program which can make the kernel spit\nout a trace, but the blow up is in folio_referenced_one(), because there\nare existing bugs in the interaction between device-private and rmap\n(which too I am investigating).  I did a one liner kernel change to avoid\ngoing into folio_referenced_one(), and the kernel blows up at\nfolio_remove_rmap_ptes in try_to_unmap_one which is what I wanted.\n\nNote that the bug is there not since file folio batching but lazyfree\nfolio batching, since device-exclusive only works for anonymous folios.\n\nUserspace visible effect is simply kernel crashing somewhere due to\nrefcount/mapcount corruption.",
  "cwe": "CWE-476",
  "cpes": [
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:7.1:rc1:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:7.1:rc2:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:7.1:rc3:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:7.1:rc4:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:7.1:rc5:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= 354dffd29575cdf13154e8fb787322354aa9efc4, \u003c 0fcc34d0d8fefca4fea349e45c10e3a3d90350eb",
          "\u003e= 354dffd29575cdf13154e8fb787322354aa9efc4, \u003c f611db9b771b2b6775357555d2517af044fca4f0",
          "\u003e= 354dffd29575cdf13154e8fb787322354aa9efc4, \u003c 3f8968e9cbf95d5d87d32218906cab0b9b9eddbe"
        ],
        "fixed_in": [
          "0fcc34d0d8fefca4fea349e45c10e3a3d90350eb",
          "f611db9b771b2b6775357555d2517af044fca4f0",
          "3f8968e9cbf95d5d87d32218906cab0b9b9eddbe"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "6.15"
        ],
        "fixed_in": [
          "0",
          "6.18.35",
          "7.0.12",
          "7.1"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to 0fcc34d0d8fefca4fea349e45c10e3a3d90350eb or f611db9b771b2b6775357555d2517af044fca4f0 or 3f8968e9cbf95d5d87d32218906cab0b9b9eddbe or later.",
      "Upgrade Linux to 0 or 6.18.35 or 7.0.12 or 7.1 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
