CVE-2026-138942

Source
https://cve.org/CVERecord?id=CVE-2026-138942
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138942.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-138942
Downstream
Published
2026-11-30T13:26:24Z
Modified
2026-11-30T15:01:35Z
Summary
powerpc64/bpf: fix percpu private stack leak on JIT failure
Details

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.

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138942.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
156d985123b6d6e5189cfd0286b93c12167ae798
Fixed
67511cced5a1b9e4f1787b0ea1e53ca076f42639
Fixed
24affb84d98e6b37b276aa57e5dd25ad93458cea

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138942.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
7.1.0
Fixed
7.3.4

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138942.json"