CVE-2026-139635

bpf: Keep target extended until its last freplace link detaches

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: Keep target extended until its last freplace link detaches

The is_extended / prog_array_member_cnt protocol introduced by commit
d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace")
keeps a prog extended by a freplace program out of prog_array maps, and
vice versa: once a tail call re-enters an extended subprogram, its
tail_call_cnt resets on every execution and the loop never terminates.

But is_extended is a plain boolean, while one target prog can carry
several freplace links at the same time, one on its entry and one on a
global subprogram. __bpf_trampoline_unlink_prog() cleared is_extended
whenever *any* freplace link detached, so detaching one of two links
re-armed the unbounded loop through the remaining one.

Replace the is_extended boolean with a count of the freplace links
attached to each target prog, so the target stays extended until its
last link detaches. Also rename bpf_freplace_check_tgt_prog() to
bpf_freplace_link_tgt_prog(), as the helper has never been a pure
check: it reserves the target prog on success.

Analysis

AI-generated

Technical impact

The vulnerability in the Linux kernel BPF subsystem allows an extended target program to remain active after partial detachment, leading to an unbounded tail‑call loop. This logical flaw permits a malicious BPF program that attaches multiple freplace links to cause the kernel to repeat the same tail call without termination, resulting in a denial‑of‑service condition. The weakness is rooted in an improper boolean flag that is cleared when any link detaches rather than tracking the count of attached links.

Affected Systems

The bug affects instances of the Linux kernel where the BPF module has been compiled with support for the freplace feature, prior to the inclusion of the counter‑based extension logic. All distributions shipping kernel code before the applied commit are potentially vulnerable.

Risk and Exploitability

Because the flaw requires an attacker to deploy a crafted BPF program, the attack vector is local or privilege‑elevated from userspace. The CVSS score is not provided, but the lack of publicly known exploits and the absence from the CISA KEV catalog suggest a low EPSS. Nonetheless, the denial‑of‑service impact could disrupt critical services if the exposed kernel is running in production. No known workaround exists; patching the kernel remains the only mitigation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the kernel update that contains the commit replacing the is_extended boolean with a counter.
  • Disable or audit BPF programs that use tail calls and freplace links until an updated kernel is available.
  • If upgrading is delayed, monitor for kernel CPU spikes or lockups that could indicate an unbounded BPF tail call loop.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-674
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Keep target extended until its last freplace link detaches The is_extended / prog_array_member_cnt protocol introduced by commit d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace") keeps a prog extended by a freplace program out of prog_array maps, and vice versa: once a tail call re-enters an extended subprogram, its tail_call_cnt resets on every execution and the loop never terminates. But is_extended is a plain boolean, while one target prog can carry several freplace links at the same time, one on its entry and one on a global subprogram. __bpf_trampoline_unlink_prog() cleared is_extended whenever *any* freplace link detached, so detaching one of two links re-armed the unbounded loop through the remaining one. Replace the is_extended boolean with a count of the freplace links attached to each target prog, so the target stays extended until its last link detaches. Also rename bpf_freplace_check_tgt_prog() to bpf_freplace_link_tgt_prog(), as the helper has never been a pure check: it reserves the target prog on success.
Title bpf: Keep target extended until its last freplace link detaches
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