All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Junyoung Jang" <graypanda.inzag@gmail.com>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Neal Cardwell" <ncardwell@google.com>
Cc: "Gwanhyun Lee" <gwanhyunlee@gmail.com>,
	"Kuniyuki Iwashima" <kuniyu@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Jakub Sitnicki" <jakub@cloudflare.com>,
	"Jiayuan Chen" <jiayuan.chen@linux.dev>, <netdev@vger.kernel.org>,
	<bpf@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] tcp: avoid NULL skb dereference in zerocopy receive with sockmap
Date: Tue, 24 Nov 2026 23:28:01 +0000	[thread overview]
Message-ID: <DN3TX43KWXO5.JWLJ9HO1C9K7@gmail.com> (raw)
In-Reply-To: <20261124230228.3868519-1-graypanda.inzag@gmail.com>

On Tue, Nov 24, 2026 at 03:02 PM Junyoung Jang <graypanda.inzag@gmail.com> 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

  reply	other threads:[~2026-11-24 23:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 23:02 [PATCH net] tcp: avoid NULL skb dereference in zerocopy receive with sockmap Junyoung Jang
2026-11-24 23:28 ` Alexei Starovoitov [this message]
2026-11-25 10:03   ` Junyoung Jang
2026-11-26 12:53   ` Junyoung Jang
2026-11-25 23:02 ` sashiko-bot
2026-11-28 23:20 ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DN3TX43KWXO5.JWLJ9HO1C9K7@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=graypanda.inzag@gmail.com \
    --cc=gwanhyunlee@gmail.com \
    --cc=horms@kernel.org \
    --cc=jakub@cloudflare.com \
    --cc=jiayuan.chen@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.