In the Linux kernel, the following vulnerability has been resolved:
bpf: Check skstate before skprotocol in bpftcp*_syncookie
bpftcpgensyncookie and bpftcpchecksyncookie accept a socket pointer 'sk' with argument type ARGPTRTOBTFIDSOCKCOMMON. However, they access sk->sk_protocol without validating whether 'sk' represents a full socket.
Fix this issue by checking sk->skstate != TCPLISTEN before inspecting sk->skprotocol in both bpftcpgensyncookie and bpftcpchecksyncookie. Since mini-sockets are never in the TCPLISTEN state, the condition short-circuits and prevents dereferencing fullsock-specific fields.