CVE-2026-138941: powerpc/bpf: fix buffer overflow in JIT for large BPF programs

Published Nov 30, 2026
·
Updated

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, exitaddr is 0 since addrs[fp->len] is not yet populated. bpfjitemitexitinsn() treats a zero exitaddr as in-range and skips bpfjitbuildepilogue(), so the alternate inline epilogue instructions are not counted in alloclen.

In later passes, if the real exitaddr 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 exitaddr is non-zero before treating it as in-range, so pass-0 always falls through to bpfjitbuildepilogue() and conservatively accounts for all epilogue instructions in alloclen. Also range check altexitaddr directly in the else-if condition.

Since exitaddr handling now falls through to the epilogue, two related issues in bpfintjitcompile() must also be addressed:

1. Reset cgctx.altexitaddr before the second size-calculation pass. Without this, a stale altexitaddr 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 CODEGENMAXPASSES, and fail the JIT if it does not converge.

Affected Software

10 affected componentsFixes available
Linux Linux kernel
linux/kernel>=5.18.0<6.1.193
6.1.193
linux/kernel>=6.2.0<6.6.163
6.6.163
linux/kernel>=6.7.0<6.12.118
6.12.118
linux/kernel>=6.13.0<6.18.64
6.18.64
linux/kernel>=6.19.0<7.3.4
7.3.4
debian/linux*
debian/linux<6.12.118-1
6.12.118-1
debian/linux<7.3.4-1
7.3.4-1
debian/linux<=6.1.176-1, <=6.1.192-3, <=6.12.117-1
6.12.118-17.3.4-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.1.193
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.6.163
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.118
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.64
  5. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.4
  6. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.118-1
  7. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 7.3.4-1
  8. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.118-1Fixed in 7.3.4-1

Event History

Nov 30, 2026
CVE Published
via MITRE·01:26 PM
Data Sourced
via MITRE·01:26 PM
Description
Data Sourced
via OSV·01:26 PM
DescriptionAffected Software
Data Sourced
via NVD·02:17 PM
Description

Frequently Asked Questions

1

Which systems are exposed to this issue?

The issue affects Linux kernel systems using the PowerPC BPF JIT compiler. The overflow condition is associated with large BPF programs and an exit branch whose target is outside the 32 MB branch range.

2

What is the impact when the vulnerable JIT path is reached?

The JIT can emit a full inline epilogue into a buffer that was allocated too small during size calculation. This writes past the end of the JIT buffer and can corrupt adjacent memory.

3

What condition causes the allocation to be undersized?

During the initial size-calculation pass, exit_addr is zero because the address table has not yet been populated. It is incorrectly treated as in range, causing the inline epilogue instructions to be omitted from the calculated allocation length.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203