Skip to contentSkip to conversation

CVE-2026-80638: ocfs2: fix out-of-bounds write in ocfs2_remove_refcount_extent

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Aug 28

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

ocfs2: fix out-of-bounds write in ocfs2_remove_refcount_extent

[BUG]
Unlinking a refcounted file whose refcount tree has leaf blocks triggers a fortify panic due to an out-of-bounds write.

[CAUSE]
When the last leaf block is removed from a refcount tree, ocfs2_remove_refcount_extent() converts the root back to leaf mode with a bulk memset on &rb->rf_records. rf_records sits in an anonymous union with rf_list. rf_list.l_tree_depth aliases rf_records.rl_count, and is 0 for a single-level tree. With rl_count equal to 0, the memset writes past the 16-byte declared size of rf_records, which the fortify checker catches.

[FIX]
Replace the bulk memset on &rb->rf_records with a correctly-bounded memset on rl_recs[] alone, after setting rl_count to the correct value.

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

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

	Issue introduced in 6.19 with commit 2f26f58df041bbcf692730ff4d8ab0f250d9670d and fixed in 7.1.5 with commit f5255516ec7add3a6d5d37853ad5a9a9ddb14305
	Issue introduced in 6.19 with commit 2f26f58df041bbcf692730ff4d8ab0f250d9670d and fixed in 7.2 with commit 1ec3cca2d8b6b9ff6584ca626d4c8918bbf48d44

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-80638

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/refcounttree.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/f5255516ec7add3a6d5d37853ad5a9a9ddb14305
	https://git.kernel.org/stable/c/1ec3cca2d8b6b9ff6584ca626d4c8918bbf48d44