HIGH Introduced in 5.2
bpf Syncookie Deref
CVE-2026-80738
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L
KernelScan AI5.5MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Check sk_state before sk_protocol in bpf_tcp_*_syncookie bpf_tcp_gen_syncookie and bpf_tcp_check_syncookie accept a socket pointer 'sk' with argument type ARG_PTR_TO_BTF_ID_SOCK_COMMON. However, they access sk->sk_protocol without validating whether 'sk' represents a full socket. Fix this issue by checking sk->sk_state != TCP_LISTEN before inspecting sk->sk_protocol in both bpf_tcp_gen_syncookie and bpf_tcp_check_syncookie. Since mini-sockets are never in the TCP_LISTEN state, the condition short-circuits and prevents dereferencing fullsock-specific fields.
02KernelScan AI Analysis
Risk summary
A BPF helper for TCP SYN cookie operations accepts a socket pointer that may be a mini-socket, then dereferences a field only valid for full sockets. An attacker with BPF program loading privileges can trigger a kernel crash.
Vulnerability analysis
A helper used for TCP SYN cookies accepts generic socket pointers that may refer to lightweight mini-sockets instead of full sockets. The helper originally read a field that exists only on full sockets before confirming the socket was in the listening state. When passed a mini-socket, this read accessed invalid memory and crashed the kernel. The corrected code checks the listening state first; because mini-sockets are never listening, the helper exits safely before reaching the invalid access. Any process able to load a BPF program can reach this path.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 7.1 | 5.2 | 7.1.9 | 23f682083aa3 |
| mainline | 5.2 | 7.2 | 31a420a822ff |