CVE-2026-64575 in Linux
Summary
by MITRE • 08/05/2026
In the Linux kernel, the following vulnerability has been resolved:
bpf: tcp: fix double sock release on batch realloc
bpf_iter_tcp_batch() releases the current batch via bpf_iter_tcp_put_batch(), which drops the socket refs and rewrites each slot with the socket cookie, then grows the batch. cur_sk/end_sk are kept for bpf_iter_tcp_resume(), but on realloc failure the function returns ERR_PTR() before resume runs, leaving cur_sk < end_sk over slots that now hold cookies rather than sock pointers. bpf_iter_tcp_seq_stop() then calls bpf_iter_tcp_put_batch() again and dereferences a cookie as a struct sock.
Empty the batch on the failure path so stop() does not release it again. The sockets were already freed by the first bpf_iter_tcp_put_batch(), so nothing leaks, and a later read() rescans the bucket from the start instead of skipping it. The sibling GFP_NOWAIT failure path still holds real socket references and is left for stop() to release.
BUG: KASAN: null-ptr-deref in __sock_gen_cookie Read of size 8 at addr 0000000000000059 by task exploit ... __sock_gen_cookie (net/core/sock_diag.c:28) bpf_iter_tcp_put_batch (net/ipv4/tcp_ipv4.c:2918) bpf_iter_tcp_seq_stop (net/ipv4/tcp_ipv4.c:3270) bpf_seq_read (kernel/bpf/bpf_iter.c:205) vfs_read (fs/read_write.c:572) ksys_read (fs/read_write.c:716) do_syscall_64 entry_SYSCALL_64_after_hwframe Kernel panic - not syncing: Fatal exception
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 08/05/2026
This vulnerability exists in the Linux kernel's BPF (Berkeley Packet Filter) implementation, specifically within the TCP iteration functionality. The issue occurs in the bpf_iter_tcp_batch() function which handles batch processing of TCP sockets. When a memory reallocation operation fails during batch expansion, the function returns an error pointer without properly cleaning up the batch state. This creates a dangerous condition where socket references are dropped twice, leading to potential null pointer dereferences and system instability.
The technical flaw stems from improper state management in the BPF TCP iteration code path. During normal operation, bpf_iter_tcp_batch() processes TCP sockets in batches and releases them via bpf_iter_tcp_put_batch() which properly drops socket references and replaces socket pointers with cookie values. However, when memory allocation fails during batch growth, the function exits early with ERR_PTR() but leaves the batch in an inconsistent state where some slots contain socket cookies rather than actual socket pointers. The cur_sk and end_sk variables are preserved for potential resumption, but this creates a scenario where bpf_iter_tcp_seq_stop() attempts to process what it believes is a valid batch containing socket references, when in reality those slots now contain cookie data.
The operational impact of this vulnerability is severe as demonstrated by the KASAN (Kernel Address Sanitizer) report showing a null pointer dereference in __sock_gen_cookie function. When bpf_iter_tcp_seq_stop() attempts to process the corrupted batch, it treats cookie values as socket pointers, causing a read operation at address 0x0000000000000059 which results in a kernel panic and system crash. This represents a direct denial of service condition that can be exploited to crash the kernel, potentially leading to system unavailability.
The vulnerability aligns with CWE-476 (NULL Pointer Dereference) and demonstrates characteristics consistent with ATT&CK technique T1489 (Service Stop) through its ability to cause kernel-level service disruption. The fix implemented addresses this by ensuring that when reallocation fails, the batch is properly emptied so that bpf_iter_tcp_seq_stop() does not attempt to process corrupted data structures. This prevents the double release scenario while maintaining proper resource cleanup since sockets were already freed during the initial bpf_iter_tcp_put_batch() call, and subsequent reads will simply restart from the beginning of the bucket rather than skipping potentially corrupted entries.
This represents a critical kernel-level vulnerability that affects systems utilizing BPF TCP iteration functionality, particularly those running network monitoring or traffic analysis tools that rely on such mechanisms. The fix ensures proper state cleanup in error paths while maintaining the integrity of socket reference counting and preventing any resource leaks through careful management of the batch processing lifecycle.