{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "c00b6b9610991c042ff4c3153daaa3ea8522c210"
            },
            {
              "fixed": "07acce0a02ccc67e7702d9be610b729ef449874a"
            },
            {
              "fixed": "9c74c3161dd6217aae0941b83e7ac7a4b77a7901"
            },
            {
              "fixed": "ad7b8f3cfdf63a9a0d74850ff7c9b035d93968ba"
            },
            {
              "fixed": "1140b3a60d9d8a4ad32381077a8e3d3fa8f4d0bf"
            },
            {
              "fixed": "8645813dad5bb05e2ef57eda0f195f2a2072b831"
            },
            {
              "fixed": "bbeeb4a29dc4ca6ac18ab3bafa3728bc984a4cde"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "5.16.0"
            },
            {
              "fixed": "6.1.193"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.2.0"
            },
            {
              "fixed": "6.6.163"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.7.0"
            },
            {
              "fixed": "6.12.117"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.13.0"
            },
            {
              "fixed": "6.18.63"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "7.3.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138900.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mempolicy: take a cpuset cookie for the interleave node count\n\nalloc_pages_bulk_interleave() counts pol-\u003enodes without a cpuset cookie:\n\n\tnodes = nodes_weight(pol-\u003enodes);\n\tnr_pages_per_node = nr_pages / nodes;\n\nnodemask_t spans several words once MAX_NUMNODES exceeds BITS_PER_LONG, so\na concurrent cpuset rebind can tear that read and yield an empty mask even\nthough neither version of it was empty.  The call then allocates nothing\nand returns 0.\n\nSome compilers will hoist the loop entry test above the division,\nbecause nr_pages_per_node is dead when the loop does not run.\n\n\t682e:\tcall\t...\t\t\u003c- nodes_weight()\n\t6838:\ttest\t%eax,%eax\n\t683a:\tjle\t692d\t\t\u003c- nodes \u003c= 0 skips the loop\n\t684a:\tdiv\t%rcx\n\nSo in most deployments, this div/0 is unreachable - but nothing in the\nsource guarantees that, it's just not easily exercised.\n\nTake the cookie around the count and bail if the mask really is empty. \nOnly the count needs it, interleave_nodes() takes the cookie itself so so\na torn read there is already retried.\n\nA rebind landing mid-loop can still leave the count disagreeing with the\nmask, so the loop may revisit a node or skip one - but a rebind where\nnodes change causes migration, so a handful of misplaced pages isn't\ncatastrophic in any sense.\n\nMeasured on a 72 node VM (NODES_SHIFT=10) with a cgroup v2 cpuset flipping\ncpuset.mems between a word 0 and a word 1 node set, and the two word read\nartificially widened: 330 zero counts in 130414 calls without the cookie,\nand 401 retries with it.",
  "id": "CVE-2026-138900",
  "modified": "2026-11-30T14:45:33.445504373Z",
  "published": "2026-11-30T13:26:01.936Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/07acce0a02ccc67e7702d9be610b729ef449874a"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/1140b3a60d9d8a4ad32381077a8e3d3fa8f4d0bf"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/8645813dad5bb05e2ef57eda0f195f2a2072b831"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/9c74c3161dd6217aae0941b83e7ac7a4b77a7901"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ad7b8f3cfdf63a9a0d74850ff7c9b035d93968ba"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/bbeeb4a29dc4ca6ac18ab3bafa3728bc984a4cde"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138900.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-138900"
    }
  ],
  "schema_version": "1.9.2",
  "summary": "mm/mempolicy: take a cpuset cookie for the interleave node count"
}