All of lore.kernel.org
 help / color / mirror / Atom feed
* CVE-2026-89490: ocfs2: fix readdir position truncation on 32-bit kernels
@ 2026-09-11 19:42 Greg Kroah-Hartman
  0 siblings, 0 replies; only message in thread
From: Greg Kroah-Hartman @ 2026-09-11 19:42 UTC (permalink / raw)
  To: linux-cve-announce; +Cc: Greg Kroah-Hartman

From: Greg Kroah-Hartman <gregkh@kernel.org>

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.

The Linux kernel CVE team has assigned CVE-2026-89490 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 2.6.16 with commit ccd979bdbce9fba8412beb3f1de68a9d0171b12c and fixed in 6.12.109 with commit 1001fb3b69a11eaa0dc7c7428f6edfa48b88997a
	Issue introduced in 2.6.16 with commit ccd979bdbce9fba8412beb3f1de68a9d0171b12c and fixed in 6.18.50 with commit c0c165487a2ea5a37ddcdab4259157b7a527129c
	Issue introduced in 2.6.16 with commit ccd979bdbce9fba8412beb3f1de68a9d0171b12c and fixed in 7.2.4 with commit b53e2b271eeb6040c2a4a78230c570dc41cdcfa4
	Issue introduced in 2.6.16 with commit ccd979bdbce9fba8412beb3f1de68a9d0171b12c and fixed in 7.3-rc1 with commit a63308ab426f3a3c7e33b02c150ea59054620261

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2026-89490
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	fs/ocfs2/dir.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/1001fb3b69a11eaa0dc7c7428f6edfa48b88997a
	https://git.kernel.org/stable/c/c0c165487a2ea5a37ddcdab4259157b7a527129c
	https://git.kernel.org/stable/c/b53e2b271eeb6040c2a4a78230c570dc41cdcfa4
	https://git.kernel.org/stable/c/a63308ab426f3a3c7e33b02c150ea59054620261

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-11 19:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11 19:42 CVE-2026-89490: ocfs2: fix readdir position truncation on 32-bit kernels Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.