Medium · published May 27, 2026
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.
| Product | Versions | Fixed in |
|---|---|---|
| linux/linux_kernel | ≥ 4.19, < 5.10.258 | 5.10.258 |
| linux/linux_kernel | ≥ 5.11, < 5.15.209 | 5.15.209 |
| linux/linux_kernel | ≥ 5.16, < 6.1.175 | 6.1.175 |
| linux/linux_kernel | ≥ 6.2, < 6.6.141 | 6.6.141 |
| linux/linux_kernel | ≥ 6.7, < 6.12.91 | 6.12.91 |
| linux/linux_kernel | ≥ 6.13, < 6.18.33 | 6.18.33 |
| linux/linux_kernel | ≥ 6.19, < 7.0.10 | 7.0.10 |