Skip to contentSkip to conversation

CVE-2026-45838: bpf: fix end-of-list detection in cgroup_storage_get_next_key()

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:

bpf: fix end-of-list detection in cgroup_storage_get_next_key()

list_next_entry() never returns NULL -- when the current element is the last entry it wraps to the list head via container_of(). The subsequent NULL check is therefore dead code and get_next_key() never returns -ENOENT for the last element, instead reading storage->key from a bogus pointer that aliases internal map fields and copying the result to userspace.

Replace it with list_entry_is_head() so the function correctly returns -ENOENT when there are no more entries.

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

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

	Issue introduced in 4.19 with commit de9cbbaadba5adf88a19e46df61f7054000838f6 and fixed in 6.6.141 with commit b4b5a20bed82130da2f2818f04d52378952fbd0b
	Issue introduced in 4.19 with commit de9cbbaadba5adf88a19e46df61f7054000838f6 and fixed in 6.12.91 with commit 85a2f30e40f7468db732f55659bc6318874f49af
	Issue introduced in 4.19 with commit de9cbbaadba5adf88a19e46df61f7054000838f6 and fixed in 6.18.33 with commit 32ce55d424395904986f5066f8755f6cb9993377
	Issue introduced in 4.19 with commit de9cbbaadba5adf88a19e46df61f7054000838f6 and fixed in 7.0.10 with commit fc39753b7f92e09177777e9c648afe5aa3abb81f
	Issue introduced in 4.19 with commit de9cbbaadba5adf88a19e46df61f7054000838f6 and fixed in 7.1-rc1 with commit 5828b9e5b272ecff7cf5d345128d3de7324117f7

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

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:
kernel/bpf/local_storage.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/b4b5a20bed82130da2f2818f04d52378952fbd0b
	https://git.kernel.org/stable/c/85a2f30e40f7468db732f55659bc6318874f49af
	https://git.kernel.org/stable/c/32ce55d424395904986f5066f8755f6cb9993377
	https://git.kernel.org/stable/c/fc39753b7f92e09177777e9c648afe5aa3abb81f
	https://git.kernel.org/stable/c/5828b9e5b272ecff7cf5d345128d3de7324117f7