Re: [PATCH net] tcp: avoid NULL skb dereference in zerocopy receive with sockmap

From: Junyoung Jang

Date: Thu Nov 26 2026 - 07:53:23 EST


Hi Alexei,

I noticed Kyuwon Cho already reported the ingress_msg copied_seq issue
last week ("bpf, sockmap: data left in ingress_msg is dropped without
moving copied_seq, and TLS RX then warns"), so I'll drop this patch to
avoid duplicating work.

Thanks,
Junyoung

On Wed, Nov 25, 2026 at 8:28 AM Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
>
> 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