Skip to contentSkip to conversation

CVE-2026-46094: ext4: fix bounds check in check_xattrs() to prevent out-of-bounds access

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 27

lore
Share & tools
lore
#0 lore raw

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

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

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

ext4: fix bounds check in check_xattrs() to prevent out-of-bounds access

The bounds check for the next xattr entry in check_xattrs() uses (void *)next >= end, which allows next to point within sizeof(u32) bytes of end. On the next loop iteration, IS_LAST_ENTRY() reads 4 bytes via *(__u32 *)(entry), which can overrun the valid xattr region.

For example, if next lands at end - 1, the check passes since next < end, but IS_LAST_ENTRY() reads 4 bytes starting at end - 1, accessing 3 bytes beyond the valid region.

Fix this by changing the check to (void *)next + sizeof(u32) > end, ensuring there is always enough space for the IS_LAST_ENTRY() read on the subsequent iteration.

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

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

	Issue introduced in 6.3 with commit 3478c83cf26bbffd026ae6a56bcb1fe544f0834e and fixed in 6.6.140 with commit ab6da97bc310db35d4e4ef5354bc3ff626b0698c
	Issue introduced in 6.3 with commit 3478c83cf26bbffd026ae6a56bcb1fe544f0834e and fixed in 6.12.86 with commit 5a5314d2387633a272a04d1bd8727f99058e4e68
	Issue introduced in 6.3 with commit 3478c83cf26bbffd026ae6a56bcb1fe544f0834e and fixed in 6.18.27 with commit 537e065977022aa22f2c2503e8accaf16622e0fd
	Issue introduced in 6.3 with commit 3478c83cf26bbffd026ae6a56bcb1fe544f0834e and fixed in 7.0.4 with commit 520986722dbf869c122252123fc161c7302eab7d
	Issue introduced in 6.3 with commit 3478c83cf26bbffd026ae6a56bcb1fe544f0834e and fixed in 7.1-rc1 with commit eceafc31ea7b42c984ece10d79d505c0bb6615d5

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

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/ext4/xattr.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/ab6da97bc310db35d4e4ef5354bc3ff626b0698c
	https://git.kernel.org/stable/c/5a5314d2387633a272a04d1bd8727f99058e4e68
	https://git.kernel.org/stable/c/537e065977022aa22f2c2503e8accaf16622e0fd
	https://git.kernel.org/stable/c/520986722dbf869c122252123fc161c7302eab7d
	https://git.kernel.org/stable/c/eceafc31ea7b42c984ece10d79d505c0bb6615d5