{"id":"CVE-2026-138942","aliases":["CVE-2026-138942"],"related":[],"kind":"vulnerability","state":"published","title":"powerpc64/bpf: fix percpu private stack leak on JIT failure","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc64/bpf: fix percpu private stack leak on JIT failure\n\nThe existing conditional statement in bpf_int_jit_compile() frees the\npercpu private stack at out_addrs only when the image buffer was never\nallocated.\n\nIf bpf_jit_build_body() fails during a code-generation pass, the\nimage buffer has already been allocated, so !image is false and the\npercpu stack is not freed.\n\nBecause JIT compilation failed, fp->jited remains at 0. The subsequent\nbpf_jit_free() path only frees priv_stack_ptr when fp->jited is set, so\nfreeing is skipped here too, leaking the percpu allocation.\n\nFix implements freeing the private stack whenever fp->jited was not set,\ni.e. compilation did not succeed, instead of keying off !image. !fp->jited\nalready covers the !image case, since image is only NULL on early-failure\npaths where fp->jited is likewise 0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc64/bpf: fix percpu private stack leak on JIT failure\n\nThe existing conditional statement in bpf_int_jit_compile() frees the\npercpu private stack at out_addrs only when the image buffer was never\nallocated.\n\nIf bpf_jit_build_body() fails during a code-generation pass, the\nimage buffer has already been allocated, so !image is false and the\npercpu stack is not freed.\n\nBecause JIT compilation failed, fp->jited remains at 0. The subsequent\nbpf_jit_free() path only frees priv_stack_ptr when fp->jited is set, so\nfreeing is skipped here too, leaking the percpu allocation.\n\nFix implements freeing the private stack whenever fp->jited was not set,\ni.e. compilation did not succeed, instead of keying off !image. !fp->jited\nalready covers the !image case, since image is only NULL on early-failure\npaths where fp->jited is likewise 0.","source":"cvelist"}],"published":"2026-11-30T13:26:24.902Z","modified":"2026-11-30T14:17:55.153Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"156d985123b6d6e5189cfd0286b93c12167ae798","fixed":"67511cced5a1b9e4f1787b0ea1e53ca076f42639","status":"affected"},{"type":"git","introduced":"156d985123b6d6e5189cfd0286b93c12167ae798","fixed":"24affb84d98e6b37b276aa57e5dd25ad93458cea","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"7.1","status":"affected"},{"type":"semver","introduced":"0","fixed":"7.1","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/67511cced5a1b9e4f1787b0ea1e53ca076f42639","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/24affb84d98e6b37b276aa57e5dd25ad93458cea","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138942","url":"https://www.cve.org/CVERecord?id=CVE-2026-138942","licence":"CVE Terms of Use","modified":"2026-11-30T13:26:24.902Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138942","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138942","licence":"Public domain","modified":"2026-11-30T14:17:55.153Z"}],"updatedAt":"2026-11-30T14:32:23.835Z","epss":{"score":0.0019,"percentile":0.09064,"date":"2026-12-01T12:00:22.000Z"}}