CVE-2026-31597: ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: fix use-after-free in ocfs2fault() when VMFAULTRETRY
filemapfault() may drop the mmaplock before returning VMFAULTRETRY, as documented in mm/filemap.c:
"If our return value has VMFAULTRETRY set, it's because the mmaplock may be dropped before doing I/O or by lockfoliomaybedropmmap()."
When this happens, a concurrent munmap() can call removevma() and free the vmareastruct via RCU. The saved 'vma' pointer in ocfs2fault() then becomes a dangling pointer, and the subsequent traceocfs2fault() call dereferences it -- a use-after-free.
Fix this by saving ipblkno as a plain integer before calling filemapfault(), and removing vma from the trace event. Since ipblkno is copied by value before the lock can be dropped, it remains valid regardless of what happens to the vma or inode afterward.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-31597?
CVE-2026-31597 has been classified as having a critical severity due to the potential for data corruption and system crashes.
How do I fix CVE-2026-31597?
To remediate CVE-2026-31597, update the Linux kernel to the latest version that includes the patch for this vulnerability.
Which versions of the Linux kernel are affected by CVE-2026-31597?
CVE-2026-31597 affects specific versions of the Linux kernel that utilize the ocfs2 file system.
What vulnerabilities are associated with CVE-2026-31597?
CVE-2026-31597 is associated with a use-after-free vulnerability in the ocfs2_fault function that can lead to system instability.
Who is impacted by CVE-2026-31597?
Users of Linux systems that employ the ocfs2 file system may be impacted by CVE-2026-31597.