CVE-2026-139307: Linux kernel binds a BPF program to a network device that is already being unregistered

ByLinuxtastic

December 2, 2026 #CVE, #Linux Kernel

A BPF program can be loaded bound to a particular network device, so that device-specific kfuncs resolve against it or the program can be offloaded to the NIC. The kernel CNA record describes a race in that binding: bpf_prog_dev_bound_init() looks the device up and takes a reference, but “the reference it holds does not keep the device registered. If bpf_dev_bound_netdev_unregister() has run by the time the lock is taken, nobody takes the program off the device any more”, and the per-device bookkeeping ends up pointing at “a net_device that is freed as soon as the reference is dropped.” The verifier then dereferences it while checking the program, and a later device allocated at the same address inherits the stale entry. Red Hat rates it Important at 7.8 as a local escalation for anyone allowed to load such programs. On hosts where unprivileged BPF is enabled or where tenants hold CAP_BPF, upgrade to 6.6.163, 6.12.119, 6.18.65, 7.3.6 or later and reboot.

CVE-2026-139307 at a glance.

ComponentLinux kernel, BPF device-bound program support (kernel/bpf/offload.c: bpf_prog_dev_bound_init(), bpf_dev_bound_netdev_unregister() and bpf_dev_bound_resolve_kfunc()), built into every kernel with CONFIG_BPF_SYSCALL and CONFIG_NET
Affected versionsfrom 2b3486bc2d23, the 6.3 commit that generalised NIC offload into device-bound programs: 6.3 up to 6.6 before 6.6.163, 6.12 before 6.12.119, 6.18 before 6.18.65, 7.3 before 7.3.6 and 7.4 before 7.4-rc1; the 5.10, 5.15 and 6.1 series predate the change and are not affected
Fixed inmainline 7.4-rc1 (commit af929bc9, “Don’t bind a program to a netdev that goes away”: the registration state is read under bpf_devs_lock and a device that is unregistering is treated “like one that is not there”) and stable 6.6.163, 6.12.119, 6.18.65, 7.3.6; five commits in the record
SeverityRed Hat Important, CVSS 3.1 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, draft, CWE-825 expired pointer dereference), bug 2587272 “Use-after-free in eBPF subsystem via race condition during network device unregistration”; the kernel CNA gives no score and NVD (Received, 30 November) carries none; Ubuntu Medium; SUSE could not be read on 2 December 2026
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS 0.00201 (10th percentile) on 1 December 2026
Who is exposedHosts where a non-root principal can both load a device-bound BPF program (BPF_PROG_LOAD with prog_ifindex) and cause a network device to unregister, which a user namespace with its own veth or a container runtime tearing down pods provides. Red Hat’s statement: the race “requires specific timing”, and on default RHEL 8 and 9 unprivileged eBPF is disabled, “limiting the attack to privileged accounts”; RHEL 9 and 10 kernels are affected, RHEL 8 is not. Kubernetes nodes running Cilium, Calico-eBPF or similar are the environment where device-bound loads and interface churn coincide
PublishedCVE record 30 November 2026 (kernel CNA); this page built 2 December 2026, last updated 2 December 2026

What it is

When a program is loaded with an interface index, bpf_prog_dev_bound_init() finds the net_device, takes bpf_devs_lock, and records the program against a per-device bpf_offload_netdev structure so that the device’s own kfuncs can be resolved and so that, when the device goes away, every program bound to it can be detached. The detach side, bpf_dev_bound_netdev_unregister(), runs from the netdev unregistration notifier and also takes bpf_devs_lock. The ordering problem is that unregister_netdevice_many_notify() “leaves NETREG_REGISTERED before it calls bpf_dev_bound_netdev_unregister()”, and the lookup in the init path holds only a reference, which keeps the memory alive but does not stop the device from unregistering.

So if the unregister notifier has already run when the init path takes the lock, the device’s entry has already been torn down, the program is added to bookkeeping that nothing will ever clean up, and the pointers in bpf_offload_netdev and offload->netdev refer to a device that is freed when the init path drops its reference. The record names two consequences: bpf_dev_bound_resolve_kfunc() “dereferences it while the program is verified”, a use-after-free during the load itself, and “a new device at the same address finds the old entry”, so a later interface, allocated in the same slab slot, is treated as the dead one. The first gives a local user a kernel read of freed memory; the second is the confusion that the escalation score rests on.

The fix in kernel/bpf/offload.c checks the device’s reg_state under bpf_devs_lock and refuses to bind to one that is on its way out, which closes the window because the unregister path takes the same lock. git.kernel.org refuses automated readers, so the diff is described from the CNA’s copy of the commit message.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 2 December 2026; the link in the row is the tracker page, which will be newer than this one. The code is in every 6.3 or later kernel; who can reach it depends on the BPF policy.

DistributionStatusFixed package
AlpineNot consulted for this page—
Debianbookworm (6.1.192-3) not affected, “vulnerable code not present”; trixie (6.12.117-1, security 6.12.118-1) vulnerable; forky and sid (7.3.6-1) fixed; no DSAunstable 7.3.6-1
UbuntuMedium; the linux package is needs evaluation on every release from 14.04 to 26.10 on 2 December 2026, nothing released; by the record 22.04’s 5.15 kernel is outside the rangenothing on 2 December 2026
RHEL, Rocky, Alma, CentOS StreamImportant, 7.8 (bug 2587272, CWE-825); kernel affected in RHEL 9 and 10 and in the OpenShift 4 RHEL 9 and OpenShift 5 RHCOS images; RHEL 6, 7, 8 and kernel-rt not affected; no errata on 2 December 2026—
openSUSE/SLENot consulted: suse.com refused the automated reader on 2 December 2026 (client error)—
Fedora, Arch; self-built kernelsNot consulted; upstream stable versions apply. 6.1 and earlier are outside the range6.6.163 / 6.12.119 / 6.18.65 / 7.3.6 or later

How to check

Is the kernel in range, can anyone other than root load BPF programs, and does the host see interface churn from untrusted principals. The second question is the gate on most servers.

# 1. the running kernel: affected from 6.3, fixed in 6.6.163, 6.12.119, 6.18.65, 7.3.6 or later
uname -r

# 2. who can load BPF programs: 2 = root/CAP_BPF only, 0 = any user, 1 = disabled for unprivileged until reboot
sysctl kernel.unprivileged_bpf_disabled
# containers and services holding CAP_BPF or CAP_SYS_ADMIN (the former is enough to load; the latter implies it)
for p in /proc/[0-9]*; do c=$(grep CapEff $p/status 2>/dev/null | awk '{print $2}'); [ -n "$c" ] && echo "$c $(cat $p/comm 2>/dev/null)"; done | sort | uniq -c | sort -rn | head
# user namespaces: an unprivileged user who can create one can create and delete a veth inside it
sysctl user.max_user_namespaces kernel.unprivileged_userns_clone 2>/dev/null

# 3. are device-bound programs in use at all (offloaded or dev-bound programs show a dev field)
bpftool prog show 2>/dev/null | grep -E 'offloaded|dev ' 

A kernel before 6.3 is not affected. On an affected kernel with unprivileged_bpf_disabled=2 and no containers holding CAP_BPF, only root can start the race, and root does not need it; that is the position Red Hat describes for default RHEL. A node where a CNI agent or a tenant workload holds CAP_BPF and interfaces are created and destroyed constantly is where “specific timing” is met routinely rather than engineered, and step 3 tells you whether device-bound loads happen on this host at all.

How to fix it

Update the kernel and reboot. The interim is to keep BPF loading privileged and to make sure nothing untrusted holds CAP_BPF.

# Debian forky / sid (7.3.6-1) carry the fix; trixie: watch the tracker row above; bookworm is not affected
apt update && apt install linux-image-amd64 && systemctl reboot
# RHEL 9 / 10, Rocky, Alma: no errata yet on 2 December 2026; when the advisory lands
dnf update kernel && systemctl reboot
# Ubuntu: needs evaluation on 2 December 2026; once the linux package is released
apt update && apt install linux-generic && systemctl reboot
# Interim: BPF for root only (2 is the distribution default on most systems; 1 cannot be undone without a reboot)
sysctl -w kernel.unprivileged_bpf_disabled=2
echo 'kernel.unprivileged_bpf_disabled = 2' > /etc/sysctl.d/90-bpf.conf
# and audit containers for CAP_BPF: in Kubernetes, drop it from pods that do not run the CNI

What not to do: do not remove CAP_BPF from the CNI agent itself, which breaks networking on the node and does not remove the agent’s own exposure; the agent is trusted and the fix for it is the kernel. Do not read Debian’s bookworm row as covering trixie: the vulnerable code arrived in 6.3, so the 6.1 kernel is safe and the 6.12 one is not.

Sources

  • CVE-2026-139307 at CVE.org — the kernel CNA record: the lookup and lock ordering, the two consequences, the version ranges (30 November 2026)
  • Fix commit af929bc9 (mainline 7.4-rc1, the commit Debian cites) and the stable backports b57c1562, fb32cc5f, ad08e9c9, 5566537a; git.kernel.org refuses automated readers, so the diff is described from the CNA’s copy of the commit message
  • NVD entry — Received on 30 November 2026; no CVSS metric, CWE or CPE on 2 December 2026
  • Distribution trackers: Debian (bookworm not affected, trixie vulnerable, unstable fixed in 7.3.6-1) · Red Hat (Important 7.8, bug 2587272, CWE-825; RHEL 9 and 10 affected, 8 and earlier not; the statement on unprivileged eBPF being disabled by default) · Ubuntu (Medium, needs evaluation; read from the HTML page, the JSON endpoint refused) · SUSE (refused the automated reader on 2 December 2026)
  • CISA KEV catalogue 2026.11.30, not listed · EPSS 0.00201 (percentile 0.105) on 1 December 2026

Related reading

This advisory page was assembled from the primary sources listed above on 2 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.