CVE-2026-138942: powerpc64/bpf: fix percpu private stack leak on JIT failure
In the Linux kernel, the following vulnerability has been resolved:
powerpc64/bpf: fix percpu private stack leak on JIT failure
The existing conditional statement in bpfintjitcompile() frees the percpu private stack at outaddrs only when the image buffer was never allocated.
If bpfjitbuildbody() fails during a code-generation pass, the image buffer has already been allocated, so !image is false and the percpu stack is not freed.
Because JIT compilation failed, fp->jited remains at 0. The subsequent bpfjitfree() path only frees privstackptr when fp->jited is set, so freeing is skipped here too, leaking the percpu allocation.
Fix implements freeing the private stack whenever fp->jited was not set, i.e. compilation did not succeed, instead of keying off !image. !fp->jited already covers the !image case, since image is only NULL on early-failure paths where fp->jited is likewise 0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1
Event History
Frequently Asked Questions
When does the allocation leak occur?
The leak occurs when powerpc64 BPF JIT compilation reaches a code-generation pass, allocates the image buffer, and then bpf_jit_build_body() fails. Early failures where no image buffer was allocated are also covered by the corrected condition, but were not the problematic case described.
Why does the normal BPF cleanup path not reclaim the memory?
After failed JIT compilation, fp->jited remains 0. The subsequent bpf_jit_free() path frees priv_stack_ptr only when fp->jited is set, so it skips the per-CPU private stack allocation.