CVE-2026-31597
HighIn the Linux kernel, the following vulnerability has been resolved: ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY filemap_fault() may drop the mmap_lock before returning VM_FAULT_RETRY, as documented in mm/filemap.c: "If our return value has VM_FAULT_RETRY set, it's because the mmap_lock may be dropped before doing I/O or by lock_folio_maybe_drop_mmap()." When this happens, a concurrent munmap() can call remove_vma() and free the vm_area_struct via RCU. The saved 'vma' pointer in ocfs2_fault() then becomes a dangling pointer, and the subsequent trace_ocfs2_fault() call dereferences it -- a use-after-free. Fix this by saving ip_blkno as a plain integer before calling filemap_fault(), and removing vma from the trace event. Since ip_blkno is copied by value before the lock can be dropped, it remains valid regardless of what happens to the vma or inode afterward.
CVSS 3.1 score
7.8
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness type
CWE-416CVE-2026-31597 is a Use After Free vulnerability
What is Use After Free?
The product references memory after it has been freed, which may cause it to crash, use unexpected values, or execute code. Learn more on MITRE CWE
Affected versions
Linux kernel versions
2.6.39
and later are affected. Fixed in
5.10.258,
5.15.209,
6.1.175,
6.6.136,
6.12.83,
6.18.24,
6.19.14,
7.0.1,
7.1-rc1
and their respective stable series.
References
The following references provide additional information about CVE-2026-31597 including vendor advisories, patch commits, exploit details, and third-party analysis. Links are sourced from the NIST NVD database.
-
PatchKernel patch commithttps://git.kernel.org/stable/c/35c2c05261d6f6d84aaa1355afa201d507943e76
-
PatchKernel patch commithttps://git.kernel.org/stable/c/36539c4d536f851a3b346a6ebb27b51bc3d77a94
-
PatchKernel patch commithttps://git.kernel.org/stable/c/3f5e74b5db9353b01ed50f4de84e75b755f8fbc2
Frequently asked questions
-
What is CVE-2026-31597?
CVE-2026-31597 is a High severity Linux kernel vulnerability with a CVSS score of 7.8 out of 10 , classified as an Use After Free flaw (CWE-416) . It affects Linux kernel versions from 2.6.39 onward and has been patched in 5.10.258, 5.15.209, 6.1.175 and others. CVE-2026-31597 has not been confirmed as actively exploited and is not listed in the CISA KEV catalog.
-
What is the CVSS score for CVE-2026-31597?
CVE-2026-31597 has a CVSS score of 7.8 out of 10, rated High severity (CVSS 3.1). The vector string is
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. -
Is there a patch available for CVE-2026-31597?
Yes — CVE-2026-31597 has been patched. Fixed versions include 5.10.258, 5.15.209, 6.1.175 and others. If you are running Linux kernel 2.6.39 or later up to the fix versions, apply the relevant patch for your kernel branch.
-
Is CVE-2026-31597 actively exploited?
No — CVE-2026-31597 has not been confirmed as actively exploited. It is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
-
What is Use After Free (CWE-416)?
The product references memory after it has been freed, which may cause it to crash, use unexpected values, or execute code. View CWE-416 on MITRE CWE →