{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-138941","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-11-30T13:22:15.904Z","datePublished":"2026-11-30T13:26:24.359Z","dateUpdated":"2026-11-30T13:26:24.359Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-11-30T13:26:24.359Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc/bpf: fix buffer overflow in JIT for large BPF programs\n\nDuring size calculation in pass-0, exit_addr is 0 since addrs[fp->len]\nis not yet populated. bpf_jit_emit_exit_insn() treats a zero exit_addr\nas in-range and skips bpf_jit_build_epilogue(), so the alternate inline\nepilogue instructions are not counted in alloclen.\n\nIn later passes, if the real exit_addr falls outside the 32MB branch\nrange, the full inline epilogue is emitted into the already-allocated\nbuffer, writing past its end and corrupting adjacent memory.\n\nFix by ensuring exit_addr is non-zero before treating it as in-range,\nso pass-0 always falls through to bpf_jit_build_epilogue() and\nconservatively accounts for all epilogue instructions in alloclen.\nAlso range check alt_exit_addr directly in the else-if condition.\n\nSince exit_addr handling now falls through to the epilogue, two\nrelated issues in bpf_int_jit_compile() must also be addressed:\n\n1. Reset cgctx.alt_exit_addr before the second size-calculation pass.\n   Without this, a stale alt_exit_addr from the first pass causes the\n   second pass to emit a single jump instead of the full epilogue,\n   undercounting alloclen and reintroducing the overflow.\n\n2. Recompute addrs[fp->len] at the end of each code-generation pass.\n   The larger pass-0 body can shrink in later passes as out-of-range\n   exits settle into in-range jumps; a stale addrs[fp->len] would\n   leave exit branches targeting past the real (shrunken) epilogue.\n\nBecause shrinkage in a later pass can move the epilogue offset, the\nfixed two-pass loop is no longer sufficient: an exit that was out of\nrange in an earlier pass may fall in range once the epilogue offset\nshrinks, shrinking the body further and overwriting the start of the\nepilogue. Convert the code-generation loop to iterate until the\nprogram size converges, bounded by CODEGEN_MAX_PASSES, and fail the\nJIT if it does not converge."}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/net/bpf_jit.h","arch/powerpc/net/bpf_jit_comp.c"],"versions":[{"version":"0ffdbce6f4a89bb7c0002904d6438ec83cf05ce7","lessThan":"b17348a6187b348bc30b74dbc207b98c72dd7b26","status":"affected","versionType":"git"},{"version":"0ffdbce6f4a89bb7c0002904d6438ec83cf05ce7","lessThan":"033a1e4f56c29b4244d4f504f4b7704dfefa7afd","status":"affected","versionType":"git"},{"version":"0ffdbce6f4a89bb7c0002904d6438ec83cf05ce7","lessThan":"5d79818c18172beedb9e1121496ee15bd195ff93","status":"affected","versionType":"git"},{"version":"0ffdbce6f4a89bb7c0002904d6438ec83cf05ce7","lessThan":"3b9710e1d312bf0c3b48e1e1f121255ff3346e25","status":"affected","versionType":"git"},{"version":"0ffdbce6f4a89bb7c0002904d6438ec83cf05ce7","lessThan":"0e7ec5fe2fc914e611cd0f9cfeb76a17ffbf5d6f","status":"affected","versionType":"git"},{"version":"0ffdbce6f4a89bb7c0002904d6438ec83cf05ce7","lessThan":"78ce55b7913a78e1687306668e078b86bc6508ee","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/net/bpf_jit.h","arch/powerpc/net/bpf_jit_comp.c"],"versions":[{"version":"5.18","status":"affected"},{"version":"0","lessThan":"5.18","status":"unaffected","versionType":"semver"},{"version":"6.1.193","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.163","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.118","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.64","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.4","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"6.12.118"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"6.18.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/b17348a6187b348bc30b74dbc207b98c72dd7b26"},{"url":"https://git.kernel.org/stable/c/033a1e4f56c29b4244d4f504f4b7704dfefa7afd"},{"url":"https://git.kernel.org/stable/c/5d79818c18172beedb9e1121496ee15bd195ff93"},{"url":"https://git.kernel.org/stable/c/3b9710e1d312bf0c3b48e1e1f121255ff3346e25"},{"url":"https://git.kernel.org/stable/c/0e7ec5fe2fc914e611cd0f9cfeb76a17ffbf5d6f"},{"url":"https://git.kernel.org/stable/c/78ce55b7913a78e1687306668e078b86bc6508ee"}],"title":"powerpc/bpf: fix buffer overflow in JIT for large BPF programs","x_generator":{"engine":"bippy-1.2.0"}}}}