CVE-2026-139508

ocfs2: defer suballocator block group reclaim to workqueue

Published Nov 30, 2026 CVSS n/a EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

ocfs2: defer suballocator block group reclaim to workqueue

When the last bit in a suballocator block group is freed,
_ocfs2_free_suballoc_bits() reclaims the group back to the global bitmap.
The reclaim takes inode_lock() on the global bitmap inode while running
inside the freeing transaction, adding a lock dependency of

j_trans_barrier -> global bitmap inode i_rwsem

This forms a circular dependency with paths such as
ocfs2_shutdown_local_alloc(), which take the global bitmap inode lock
before starting a transaction:

Task1 (dealloc):
ocfs2_run_deallocs
ocfs2_free_cached_blocks
ocfs2_start_trans
down_read(j_trans_barrier)
_ocfs2_free_suballoc_bits
_ocfs2_reclaim_suballoc_to_main
inode_lock(main_bm_inode) <- wait on Task2

Task2 (dismount):
ocfs2_shutdown_local_alloc
inode_lock(main_bm_inode)
ocfs2_start_trans
down_read(j_trans_barrier) <- wait on Task3

Task3 (ocfs2cmt):
ocfs2_commit_cache
down_write(j_trans_barrier) <- wait on Task1's handle
jbd2_journal_flush

Task1 waits for Task2's inode_lock(), Task2 waits for the j_trans_barrier
down_write() held by ocfs2cmt, and ocfs2cmt waits for Task1's running
transaction to commit - a real deadlock, observed with aio-stress direct
IO writes racing dismount.

Fix it by deferring the reclaim to the per-superblock ocfs2_wq workqueue,
so the freeing transaction no longer takes the global bitmap inode lock.
The worker re-checks under the suballocator locks that the block group is
still fully freed (it may have been allocated from again in the meantime),
takes the global bitmap inode locks before starting its own transaction,
and performs the same suballocator cleanup and space return. The inode
lock order (suballocator inode -> global bitmap inode) is consistent with
the existing "inode lock before transaction" order, breaking the cycle.

Reclaim work can still be queued late in dismount, e.g. when the truncate
log is flushed or orphan dir recovery frees inode bits, so both
ocfs2_dismount_volume() and the mount error path flush ocfs2_wq right
before the system inodes are released, while the journal is still alive,
to make sure no reclaim work is left running. The worker also bails out
if the journal is already gone.

Tested with the ocfs2 testsuite (including aio-stress direct IO) and
umount/mount cycles on a CONFIG_PROVE_LOCKING kernel: the circular locking
dependency is gone and freed block groups are still returned to the global
bitmap.

Analysis

AI-generated

Technical impact

The flaw occurs when the last block in an ocfs2 suballocator block group is freed during a journal transaction, causing the global bitmap inode lock to be taken within that transaction. A parallel dismount or shutdown operation holds that lock in a different order, creating a circular dependency that leads to a real deadlock. The lock ordering issue (CWE-823) stalls I/O and can prevent clean shutdown or unmount of OCFS2 volumes, resulting in a denial‑of‑service condition for applications interacting with the affected filesystem.

Affected Systems

All Linux kernels that include the OCFS2 filesystem implementation and are built with the default blocking allocator logic are affected. Any system that mounts OCFS2 volumes and performs concurrent writes while initiating a dismount, shutdown, or mount error path will experience the deadlock unless it runs a kernel that implements the workqueue deferment fix.

Risk and Exploitability

The EPSS score is below 1% and the vulnerability is not listed on CISA KEV, indicating no known public exploits as of the last update. The attack vector is local: an attacker would need privileges that allow them to launch processes that write to an OCFS2 filesystem or trigger a dismount or shutdown sequence. Because the issue is a lock ordering bug rather than a privilege escalation or code execution flaw, the primary risk is availability degradation in high‑throughput or multi‑threaded I/O scenarios.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the most recent Linux kernel update that contains the ocfs2 workqueue deferment fix.
  • If a kernel upgrade is not immediately possible, avoid running high‑rate or concurrent write traffic to OCFS2 volumes during maintenance windows and unmount those volumes well before initiating shutdown or mounts changes.
  • Continuously monitor kernel logs (e.g., dmesg or journalctl) for acronyms such as "deadlock" or "ocfs2" to detect any leftover reclamation work; ensure the ocfs2_workqueue is flushed during unmount and before the system inode cleanup.

Generated by OpenCVE AI on December 1, 2026 at 18:56 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-823
Type Values Removed Values Added
Weaknesses CWE-823
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: ocfs2: defer suballocator block group reclaim to workqueue When the last bit in a suballocator block group is freed, _ocfs2_free_suballoc_bits() reclaims the group back to the global bitmap. The reclaim takes inode_lock() on the global bitmap inode while running inside the freeing transaction, adding a lock dependency of j_trans_barrier -> global bitmap inode i_rwsem This forms a circular dependency with paths such as ocfs2_shutdown_local_alloc(), which take the global bitmap inode lock before starting a transaction: Task1 (dealloc): ocfs2_run_deallocs ocfs2_free_cached_blocks ocfs2_start_trans down_read(j_trans_barrier) _ocfs2_free_suballoc_bits _ocfs2_reclaim_suballoc_to_main inode_lock(main_bm_inode) <- wait on Task2 Task2 (dismount): ocfs2_shutdown_local_alloc inode_lock(main_bm_inode) ocfs2_start_trans down_read(j_trans_barrier) <- wait on Task3 Task3 (ocfs2cmt): ocfs2_commit_cache down_write(j_trans_barrier) <- wait on Task1's handle jbd2_journal_flush Task1 waits for Task2's inode_lock(), Task2 waits for the j_trans_barrier down_write() held by ocfs2cmt, and ocfs2cmt waits for Task1's running transaction to commit - a real deadlock, observed with aio-stress direct IO writes racing dismount. Fix it by deferring the reclaim to the per-superblock ocfs2_wq workqueue, so the freeing transaction no longer takes the global bitmap inode lock. The worker re-checks under the suballocator locks that the block group is still fully freed (it may have been allocated from again in the meantime), takes the global bitmap inode locks before starting its own transaction, and performs the same suballocator cleanup and space return. The inode lock order (suballocator inode -> global bitmap inode) is consistent with the existing "inode lock before transaction" order, breaking the cycle. Reclaim work can still be queued late in dismount, e.g. when the truncate log is flushed or orphan dir recovery frees inode bits, so both ocfs2_dismount_volume() and the mount error path flush ocfs2_wq right before the system inodes are released, while the journal is still alive, to make sure no reclaim work is left running. The worker also bails out if the journal is already gone. Tested with the ocfs2 testsuite (including aio-stress direct IO) and umount/mount cycles on a CONFIG_PROVE_LOCKING kernel: the circular locking dependency is gone and freed block groups are still returned to the global bitmap.
Title ocfs2: defer suballocator block group reclaim to workqueue
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

No weakness.

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:35 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM