HIGH Introduced in 6.3
bpf XdpOffload UAF
CVE-2026-53094
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.1HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix stale offload->prog pointer after constant blinding When a dev-bound-only BPF program (BPF_F_XDP_DEV_BOUND_ONLY) undergoes JIT compilation with constant blinding enabled (bpf_jit_harden >= 2), bpf_jit_blind_constants() clones the program. The original prog is then freed in bpf_jit_prog_release_other(), which updates aux->prog to point to the surviving clone, but fails to update offload->prog. This leaves offload->prog pointing to the freed original program. When the network namespace is subsequently destroyed, cleanup_net() triggers bpf_dev_bound_netdev_unregister(), which iterates ondev->progs and calls __bpf_prog_offload_destroy(offload->prog). Accessing the freed prog causes a page fault: BUG: unable to handle page fault for address: ffffc900085f1038 Workqueue: netns cleanup_net RIP: 0010:__bpf_prog_offload_destroy+0xc/0x80 Call Trace: __bpf_offload_dev_netdev_unregister+0x257/0x350 bpf_dev_bound_netdev_unregister+0x4a/0x90 unregister_netdevice_many_notify+0x2a2/0x660 ... cleanup_net+0x21a/0x320 The test sequence that triggers this reliably is: 1. Set net.core.bpf_jit_harden=2 (echo 2 > /proc/sys/net/core/bpf_jit_harden) 2. Run xdp_metadata selftest, which creates a dev-bound-only XDP program on a veth inside a netns (./test_progs -t xdp_metadata) 3. cleanup_net -> page fault in __bpf_prog_offload_destroy Dev-bound-only programs are unique in that they have an offload structure but go through the normal JIT path instead of bpf_prog_offload_compile(). This means they are subject to constant blinding's prog clone-and-replace, while also having offload->prog that must stay in sync. Fix this by updating offload->prog in bpf_jit_prog_release_other(), alongside the existing aux->prog update. Both are back-pointers to the prog that must be kept in sync when the prog is replaced.
02KernelScan AI Analysis
Risk summary
A local user with BPF program loading privileges can trigger a use-after-free when a dev-bound-only XDP program is loaded with JIT hardening enabled and the associated network namespace is later destroyed. The stale pointer dereference in the cleanup path causes a kernel page fault (crash). Because this is a heap use-after-free, the freed object may also be reallocated and controlled by an attacker, exposing an information-disclosure and limited memory-corruption primitive in addition to the denial of service.
Vulnerability analysis
When bpf_jit_blind_constants() clones a dev-bound-only BPF program (BPF_F_XDP_DEV_BOUND_ONLY) during JIT compilation with bpf_jit_harden>=2, bpf_jit_prog_release_other() correctly updates aux->prog to point to the surviving clone but neglects to update offload->prog. This leaves offload->prog pointing to the freed original bpf_prog structure. Later, when the network namespace is torn down, cleanup_net() calls bpf_dev_bound_netdev_unregister(), which iterates over ondev->progs and calls __bpf_prog_offload_destroy(offload->prog) — dereferencing the freed pointer and causing a page fault. The fix adds two lines to bpf_jit_prog_release_other() that update offload->prog to match the surviving prog whenever an offload structure exists, keeping both back-pointers in sync. The attack requires CAP_BPF (or equivalent) to load a BPF program, making this a local low-privilege vulnerability. The condition requires bpf_jit_harden>=2 and a dev-bound XDP program on a veth inside a network namespace that is subsequently destroyed.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.6 | 6.3 | 6.6.141 | a713b72ff88c |
| 6.12 | 6.3 | 6.12.91 | 25484c39d1ec |
| 6.18 | 6.3 | 6.18.33 | 059525cf18e6 |
| 7.0 | 6.3 | 7.0.10 | c79f8503d83d |
| mainline | 6.3 | 7.1 | a1aa9ef47c29 |