{"id":"CVE-2026-31589","summary":"mm: call -\u003efree_folio() directly in folio_unmap_invalidate()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: call -\u003efree_folio() directly in folio_unmap_invalidate()\n\nWe can only call filemap_free_folio() if we have a reference to (or hold a\nlock on) the mapping.  Otherwise, we've already removed the folio from the\nmapping so it no longer pins the mapping and the mapping can be removed,\ncausing a use-after-free when accessing mapping-\u003ea_ops.\n\nFollow the same pattern as __remove_mapping() and load the free_folio\nfunction pointer before dropping the lock on the mapping.  That lets us\nmake filemap_free_folio() static as this was the only caller outside\nfilemap.c.","modified":"2026-06-18T03:55:08.951105558Z","published":"2026-04-24T14:42:16.955Z","related":["CGA-f7v9-9cp5-wxxr","openSUSE-SU-2026:10703-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31589.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/615d9bb2ccad42f9e21d837431e401db2e471195"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b667df39d98a7a24be7c2a40ff0863dac1ad2cd7"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c330e65ea59c4805d6ab6757c4ddfe8c63acef31"},{"type":"WEB","url":"https://git.kernel.org/stable/c/efc52947247a21bbf79059539bbbd40f4ea76f00"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31589.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31589"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"fb7d3bc4149395c1ae99029c852eab6c28fc3c88"},{"fixed":"efc52947247a21bbf79059539bbbd40f4ea76f00"},{"fixed":"b667df39d98a7a24be7c2a40ff0863dac1ad2cd7"},{"fixed":"c330e65ea59c4805d6ab6757c4ddfe8c63acef31"},{"fixed":"615d9bb2ccad42f9e21d837431e401db2e471195"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31589.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.14.0"},{"fixed":"6.18.27"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"6.19.14"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.20.0"},{"fixed":"7.0.1"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31589.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}