BPF verifier now rejects stale borrowed pointers
CVE-2026-139204 covers iterator results and trusted field loads that outlived the objects they were borrowed from.
The Linux kernel BPF verifier now treats borrowed iterator results as tied to the current element by default, closing CVE-2026-139204. Greg Kroah-Hartman announced the fix on the kernel CVE list.
An open-coded iterator can return a struct pointer borrowed from the element it is visiting. Since the task_vma iterator was introduced, the verifier has not associated those results with iterator state, so a saved pointer could still be used after destroy. Switching that iterator from a process-wide mmap lock to per-VMA locks also made advancing it drop protection on the previous element, and a later snapshot conversion marked vm_file as explicitly borrowed from that element.
Non-RCU, non-acquired struct results are now dependents of the iterator reference. They are invalidated before the iterator advances, and destroy propagates errors from those child references. A new flag marks results allowed to outlive the current element. Existing RCU and acquired-reference rules stay in place.
The same lifetime rule applies to trusted field loads, including ones unrelated to iterators. Loading such a field does not take its own reference, so releasing the source must invalidate the derived pointer. A program that obtains a task's executable file, reads its inode, drops the file, and then reads the inode number is now rejected. Reading the inode while the file reference is still held remains valid. Fields with their own RCU protection keep their existing rules. Dynptr construction also carries the backing object's lifetime.