Description
In the Linux kernel, the following vulnerability has been resolved:

ocfs2: fix readdir position truncation on 32-bit kernels

In ocfs2_dir_foreach_blk_el(), the directory cookie position is
rebuilt with

ctx->pos = (ctx->pos & ~(sb->s_blocksize - 1)) | offset;

`ctx->pos` is loff_t (signed 64-bit), while `sb->s_blocksize` is
unsigned long. On 32-bit kernels unsigned long is 32-bit, so the mask

~(sb->s_blocksize - 1)

is computed as a 32-bit unsigned value (e.g. 0xfffff000 for a 4 KiB
block size). In the AND expression with the 64-bit `ctx->pos`, that
unsigned operand is zero-extended to 64 bits per the usual arithmetic
conversions, yielding 0x00000000fffff000. The high 32 bits of
`ctx->pos` are silently cleared, even though directory size is
allowed to exceed 4 GiB.

When readdir() crosses the 4 GiB boundary on a 32-bit kernel the
position is reset back into the first 4 GiB block, making the
re-validation path re-enumerate already-returned dirents indefinitely.

This is ocfs2_dir_foreach_blk_el(), the extent-list readdir path taken
for all non-inline directories, so a directory large enough to cross
4 GiB reaches it.

This is the same class of bug that commit 3dce5bb82c97 ("exfat: Fix
bitwise operation having different size") fixed in exfat, and the
fix mirrors the equivalent ext4 fix in this series. Cast the operand
to loff_t so the mask is 64-bit before the AND:

ctx->pos = (ctx->pos & ~((loff_t)sb->s_blocksize - 1)) | offset;

64-bit kernels are unaffected.
Published: 2026-09-11
Score: 5.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service via infinite readdir loop in ocfs2 on 32‑bit kernels
Action: Apply patch
AI Analysis

Impact

The vulnerability in the ocfs2 filesystem stems from an integer truncation when recomputing the directory cookie position on 32‑bit Linux kernels. Because the code masks a 64‑bit value with a 32‑bit mask, the high bits of the position are silently cleared, causing the readdir routine to reset to the first 4 GiB block once a directory larger than that boundary is accessed. This results in the same directory entries being returned repeatedly, creating an infinite loop that directory operations to a halt.

Affected Systems

Linux kernel 32‑bit deployments that use the ocfs2 filesystem are affected. Any machine mounting an ocfs2 volume with a directory size exceeding flaw. 64‑bit kernels are unaffected, and the issue does not apply to systems that never mount ocfs2 or that keep all directories below the 4‑GiB threshold.

Risk and Exploitability

The flaw is rated with a CVSS base score of 5.5, indicating moderate risk, and the vulnerability is not listed in the CISA KEV catalog, suggesting limited exploitation activity so far. The EPSS score is less than 1%, indicating a very low likelihood of exploitation. An attacker would need local access to a process that performs read directory operations on a heavy ocfs2 directory; the damage consists of a denial of service via high CPU consumption, with no privilege escalation or remote code execution risk.

Generated by OpenCVE AI on September 13, 2026 at 04:25 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply a kernel version that includes the fix for ocfs2 readdir position truncation on 32‑bit systems
  • Avoid creating or accessing ocfs2 directories that could exceed 4 GiB on 32‑bit kernels
  • Monitor CPU usage and directory traversal activity on ocfs2 mounts to detect potential exploitation

Generated by OpenCVE AI on September 13, 2026 at 04:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 12 Sep 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-190
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate


Fri, 11 Sep 2026 23:45:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: ocfs2: fix readdir position truncation on 32-bit kernels In ocfs2_dir_foreach_blk_el(), the directory cookie position is rebuilt with ctx->pos = (ctx->pos & ~(sb->s_blocksize - 1)) | offset; `ctx->pos` is loff_t (signed 64-bit), while `sb->s_blocksize` is unsigned long. On 32-bit kernels unsigned long is 32-bit, so the mask ~(sb->s_blocksize - 1) is computed as a 32-bit unsigned value (e.g. 0xfffff000 for a 4 KiB block size). In the AND expression with the 64-bit `ctx->pos`, that unsigned operand is zero-extended to 64 bits per the usual arithmetic conversions, yielding 0x00000000fffff000. The high 32 bits of `ctx->pos` are silently cleared, even though directory size is allowed to exceed 4 GiB. When readdir() crosses the 4 GiB boundary on a 32-bit kernel the position is reset back into the first 4 GiB block, making the re-validation path re-enumerate already-returned dirents indefinitely. This is ocfs2_dir_foreach_blk_el(), the extent-list readdir path taken for all non-inline directories, so a directory large enough to cross 4 GiB reaches it. This is the same class of bug that commit 3dce5bb82c97 ("exfat: Fix bitwise operation having different size") fixed in exfat, and the fix mirrors the equivalent ext4 fix in this series. Cast the operand to loff_t so the mask is 64-bit before the AND: ctx->pos = (ctx->pos & ~((loff_t)sb->s_blocksize - 1)) | offset; 64-bit kernels are unaffected.
Title ocfs2: fix readdir position truncation on 32-bit kernels
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-09-11T19:43:42.808Z

Reserved: 2026-09-11T19:38:34.713Z

Link: CVE-2026-89490

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-11T20:19:30.810

Modified: 2026-09-11T20:19:30.810

Link: CVE-2026-89490

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-09-11T19:43:42Z

Links: CVE-2026-89490 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-09-13T04:30:08Z

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound