CVE-2026-31597

ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY

7.8 high EPSS 0.13%

Published 24 Apr 2026 Updated 5 Aug 2026 CNA: Linux

Check your servers for CVE-2026-31597

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2026-31597 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

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.

Severity (CVSS)

7.8 high CVSS 3.1 from Linux (CNA)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.13%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 3.03% of all scored CVEs. Scores of 1 Dec 2026.

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from 614a9e849ca6ea24843795251cb30af525d5336b, before 36539c4d536f851a3b346a6ebb27b51bc3d77a94
affected from 614a9e849ca6ea24843795251cb30af525d5336b, before 35c2c05261d6f6d84aaa1355afa201d507943e76
affected from 614a9e849ca6ea24843795251cb30af525d5336b, before 3f5e74b5db9353b01ed50f4de84e75b755f8fbc2
affected from 614a9e849ca6ea24843795251cb30af525d5336b, before 6f072daefcab1d84ce37c073645615f63be91006
affected from 614a9e849ca6ea24843795251cb30af525d5336b, before 4cf2768a0291a0cdd0dae801ea0eafa3878a349d
affected from 614a9e849ca6ea24843795251cb30af525d5336b, before d45ff441b416d4aa1af72b1db23d959601c04da2
affected from 614a9e849ca6ea24843795251cb30af525d5336b, before 76a602fdbb78dd05b2da06f74a988cebc97e82d0
affected from 614a9e849ca6ea24843795251cb30af525d5336b, before 925bf22c1b823e231b1baea761fe8a1512e442f2
affected from 614a9e849ca6ea24843795251cb30af525d5336b, before 7de554cabf160e331e4442e2a9ad874ca9875921
Other versions: unaffected
Linux
affected 2.6.39
unaffected before 2.6.39
unaffected from 5.10.258 up to and including 5.10.*
unaffected from 5.15.209 up to and including 5.15.*
unaffected from 6.1.175 up to and including 6.1.*
unaffected from 6.6.136 up to and including 6.6.*
unaffected from 6.12.83 up to and including 6.12.*
unaffected from 6.18.24 up to and including 6.18.*
unaffected from 6.19.14 up to and including 6.19.*
unaffected from 7.0.1 up to and including 7.0.*
unaffected 7.1 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2026-31597 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2026-31597

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2026-31597
trivy image --scanners vuln IMAGE | grep CVE-2026-31597

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2026-31597 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.