CVE-2026-138941

Not scored yetLast modified Nov 30, 2026

Description

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.

Metrics

No CVSS score has been published yet.

Affected software

Source: the vendor's advisory (CNA). NVD analysis pending.

No affected versions have been published.

Timeline

Published
Nov 30, 2026
Last modified
Nov 30, 2026
NVD status
Received

Related CVEs from 2026

CVE-2026-138942In the Linux kernel, the following vulnerability has been resolved: powerpc64/bpf: fix percpu private stack leak on JIT failure The existiCVE-2026-138943In the Linux kernel, the following vulnerability has been resolved: media: iris: Fix iova allocation from restrict region The VPU issues DCVE-2026-138944In the Linux kernel, the following vulnerability has been resolved: media: venus: Fix iova allocation from restrict region The VPU issues CVE-2026-138945In the Linux kernel, the following vulnerability has been resolved: media: qcom: camss: vfe: Fix VFE reset while another line is streaming CVE-2026-138946In the Linux kernel, the following vulnerability has been resolved: cxl/acpi: Check ACPI companion before use Platform drivers can be forcCVE-2026-138947In the Linux kernel, the following vulnerability has been resolved: fs/ntfs3: fix integer overflow in find_log_rec() causing OOB read findCVE-2026-138948In the Linux kernel, the following vulnerability has been resolved: iio: accel: sca3000: reject devices without match data SPI driver_overCVE-2026-138949In the Linux kernel, the following vulnerability has been resolved: iio: accel: adxl380: reject devices without match data SPI driver_overCVE-2026-138954.2Inappropriate implementation in Autofill in Google Chrome prior to 150.0.7871.47 allowed a remote attacker who convinced a user to engage inCVE-2026-138950In the Linux kernel, the following vulnerability has been resolved: iio: accel: adxl372: reject devices without match data SPI driver_overCVE-2026-138951In the Linux kernel, the following vulnerability has been resolved: iio: accel: adxl313: reject devices without match data SPI driver_overCVE-2026-138952In the Linux kernel, the following vulnerability has been resolved: iio: adc: ti-ads7950: validate SPI match data SPI driver_override allo
CVE-2026-138941: Unscored | Vulnix