# CVE-2026-138889: ocfs2: restrict OCFS2\_INVALID\_SLOT suballoc slot to system inodes

- Priority: **Prioritise**
- Reason: Severe, CVSS 7.5 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 04-12-2026)
- Next step: Check applicability: affected before 25bf9e549360b656a6763232e0e9e58a00c3aff7, 6.1.193, 6.12.118, 6.6.163, 9cc83c00b9b4f0e0a5842864b1a320fa63ecfc5c, af08d7bef319df99c71107e0034244168822aa42, c55809688e4abbc4474f28849deea6e5cee2684c, cef7a01a416aede5f77a84ffc6a4c606368e3d5f, de648cd4c54e659d5d212bdbe158f135569161cb (CNA); fix release not confirmed
- Status: published
- Published: 2026-11-30 · Modified: 2026-12-01
- Aliases: DEBIAN-CVE-2026-138889, UBUNTU-CVE-2026-138889
- Record: https://cvemate.com/vulnerability/CVE-2026-138889 · JSON: https://cvemate.com/vulnerability/CVE-2026-138889/json

## Description

```text
In the Linux kernel, the following vulnerability has been resolved:

ocfs2: restrict OCFS2_INVALID_SLOT suballoc slot to system inodes

Patch series "ocfs2: validate suballoc slot and bit of metadata blocks", v3.

The ocfs2 metadata validators trust the on-disk suballoc slot and bit
without checking them against the slot range of the mounted filesystem and
the capacity of the block group bitmap.  A corrupted image can carry
OCFS2_INVALID_SLOT or another out-of-range slot, or a suballoc bit beyond
the bitmap, and once the corresponding inode, extent block, xattr block,
dir index root or refcount block gets freed, the bad value goes straight
into ocfs2_get_system_file_inode() or _ocfs2_free_suballoc_bits() and hits
a BUG_ON() or runs off the end of local_system_inodes[].

This series rejects such values at read time, in the existing validators,
so corrupted objects fail with -EROFS (and a read-only remount) instead of
crashing:

  patch 1 restricts OCFS2_INVALID_SLOT dinodes to system inodes,
        completing fe7a283b3916 ("ocfs2: add suballoc slot check in
        ocfs2_validate_inode_block()"), and turns the "system file
        state is ambiguous" BUG_ON() in ocfs2_read_locked_inode() into
        an ocfs2_error();
  patch 2 rejects oversized dinode suballoc bits;
  patch 3 validates the suballoc slot and bit of xattr and dir index
        blocks;
  patch 4 validates the suballoc slot and bit of extent and refcount
        blocks.

The checks only enforce what the kernel and mkfs.ocfs2 already write: a
valid slot from meta_ac->ac_alloc_slot and a bit within the block group
bitmap, with system inodes carrying OCFS2_INVALID_SLOT plus
OCFS2_SYSTEM_FL and extent blocks using slot 0.  Nothing changes for
healthy filesystems.

Each new check was exercised under QEMU by corrupting the field in
question with an out-of-range value; with the series applied the access
fails with -EROFS and the filesystem remounts read-only instead of hitting
the BUG_ON().


This patch (of 4):

ocfs2_validate_inode_block() currently permits i_suballoc_slot to be
OCFS2_INVALID_SLOT for any dinode.  Only system inodes created by
mkfs.ocfs2 are allocated from the global allocator and thus legitimately
carry this value; regular inodes are always allocated from a per-slot
suballocator and hence must have a valid slot.

If a corrupted regular inode with OCFS2_INVALID_SLOT is accepted,
ocfs2_remove_inode() will pass the slot to ocfs2_get_system_file_inode()
and get_local_system_inode() will hit BUG_ON(slot == OCFS2_INVALID_SLOT)
when the inode is deleted.  This can be triggered by an unprivileged user
unlinking such a corrupted file.

Reject OCFS2_INVALID_SLOT for non-system dinodes during validation, while
still accepting it for system inodes.  Note that a crafted dinode carrying
OCFS2_SYSTEM_FL passes the check above, yet a plain lookup of it still
used to BUG() in ocfs2_read_locked_inode() ("system file state is
ambiguous").  Since i_flags comes from disk, handle that mismatch with
ocfs2_error() instead of BUG_ON() as well.
```

## Signals

- CVSS: 7.5 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.733%, percentile 55.728%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 172)

- debian linux (Debian): All versions (No fix recorded) \| \< 6.12.118-1 \| \< 7.3.4-1
- debian linux-6.12 (Debian): \< 6.12.118-1~deb12u1
- ubuntu linux (Ubuntu): All versions (No fix recorded)
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.14 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.17 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-7.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded)

## References

- <https://git.kernel.org/stable/c/cef7a01a416aede5f77a84ffc6a4c606368e3d5f>
- <https://git.kernel.org/stable/c/9cc83c00b9b4f0e0a5842864b1a320fa63ecfc5c>
- <https://git.kernel.org/stable/c/af08d7bef319df99c71107e0034244168822aa42>
- <https://git.kernel.org/stable/c/de648cd4c54e659d5d212bdbe158f135569161cb>
- <https://git.kernel.org/stable/c/c55809688e4abbc4474f28849deea6e5cee2684c>
- <https://git.kernel.org/stable/c/25bf9e549360b656a6763232e0e9e58a00c3aff7>
- <https://security-tracker.debian.org/tracker/CVE-2026-138889>
- <https://ubuntu.com/security/CVE-2026-138889>
- <https://www.cve.org/CVERecord?id=CVE-2026-138889>

---

Data as of 2026-12-05T03:57:19.016Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
