Skip to contentSkip to conversation

CVE-2026-45974: btrfs: fix invalid leaf access in btrfs_quota_enable() if ref key not found

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:

btrfs: fix invalid leaf access in btrfs_quota_enable() if ref key not found

If btrfs_search_slot_for_read() returns 1, it means we did not find any key greater than or equals to the key we asked for, meaning we have reached the end of the tree and therefore the path is not valid. If this happens we need to break out of the loop and stop, instead of continuing and accessing an invalid path.

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

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

	Issue introduced in 5.10 with commit 5223cc60b40ae525ae6c94e98824129f1a5b4ae5 and fixed in 5.10.252 with commit 023545e272f369d487e6a986c1e321c6e04be1da
	Issue introduced in 5.10 with commit 5223cc60b40ae525ae6c94e98824129f1a5b4ae5 and fixed in 5.15.202 with commit fd4913a53e3b54ad7e161847291439fe445d6356
	Issue introduced in 5.10 with commit 5223cc60b40ae525ae6c94e98824129f1a5b4ae5 and fixed in 6.1.165 with commit b5b8ade9da452086e78f5d519b90d3769e354853
	Issue introduced in 5.10 with commit 5223cc60b40ae525ae6c94e98824129f1a5b4ae5 and fixed in 6.6.128 with commit 1ee1d006c9fe4d6be5527ab1c84216b80cccbe40
	Issue introduced in 5.10 with commit 5223cc60b40ae525ae6c94e98824129f1a5b4ae5 and fixed in 6.12.75 with commit 0761447f6f51e1c7997960d8e6559337deed6729
	Issue introduced in 5.10 with commit 5223cc60b40ae525ae6c94e98824129f1a5b4ae5 and fixed in 6.18.14 with commit d7cf2314dd5e8661c05d076cd627eea9a7f76616
	Issue introduced in 5.10 with commit 5223cc60b40ae525ae6c94e98824129f1a5b4ae5 and fixed in 6.19.4 with commit b2bd557b75b760e4b9d209112bda19314bd64558
	Issue introduced in 5.10 with commit 5223cc60b40ae525ae6c94e98824129f1a5b4ae5 and fixed in 7.0 with commit ecb7c2484cfc83a93658907580035a8adf1e0a92
	Issue introduced in 5.9.7 with commit ecce1be9f2a366990d0e75dd249fb324e83c34a9

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

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/btrfs/qgroup.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/023545e272f369d487e6a986c1e321c6e04be1da
	https://git.kernel.org/stable/c/fd4913a53e3b54ad7e161847291439fe445d6356
	https://git.kernel.org/stable/c/b5b8ade9da452086e78f5d519b90d3769e354853
	https://git.kernel.org/stable/c/1ee1d006c9fe4d6be5527ab1c84216b80cccbe40
	https://git.kernel.org/stable/c/0761447f6f51e1c7997960d8e6559337deed6729
	https://git.kernel.org/stable/c/d7cf2314dd5e8661c05d076cd627eea9a7f76616
	https://git.kernel.org/stable/c/b2bd557b75b760e4b9d209112bda19314bd64558
	https://git.kernel.org/stable/c/ecb7c2484cfc83a93658907580035a8adf1e0a92