CVE-2026-138891: ocfs2: exit recovery thread on mount error path
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: exit recovery thread on mount error path
When a mount fails after the cluster connection has been established, e.g. in ocfs2mountvolume(), ocfs2fillsuper() unwinds via outdebugfs/outsuper and frees the osb without disabling recovery.
A node failure event can concurrently launch the recovery thread, which blocks in ocfs2waitonmount() waiting for the volume state to become VOLUMEMOUNTED or VOLUMEDISABLED. As the mount error path neither sets VOLUMEDISABLED nor wakes osbmountevent, the thread can never make progress: the kthread leaks and stays blocked on the wait queue embedded in the freed osb, which may then be accessed as freed memory.
Fix it by setting VOLUMEDISABLED and waking osbmountevent on this path so the thread bails out, and replace the plain kfree(osb->recoverymap) with ocfs2recoveryexit(), which waits for a running recovery thread to exit before the recovery map is freed.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.5 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.275 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1Fixed in 7.3.4-1 - Compensating control
In the OCFS2 mount-error path, set VOLUME_DISABLED and wake osb_mount_event so the recovery thread can exit; replace kfree(osb->recovery_map) with ocfs2_recovery_exit() to wait for a running recovery thread.
Event History
Frequently Asked Questions
Under what conditions can this occur?
The issue requires an OCFS2 mount to fail after the cluster connection has already been established. A concurrent node failure event must then start the recovery thread while the failed mount is unwinding.
What is the practical impact of the failed mount path?
The recovery thread can remain permanently blocked waiting for the volume state to change, leaking the kernel thread. It may subsequently access a wait queue in an osb structure that has already been freed, creating a use-after-free condition.
How can administrators tell whether a system is affected at runtime?
A relevant symptom is a failed OCFS2 mount after cluster connection setup combined with a recovery thread that remains blocked in __ocfs2_wait_on_mount(). The description does not provide a specific log message or detection command.
What does the fix change?
The fix marks the volume as VOLUME_DISABLED and wakes osb_mount_event during the mount-error cleanup, allowing the recovery thread to exit. It also uses ocfs2_recovery_exit() so cleanup waits for any running recovery thread before freeing the recovery map.