CVE-2026-139308

bpf: Fix stale offload->prog pointer after realloc

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: Fix stale offload->prog pointer after realloc

bpf_prog_realloc() moves a program that the rewrites of the verifier make
outgrow its pages. It updates aux->prog, but not the offload->prog of a
device-bound program. When the device is unregistered,
__bpf_offload_dev_netdev_unregister() hands the stale pointer to
__bpf_prog_offload_destroy(), which faults on the freed program:

BUG: unable to handle page fault for address: ffffc90000071050
RIP: 0010:__bpf_prog_offload_destroy+0x3f/0x310

It takes the right to load a device-bound XDP program, CAP_BPF and
CAP_NET_ADMIN or a BPF token, and a device that can be removed.

Commit a1aa9ef47c29 ("bpf: Fix stale offload->prog pointer after constant
blinding") repaired the other place that replaces a program. Do the same
here.

Nothing keeps the device while a program is loaded, so it can also be
unregistered at that very moment. That frees the offload, and it may have
read offload->prog already when the old copy of the program is freed. In
both places update the pointer under bpf_devs_lock, before the old copy
goes.

Analysis

AI-generated

Technical impact

This vulnerability occurs in the Linux kernel’s BPF subsystem when a BPF program that is bound to a network device is reallocated. The reallocation updates the program reference in the verifier but fails to update the corresponding offload pointer in the device context. When the device is unregistered while the program is still active, the obsolete pointer is passed to the destructor, causing a page fault and a kernel crash. The effect is a denial of service through a kernel panic, disrupting all services that depend on the affected kernel instance.

Affected Systems

The flaw affects all versions of the Linux kernel prior to the inclusion of the fix commit. It applies to all Linux vendors that ship kernel code containing the BPF and XDP path. Administrators should consider the latest stable kernel for their distributions as the remedy.

Risk and Exploitability

The CVSS score is not supplied, but the exploit requires local or privileged access with CAP_BPF and CAP_NET_ADMIN or a BPF token, coupled with the ability to remove a network device while a BPF program is attached. Because it results in a crash and does not provide privilege escalation or data exfiltration, the risk can be considered moderate, contingent on local attack feasibility. EPSS information is unavailable, and the vulnerability is not listed in the CISA KEV catalog, but the use‑after‑free nature warrants defensive action.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply an updated Linux kernel that contains the patch for this issue.
  • Reboot the system to enter the patched kernel if it is not running automatically.
  • Avoid unbinding or removing network devices while XDP or other device‑bound BPF programs are active.

Generated by OpenCVE AI on November 30, 2026 at 21:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Fix stale offload->prog pointer after realloc bpf_prog_realloc() moves a program that the rewrites of the verifier make outgrow its pages. It updates aux->prog, but not the offload->prog of a device-bound program. When the device is unregistered, __bpf_offload_dev_netdev_unregister() hands the stale pointer to __bpf_prog_offload_destroy(), which faults on the freed program: BUG: unable to handle page fault for address: ffffc90000071050 RIP: 0010:__bpf_prog_offload_destroy+0x3f/0x310 It takes the right to load a device-bound XDP program, CAP_BPF and CAP_NET_ADMIN or a BPF token, and a device that can be removed. Commit a1aa9ef47c29 ("bpf: Fix stale offload->prog pointer after constant blinding") repaired the other place that replaces a program. Do the same here. Nothing keeps the device while a program is loaded, so it can also be unregistered at that very moment. That frees the offload, and it may have read offload->prog already when the old copy of the program is freed. In both places update the pointer under bpf_devs_lock, before the old copy goes.
Title bpf: Fix stale offload->prog pointer after realloc
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:33 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM