# CVE-2026-31589: mm: call ->free_folio() directly in folio_unmap_invalidate()

- Severity: Critical 9.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.46%, higher than 41% of CVEs (2026-12-01)
- Published: 2026-04-24T14:42:16.955Z
- Modified: 2026-11-11T23:10:00.263Z
- Weaknesses: CWE-416
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

mm: call ->free_folio() directly in folio_unmap_invalidate()

We can only call filemap_free_folio() if we have a reference to (or hold a
lock on) the mapping.  Otherwise, we've already removed the folio from the
mapping so it no longer pins the mapping and the mapping can be removed,
causing a use-after-free when accessing mapping->a_ops.

Follow the same pattern as __remove_mapping() and load the free_folio
function pointer before dropping the lock on the mapping.  That lets us
make filemap_free_folio() static as this was the only caller outside
filemap.c.

(As written by CVE List.)

## Affected

- Linux Linux: from fb7d3bc4149395c1ae99029c852eab6c28fc3c88 before efc52947247a21bbf79059539bbbd40f4ea76f00; from fb7d3bc4149395c1ae99029c852eab6c28fc3c88 before b667df39d98a7a24be7c2a40ff0863dac1ad2cd7; from fb7d3bc4149395c1ae99029c852eab6c28fc3c88 before c330e65ea59c4805d6ab6757c4ddfe8c63acef31; from fb7d3bc4149395c1ae99029c852eab6c28fc3c88 before 615d9bb2ccad42f9e21d837431e401db2e471195; 6.14 (not affected: before 6.14; from 6.18.27 up to 6.18.*; from 6.19.14 up to 6.19.*; from 7.0.1 up to 7.0.*; from 7.1 up to *)
- linux linux_kernel: from 6.14 before 6.19.14; from 7.0 before 7.0.1

## References

- <https://git.kernel.org/stable/c/efc52947247a21bbf79059539bbbd40f4ea76f00>
- <https://git.kernel.org/stable/c/b667df39d98a7a24be7c2a40ff0863dac1ad2cd7> (patch)
- <https://git.kernel.org/stable/c/c330e65ea59c4805d6ab6757c4ddfe8c63acef31> (patch)
- <https://git.kernel.org/stable/c/615d9bb2ccad42f9e21d837431e401db2e471195> (patch)

## Sources

- CVE List: [CVE-2026-31589](https://www.cve.org/CVERecord?id=CVE-2026-31589), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2026-31589](https://nvd.nist.gov/vuln/detail/CVE-2026-31589), Public domain, modified 2026-11-11

---

Page: https://cve.day/CVE-2026-31589 · Whole record: https://cve.day/CVE-2026-31589.json · Rebuilt by cve.day 2026-11-25T22:59:19.500Z
