PT-2026-162982

CVE-2026-138941

·

Published

2026-11-30

·

Updated

2026-11-30

Description by

Score
N/A
Not available

No severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.

In the Linux kernel, the following vulnerability has been resolved:
powerpc/bpf: fix buffer overflow in JIT for large BPF programs
During size calculation in pass-0, exit addr is 0 since addrs[fp->len] is not yet populated. bpf jit emit exit insn() treats a zero exit addr as in-range and skips bpf jit build epilogue(), so the alternate inline epilogue instructions are not counted in alloclen.
In later passes, if the real exit addr falls outside the 32MB branch range, the full inline epilogue is emitted into the already-allocated buffer, writing past its end and corrupting adjacent memory.
Fix by ensuring exit addr is non-zero before treating it as in-range, so pass-0 always falls through to bpf jit build epilogue() and conservatively accounts for all epilogue instructions in alloclen. Also range check alt exit addr directly in the else-if condition.
Since exit addr handling now falls through to the epilogue, two related issues in bpf int jit compile() must also be addressed:
  1. Reset cgctx.alt exit addr before the second size-calculation pass. Without this, a stale alt exit addr from the first pass causes the second pass to emit a single jump instead of the full epilogue, undercounting alloclen and reintroducing the overflow.
  2. Recompute addrs[fp->len] at the end of each code-generation pass. The larger pass-0 body can shrink in later passes as out-of-range exits settle into in-range jumps; a stale addrs[fp->len] would leave exit branches targeting past the real (shrunken) epilogue.
Because shrinkage in a later pass can move the epilogue offset, the fixed two-pass loop is no longer sufficient: an exit that was out of range in an earlier pass may fall in range once the epilogue offset shrinks, shrinking the body further and overwriting the start of the epilogue. Convert the code-generation loop to iterate until the program size converges, bounded by CODEGEN MAX PASSES, and fail the JIT if it does not converge.
Vendors
Affected products
Related identifiers
Found an issue in the description? Have something to add? Feel free to write us 👾