CVE-2026-139623

bpf: Adjust pc-relative insn copied into its own patch

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

bpf: Adjust pc-relative insn copied into its own patch

bpf_do_misc_fixups() inits may_goto count by patching the first insn
of a subprog with [ST, ST, first insn]. bpf_convert_ctx_accesses()
patches insn that needs a barrier with [nospec, insn].
bpf_adj_branches() doesn't adjust insns inside the patch, so when
the copy is a call, ld_imm64 of a func or a jump that points backward
its target is off by the number of insns in front of it:

static int A(void) { return 1; }
static int A2(void) { return 2; }
static int B(void)
{
int i, ret = A();

for (i = 0; i < 10 && can_loop; i++)
...
return ret;
}

When A is placed in front of B and may_goto is timed 'call A' becomes
call of A + 2. B returns 2 when A + 2 is the start of A2. Otherwise
the prog is rejected with "verifier bug: No program to jit at insn".

Add bpf_adj_moved_insn() and use it for both copies.

Analysis

AI-generated

Technical impact

In the Linux kernel’s BPF subsystem, a bug existed where PC‑relative instructions copied into their own patch were not correctly adjusted. Functions such as bpf_do_misc_fixups, bpf_convert_ctx_accesses, and bpf_adj_branches failed to recalculate branch targets when an instruction was pasted as part of a subprogram. The result is that a call or jump can resolve to an unintended address, causing a BPF program either to execute incorrect code paths or to be rejected by the verifier with a “verifier bug: No program to jit at insn” error.

Affected Systems

The vulnerability resides in the core BPF verifier code of the Linux kernel. Any Linux kernel version that contains the unpatched implementation is affected, including most current releases prior to the commit that introduces bpf_adj_moved_insn. Consequently, all distributions that ship unmodified kernel code without the patch are at risk. Affected kernels span all mainstream distributions unless they have applied the relevant upstream changes.

Risk and Exploitability

The vulnerability can be triggered by loading a crafted BPF program that copies a subprogram containing PC‑relative instructions into its own patch. An attacker must have the ability to submit BPF code to the kernel, which generally requires local or privileged access. With such access, the kernel may reject the program or redirect execution to an unintended instruction, leading to a denial‑of‑service or unintended behavior within the privileged context of the kernel. No EPSS score is provided and the issue is not listed in the CISA KEV catalog. While the likelihood of widespread exploitation remains uncertain without a public exploit, the potential impact is significant for systems that allow arbitrary BPF code loading.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the kernel to a version containing the bpf_adj_moved_insn commit that corrects offset calculations.
  • Restrict BPF program loading to trusted users or enforce policy that only approved code can be loaded, thereby preventing malicious custom programs.
  • Monitor kernel logs for verifier error messages such as “verifier bug: No program to jit at insn” and audit any load failures to detect attempts to exploit the bug.

Generated by OpenCVE AI on December 1, 2026 at 00:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-665
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Adjust pc-relative insn copied into its own patch bpf_do_misc_fixups() inits may_goto count by patching the first insn of a subprog with [ST, ST, first insn]. bpf_convert_ctx_accesses() patches insn that needs a barrier with [nospec, insn]. bpf_adj_branches() doesn't adjust insns inside the patch, so when the copy is a call, ld_imm64 of a func or a jump that points backward its target is off by the number of insns in front of it: static int A(void) { return 1; } static int A2(void) { return 2; } static int B(void) { int i, ret = A(); for (i = 0; i < 10 && can_loop; i++) ... return ret; } When A is placed in front of B and may_goto is timed 'call A' becomes call of A + 2. B returns 2 when A + 2 is the start of A2. Otherwise the prog is rejected with "verifier bug: No program to jit at insn". Add bpf_adj_moved_insn() and use it for both copies.
Title bpf: Adjust pc-relative insn copied into its own patch
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:36 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM