CVE-2025-40272
mm/secretmem: fix use-after-free race in fault handler
Check your servers for CVE-2025-40272
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-40272 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
mm/secretmem: fix use-after-free race in fault handler
When a page fault occurs in a secret memory file created with `memfd_secret(2)`, the kernel will allocate a new folio for it, mark the underlying page as not-present in the direct map, and add it to the file mapping.
If two tasks cause a fault in the same page concurrently, both could end up allocating a folio and removing the page from the direct map, but only one would succeed in adding the folio to the file mapping. The task that failed undoes the effects of its attempt by (a) freeing the folio again and (b) putting the page back into the direct map. However, by doing these two operations in this order, the page becomes available to the allocator again before it is placed back in the direct mapping.
If another task attempts to allocate the page between (a) and (b), and the kernel tries to access it via the direct map, it would result in a supervisor not-present page fault.
Fix the ordering to restore the direct map before the folio is freed.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.15%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 4.69% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 15 Oct 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- total: full control of the component or of its data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before bb1c19636aedae39360e6fdbcaef4f2bcff25785 affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 1e4643d6628edf9c0047b1f8f5bc574665025acb affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 42d486d35a4143cc37fc72ee66edc99d942dd367 affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 52f2d5cf33de9a8f5e72bbb0ed38282ae0bc4649 affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 4444767e625da46009fc94a453fd1967b80ba047 affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 6f86d0534fddfbd08687fa0f01479d4226bc3c3d
Other versions: unaffected
|
| Linux |
affected 5.14 unaffected before 5.14 unaffected from 5.15.197 up to and including 5.15.* unaffected from 6.1.159 up to and including 6.1.* unaffected from 6.6.117 up to and including 6.6.* unaffected from 6.12.59 up to and including 6.12.* unaffected from 6.17.9 up to and including 6.17.* unaffected 6.18 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-40272 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-40272
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2025-40272
trivy image --scanners vuln IMAGE | grep CVE-2025-40272
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/bb1c19636aedae39360e6fdbcaef4f2bcff25785 git.kernel.org
- https://git.kernel.org/stable/c/1e4643d6628edf9c0047b1f8f5bc574665025acb git.kernel.org
- https://git.kernel.org/stable/c/42d486d35a4143cc37fc72ee66edc99d942dd367 git.kernel.org
- https://git.kernel.org/stable/c/52f2d5cf33de9a8f5e72bbb0ed38282ae0bc4649 git.kernel.org
- https://git.kernel.org/stable/c/4444767e625da46009fc94a453fd1967b80ba047 git.kernel.org
- https://git.kernel.org/stable/c/6f86d0534fddfbd08687fa0f01479d4226bc3c3d git.kernel.org
Source: the record CVE-2025-40272 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse