KernelScan.io

HIGH Introduced in 5.8

bpf NetnsLink UAF

CVE-2026-90393

CVSS 7.8 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H

01

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix potential UAF in bpf_netns_link_update_prog In bpf_netns_link_update_prog, the checks for old_prog and prog type are currently performed locklessly before acquiring netns_bpf_mutex. This creates a race condition that can lead to a UAF issue. If two threads concurrently execute BPF_LINK_UPDATE on the same netns link, the following execution path can trigger a UAF: CPU0 CPU1 bpf_netns_link_update_prog if (old_prog && old_prog != link->prog) return -EPERM; bpf_netns_link_update_prog if (old_prog && old_prog != link->prog) ... old_prog = xchg(&link->prog, new_prog); bpf_prog_put(old_prog); if (new_prog->type != link->prog->type) <-- trigger UAF Fix this by moving the old_prog and prog->type checks inside the netns_bpf_mutex critical section. Meanwhile, use guard() to simplify lock management and avoid all the goto jumping.

02

Engine v0.6.0

Risk summary

A local attacker with BPF and network namespace capabilities can exploit a race condition in the BPF network namespace link update path to trigger a use-after-free, potentially achieving arbitrary kernel read/write and container escape. Systems that allow unprivileged BPF or run multi-tenant container workloads are at highest risk. The race requires concurrent BPF_LINK_UPDATE calls on the same link, making exploitation non-trivial but feasible.

Affectedkernel/bpf/net_namespace.c (bpf netns link)

Vulnerability analysis

A race condition exists in the BPF network namespace link update path where validation checks on the currently attached program are performed without holding the protecting mutex. When two threads concurrently update the same link, one thread can read a stale program pointer while another thread swaps in a replacement and frees the old program, causing the first thread to dereference freed memory. The fix moves all validation checks inside the mutex critical section so they execute atomically with the program swap, eliminating the window where a freed pointer can be accessed. The vulnerable path is reached locally through the bpf() syscall by a process holding BPF and network administration capabilities, which may be obtainable inside a user namespace on systems where unprivileged BPF is not disabled.

03

BranchIntroducedFixed inPatch commit
5.105.85.10.270d462b5481d77
5.155.85.15.221bdddf3e1493e
6.15.86.1.18879a66fd997d4
6.185.86.18.52bda86e9f31b9
mainline5.87.3-rc15c5997836381
6.125.86.12.110277168cb9d15
7.25.87.2.6923f559e95b8
6.65.86.6.157f4ce6803df40
cip/6.125.86.12.111-cip32277168cb9d15