Re: [PATCH net] tcp: avoid NULL skb dereference in zerocopy receive with sockmap
From: Alexei Starovoitov
Date: Tue Nov 24 2026 - 18:28:13 EST
On Tue, Nov 24, 2026 at 03:02 PM Junyoung Jang <graypanda.inzag@xxxxxxxxx> wrote:
> Check tcp_recv_skb() before using its result in both paths. Also stop
> before advancing beyond the last skb in sk_receive_queue. Neither
> check consumes data in the sockmap ingress queue.
This should be fixed on bpf side. Other readers trust copied_seq too:
reader with stale copied_seq
--------------------------------- ----------------------------
tcp_recvmsg_locked() WARN "TCP recvmsg seq # bug"
tcp_read_sock() frees new skbs
tcp_collapse() BUG_ON(offset < 0)
tls_strp_load_anchor_with_queue() WARN_ON_ONCE(!first)
pw-bot: cr