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 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.
Security readout for executives and security teams
Plain-English summary
A race condition in Linux's OCFS2 filesystem can leave the kernel using memory after it has been freed. A locally authenticated, low-privilege user may be able to trigger severe confidentiality, integrity, or availability impacts. Systems not using OCFS2 are unlikely to expose the vulnerable code path.
Executive priority
Treat as an expedited patching priority for multi-user or shared systems using OCFS2. Validate applicability before emergency action because exploitation is local, active exploitation is unconfirmed, and the supplied release mapping is ambiguous.
Technical view
During ocfs2_fault(), filemap_fault() may release mmap_lock and return VM_FAULT_RETRY. Concurrent munmap() can then free the referenced vm_area_struct through RCU, leaving trace_ocfs2_fault() to dereference a dangling pointer. The fix copies ip_blkno before the lock may be dropped and removes vma from the trace event.
Likely exposure
Exposure is most likely on affected Linux kernels actively using OCFS2 and permitting local low-privilege users or processes. The supplied affected-version data is not sufficiently clear for definitive package-level decisions; distribution backports may also change status.
Exploitation context
The supplied CVSS is 7.8 with local access, low complexity, and low privileges required. The bundle marks this CVE as absent from KEV and provides no evidence of active exploitation or a public exploit. Practical reliability and real-world impact are not established by these sources.
Researcher notes
The flaw is a concurrency-driven use-after-free involving mmap_lock release, VM_FAULT_RETRY, munmap(), and RCU reclamation. The supplied version list mixes release numbers with repeated commit identifiers and does not clearly map every release to a fix. Use distribution provenance and the referenced stable commits for confirmation.
Mitigation direction
Install a vendor-supported kernel containing the applicable referenced stable fix.
Consult the Linux distribution's advisory for package-specific fixed versions and backport status.
Prioritize OCFS2 systems accessible to untrusted or low-privilege local users.
Follow vendor guidance if immediate kernel replacement is operationally constrained.
Validation and detection
Inventory systems with OCFS2 configured, loaded, or actively mounted.
Record kernel and distribution package versions on identified systems.
Confirm through vendor advisories whether the fix was included or backported.
After updating, verify the corrected kernel is running following any required reboot.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2026-31597 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
10Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.