# CVE-2026-138942: powerpc64/bpf: fix percpu private stack leak on JIT failure

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 9% of CVEs (2026-12-01)
- Published: 2026-11-30T13:26:24.902Z
- Modified: 2026-11-30T14:17:55.153Z
- Assigned by: Linux

## Description

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 bpf_int_jit_compile() frees the
percpu private stack at out_addrs only when the image buffer was never
allocated.

If bpf_jit_build_body() 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
bpf_jit_free() path only frees priv_stack_ptr 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 156d985123b6d6e5189cfd0286b93c12167ae798 before 67511cced5a1b9e4f1787b0ea1e53ca076f42639; from 156d985123b6d6e5189cfd0286b93c12167ae798 before 24affb84d98e6b37b276aa57e5dd25ad93458cea; 7.1 (not affected: before 7.1; from 7.3.4 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/67511cced5a1b9e4f1787b0ea1e53ca076f42639>
- <https://git.kernel.org/stable/c/24affb84d98e6b37b276aa57e5dd25ad93458cea>

## Sources

- CVE List: [CVE-2026-138942](https://www.cve.org/CVERecord?id=CVE-2026-138942), CVE Terms of Use, modified 2026-11-30
- NVD: [CVE-2026-138942](https://nvd.nist.gov/vuln/detail/CVE-2026-138942), Public domain, modified 2026-11-30

---

Page: https://cve.day/CVE-2026-138942 · Whole record: https://cve.day/CVE-2026-138942.json · Rebuilt by cve.day 2026-11-30T14:32:23.835Z
