CVE-2026-139303: bpf: Assume no bounds for buffers behind a tail call
In the Linux kernel, the following vulnerability has been resolved:
bpf: Assume no bounds for buffers behind a tail call
The bpfmapelem, bpfskstoragemap and sockmap iterators hand the key and the value of an element to the program as buffers. The verifier notes how far a program reaches into them, and the iterator compares that with the map when the program is attached. A program that does not touch the buffers passes. It can tail-call another program of the same target, which gets the same context, and whose reach nobody compares with the map:
BUG: KASAN: slab-out-of-bounds in bpfprogrun+0xa46a/0xae80
The program array can be filled at any time, so there is nothing to look at when the link is made. For the same reason a program with a tail call is taken to use the whole stack and the whole packet. Take it to reach as far as can be into the buffers as well, so that these iterators refuse it with -EACCES.
Affected Software
Event History
Frequently Asked Questions
What conditions are required to trigger this issue?
An eBPF iterator program for bpf_map_elem, bpf_sk_storage_map, or sockmap must avoid directly accessing the iterator-provided key or value buffers, then tail-call another program of the same target that accesses them. The program array used for the tail call can be populated after the iterator program is attached.
What is the practical impact of successful exploitation?
The described result is a KASAN-detected slab out-of-bounds access while executing an eBPF program. The vulnerable validation path can allow a tail-called program to access iterator key or value buffers farther than the attached map permits.
How does the fix prevent the unsafe attachment?
Programs containing a tail call are treated as potentially reaching as far as possible into the iterator-provided buffers. The affected iterators then reject incompatible program attachments with -EACCES.