{
  "id": "CVE-2025-40272",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-40272",
  "published_at": "2025-12-06T21:50:54.629Z",
  "title": "mm/secretmem: fix use-after-free race in fault handler",
  "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/secretmem: fix use-after-free race in fault handler\n\nWhen a page fault occurs in a secret memory file created with\n`memfd_secret(2)`, the kernel will allocate a new folio for it, mark the\nunderlying page as not-present in the direct map, and add it to the file\nmapping.\n\nIf two tasks cause a fault in the same page concurrently, both could end\nup allocating a folio and removing the page from the direct map, but only\none would succeed in adding the folio to the file mapping.  The task that\nfailed undoes the effects of its attempt by (a) freeing the folio again\nand (b) putting the page back into the direct map.  However, by doing\nthese two operations in this order, the page becomes available to the\nallocator again before it is placed back in the direct mapping.\n\nIf another task attempts to allocate the page between (a) and (b), and the\nkernel tries to access it via the direct map, it would result in a\nsupervisor not-present page fault.\n\nFix the ordering to restore the direct map before the folio is freed.",
  "cvss_by_source": {
    "cna": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, \u003c bb1c19636aedae39360e6fdbcaef4f2bcff25785",
          "\u003e= 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, \u003c 1e4643d6628edf9c0047b1f8f5bc574665025acb",
          "\u003e= 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, \u003c 42d486d35a4143cc37fc72ee66edc99d942dd367",
          "\u003e= 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, \u003c 52f2d5cf33de9a8f5e72bbb0ed38282ae0bc4649",
          "\u003e= 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, \u003c 4444767e625da46009fc94a453fd1967b80ba047",
          "\u003e= 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, \u003c 6f86d0534fddfbd08687fa0f01479d4226bc3c3d"
        ],
        "fixed_in": [
          "bb1c19636aedae39360e6fdbcaef4f2bcff25785",
          "1e4643d6628edf9c0047b1f8f5bc574665025acb",
          "42d486d35a4143cc37fc72ee66edc99d942dd367",
          "52f2d5cf33de9a8f5e72bbb0ed38282ae0bc4649",
          "4444767e625da46009fc94a453fd1967b80ba047",
          "6f86d0534fddfbd08687fa0f01479d4226bc3c3d"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "5.14"
        ],
        "fixed_in": [
          "0",
          "5.15.197",
          "6.1.159",
          "6.6.117",
          "6.12.59",
          "6.17.9",
          "6.18"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to bb1c19636aedae39360e6fdbcaef4f2bcff25785 or 1e4643d6628edf9c0047b1f8f5bc574665025acb or 42d486d35a4143cc37fc72ee66edc99d942dd367 or 52f2d5cf33de9a8f5e72bbb0ed38282ae0bc4649 or 4444767e625da46009fc94a453fd1967b80ba047 or 6f86d0534fddfbd08687fa0f01479d4226bc3c3d or later.",
      "Upgrade Linux to 0 or 5.15.197 or 6.1.159 or 6.6.117 or 6.12.59 or 6.17.9 or 6.18 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
