# CVE-2026-139508: ocfs2: defer suballocator block group reclaim to workqueue

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **Published:** 2026-11-30T13:35:24.017Z
- **Modified:** 2026-11-30T14:19:26.470Z

## Who should check

- Anyone running Linux \>= 4a54331616b309934d46e255a9f1fdd890e77ebe, \< 18098fed5b27427568087dc17a88d3295492bfb7; \>= 4a54331616b309934d46e255a9f1fdd890e77ebe, \< b4cc0016f8ead77c823f2d55f4e0a0e61dd924b3
- Anyone running Linux 7.0

## 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.

## Affected and fixed versions

- Linux: \>= 4a54331616b309934d46e255a9f1fdd890e77ebe, \< 18098fed5b27427568087dc17a88d3295492bfb7; \>= 4a54331616b309934d46e255a9f1fdd890e77ebe, \< b4cc0016f8ead77c823f2d55f4e0a0e61dd924b3 (cvelist)
- Linux: 7.0 (cvelist)

## Technologies

Linux kernel

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-139508. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-139508.md
Affected: Linux >= 4a54331616b309934d46e255a9f1fdd890e77ebe, < 18098fed5b27427568087dc17a88d3295492bfb7; >= 4a54331616b309934d46e255a9f1fdd890e77ebe, < b4cc0016f8ead77c823f2d55f4e0a0e61dd924b3; Linux 7.0
Fixed in: Linux 18098fed5b27427568087dc17a88d3295492bfb7

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-139508 being exploited?

There is no confirmed exploitation: CVE-2026-139508 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2026-139508?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-139508?

Linux \>= 4a54331616b309934d46e255a9f1fdd890e77ebe, \< 18098fed5b27427568087dc17a88d3295492bfb7; \>= 4a54331616b309934d46e255a9f1fdd890e77ebe, \< b4cc0016f8ead77c823f2d55f4e0a0e61dd924b3; Linux 7.0.

### Is there a fix for CVE-2026-139508?

Yes. Fixed in Linux 18098fed5b27427568087dc17a88d3295492bfb7. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-139508?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/18098fed5b27427568087dc17a88d3295492bfb7>
- other: <https://git.kernel.org/stable/c/b4cc0016f8ead77c823f2d55f4e0a0e61dd924b3>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-139508>

HTML: <https://flawdb.com/CVE-2026-139508> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-139508>
