CVE-2026-138889
published high CVSS 3.1 · 7.5ocfs2: restrict OCFS2_INVALID_SLOT suballoc slot to system inodes
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux688d054a680c20ba3bf85de67ca780befc7ffc7b to < cef7a01a416aede5f77a84ffc6a4c606368e3d5f · b8fa4d063e3b0c37ec406a1fb6b5033337fb879d to < 9cc83c00b9b4f0e0a5842864b1a320fa63ecfc5c · c416b59dbc547f5555e561dee1484a55dcbb79dd to < af08d7bef319df99c71107e0034244168822aa42 · fe7a283b39160153b6d1bd7f61b0a9d5d44987a8 to < de648cd4c54e659d5d212bdbe158f135569161cb · fe7a283b39160153b6d1bd7f61b0a9d5d44987a8 to < c55809688e4abbc4474f28849deea6e5cee2684c · fe7a283b39160153b6d1bd7f61b0a9d5d44987a8 to < 25bf9e549360b656a6763232e0e9e58a00c3aff7 · 6.1.191 to < 6.1.193 · 6.6.160 to < 6.6.163 · 6.12.114 to < 6.12.118 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.18 (affected) · 0 to < 6.18 (unaffected · semver) · 6.1.193 through 6.1.* (unaffected · semver) · 6.6.163 through 6.6.* (unaffected · semver) · 6.12.118 through 6.12.* (unaffected · semver) · 6.18.63 through 6.18.* (unaffected · semver) · 7.3.4 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Scenarios
- en: AV:N - ocfs2_fh_to_dentry() takes ih_blkno raw from the NFS file handle, and ocfs2_get_dentry() calls ocfs2_iget(osb, blkno, 0, 0) once ocfs2_test_inode_bit() finds the global allocator bit set, which mkfs sets for system inodes such as //bad_blocks. ocfs2_read_locked_inode() then hit the SYSTEM_FL mismatch BUG(). The bad value is a forged handle in any NFSv3/v4 request (GETATTR, PUTFH+GETATTR) to an exported ocfs2 volume. AC:L - The client learns the export root's fileid from GETATTR (blkno 5 on a fresh mkfs, with bad_blocks at 7), or scans nearby blocks; wrong guesses just return ESTALE. The BUG fires inside ocfs2_iget() before ocfs2_get_dentry() checks ih_generation, so the attacker needs no secret and no state outside their control. PR:N - nfsd_set_fh_dentry() decodes the handle via exportfs_decode_fh_raw() after only the host-based rqst_exp_find() lookup and before any inode permission check, and on a default sec=sys export the client merely asserts a uid. The crafted-image path (a regular dinode with i_suballoc_slot 0xFFFF unlinked) is lower reach. UI:N - No victim action is needed: the volume is pristine, so no crafted image has to be mounted. A mkfs.ocfs2 1.8.9 image confirms bad_blocks is a Valid System dinode with slot Global and its bit set, and the kernel never loads it, so ocfs2_ilookup() misses and the read happens. S:U - The BUG() fires in the nfsd thread's own kernel context on the file server; no guest/host, IOMMU or other authority boundary is crossed. C:N - Both removed sites are assertions: mlog_bug_on_msg() in ocfs2_read_locked_inode(), and BUG_ON(slot == OCFS2_INVALID_SLOT) in get_local_system_inode(), which fires before the local_system_inodes[] index is computed, so no memory is read out of bounds. I:N - The crash comes before ocfs2_remove_inode()/ocfs2_free_dinode() touch any allocator, and before the half-populated inode is used, so nothing is written or corrupted. A:H - BUG() oopses the server (a panic under panic_on_oops) and kills the nfsd thread while it holds osb->nfs_sync_rwlock for write plus the EX nfs_sync cluster lock, so later handle decodes and ocfs2_delete_inode() block on that volume. The client can repeat it at will.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 688d054a680c20ba3bf85de67ca780befc7ffc7b to < cef7a01a416aede5f77a84ffc6a4c606368e3d5f (affected · git)b8fa4d063e3b0c37ec406a1fb6b5033337fb879d to < 9cc83c00b9b4f0e0a5842864b1a320fa63ecfc5c (affected · git)c416b59dbc547f5555e561dee1484a55dcbb79dd to < af08d7bef319df99c71107e0034244168822aa42 (affected · git)fe7a283b39160153b6d1bd7f61b0a9d5d44987a8 to < de648cd4c54e659d5d212bdbe158f135569161cb (affected · git)fe7a283b39160153b6d1bd7f61b0a9d5d44987a8 to < c55809688e4abbc4474f28849deea6e5cee2684c (affected · git)fe7a283b39160153b6d1bd7f61b0a9d5d44987a8 to < 25bf9e549360b656a6763232e0e9e58a00c3aff7 (affected · git)6.1.191 to < 6.1.193 (affected · semver)6.6.160 to < 6.6.163 (affected · semver)6.12.114 to < 6.12.118 (affected · semver)Default: unaffected | Linux · cna |
| Linux | Linux | 6.18 (affected)0 to < 6.18 (unaffected · semver)6.1.193 through 6.1.* (unaffected · semver)6.6.163 through 6.6.* (unaffected · semver)6.12.118 through 6.12.* (unaffected · semver)6.18.63 through 6.18.* (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
6- https://git.kernel.org/stable/c/25bf9e549360b656a6763232e0e9e58a00c3aff7
- https://git.kernel.org/stable/c/9cc83c00b9b4f0e0a5842864b1a320fa63ecfc5c
- https://git.kernel.org/stable/c/af08d7bef319df99c71107e0034244168822aa42
- https://git.kernel.org/stable/c/c55809688e4abbc4474f28849deea6e5cee2684c
- https://git.kernel.org/stable/c/cef7a01a416aede5f77a84ffc6a4c606368e3d5f
- https://git.kernel.org/stable/c/de648cd4c54e659d5d212bdbe158f135569161cb
Provider assertions
1Linux · cna
ocfs2: restrict OCFS2_INVALID_SLOT suballoc slot to system inodes
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- f6aace19236139ffff1a338864b6b3e9d1b0294ed1725ad609a7f9de3934a28e
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record