CVE-2026-98132: bpf: don't downgrade half-dead scalar zero spills to STACK_ZERO
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
bpf: don't downgrade half-dead scalar zero spills to STACK_ZERO
states.c:__clean_func_state() can downgrade scalar zero spill to STACK_ZERO in the following case:
*(u64 *)(r10 - 8) = 0; ... checkpoint ... r1 = *(u32 *)(r10 - 4); ... no reads from r10-8 ...
Here 4 bytes at r10-8 are dead and verifier changes scalar spill to a
combination: 0000pppp (p stands for poison). Such a change breaks precision propagation chains. All places that produce STACK_ZERO should call bpf_mark_chain_precision() for the zero source.
This patch fixes the bug in a simplest way possible:
avoids converting stack spills of zero to STACK_ZERO. Two smarter approaches are possible:
- do bpf_mark_chain_precision() from __clean_func_state()
- check slot liveness information in check_stack_write_fixed_off()
I investigated both and the changes required are a bit tricky, hence go with a simple fix for the time being.
The Linux kernel CVE team has assigned CVE-2026-98132 to this issue.
Affected and fixed versions
===========================
Issue introduced in 7.1 with commit be23266b4a08540aa43d8503a2ea10247c8daebe and fixed in 7.2.7 with commit 436fa689630b741a77ef8c4a6f426479affd5bac Issue introduced in 7.1 with commit be23266b4a08540aa43d8503a2ea10247c8daebe and fixed in 7.3-rc2 with commit 2f3536bff8823d3c5fdbbe15e17bfca696cc2b2e
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-98132
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/states.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/436fa689630b741a77ef8c4a6f426479affd5bac https://git.kernel.org/stable/c/2f3536bff8823d3c5fdbbe15e17bfca696cc2b2e