The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: bpf@vger.kernel.org
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	Jakub Sitnicki <jakub@cloudflare.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Neal Cardwell <ncardwell@google.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	Shuah Khan <shuah@kernel.org>, Sechang Lim <rhkrqnwk98@gmail.com>,
	Mattia Meleleo <mattia.meleleo@coralogix.com>,
	Michal Luczaj <mhal@rbox.co>,
	Zijian Zhang <zijianzhang@bytedance.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH bpf v3 0/9] fix misc sockmap issues
Date: Wed,  2 Dec 2026 22:30:39 +0800	[thread overview]
Message-ID: <20261202143337.400831-1-jiayuan.chen@linux.dev> (raw)

This series fixes misc issues in sockmap. Most of them are old.

Patches 1-2 fix copied_seq when a strparser is attached and SK_PASS data
is left unread, with a selftest. It was reported by Vega and comes from
my earlier fix, commit 36b62df5683c ("bpf: Fix wrong copied_seq
calculation").

Patch 3 is an old issue I ran into while reading the code:

  03  an ingress redirect queues an empty sk_msg

The rest (patches 4-9) are the old issues that came up in the
review of Alexei's sockmap series [1]. They are not from that series, so
they were left for a follow-up.

Patch 04 makes a second concurrent sender wait on a mutex like TLS
does, and patch 05 rejects connect() after a disconnect with
-EOPNOTSUPP. Both change what user space sees, see the commit messages
for why.

[1] https://lore.kernel.org/bpf/20261102072112.4160195-1-alexei.starovoitov@gmail.com/



v2 -> v3: rebase bpf tree

Jiayuan Chen (9):
  bpf, sockmap: Fix copied_seq updates with strparser
  selftests/bpf: Add test for unread SK_PASS data with strparser
  bpf, sockmap: Fix empty sk_msg queued by ingress redirect
  bpf, sockmap: Fix concurrent senders on one psock
  bpf, sockmap: Fix reconnect with a psock by rejecting connect
  bpf, sockmap: Fix socket lock taken on a child before accept()
  bpf, sockmap: Fix apply_bytes when a redirect sends only a part
  selftests/bpf: Fix errno expected by the wait send mem test of
    test_sockmap
  selftests/bpf: Add test for apply_bytes when a redirect sends a part

 include/linux/skmsg.h                         |   1 +
 net/core/skmsg.c                              |  28 +++-
 net/core/sock_map.c                           |  27 +++-
 net/ipv4/tcp_bpf.c                            |  92 ++++++++++---
 .../selftests/bpf/prog_tests/sockmap_basic.c  | 126 ++++++++++++++++++
 .../selftests/bpf/prog_tests/sockmap_strp.c   | 109 +++++++++++++++
 .../bpf/progs/test_sockmap_msg_apply.c        |  46 +++++++
 tools/testing/selftests/bpf/test_sockmap.c    |   3 +-
 8 files changed, 406 insertions(+), 26 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_msg_apply.c

-- 
2.43.0


             reply	other threads:[~2026-12-02 14:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 14:30 Jiayuan Chen [this message]
2026-12-02 14:30 ` [PATCH bpf v3 1/9] bpf, sockmap: Fix copied_seq updates with strparser Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 2/9] selftests/bpf: Add test for unread SK_PASS data " Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 3/9] bpf, sockmap: Fix empty sk_msg queued by ingress redirect Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 4/9] bpf, sockmap: Fix concurrent senders on one psock Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 5/9] bpf, sockmap: Fix reconnect with a psock by rejecting connect Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 6/9] bpf, sockmap: Fix socket lock taken on a child before accept() Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 7/9] bpf, sockmap: Fix apply_bytes when a redirect sends only a part Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 8/9] selftests/bpf: Fix errno expected by the wait send mem test of test_sockmap Jiayuan Chen
2026-12-02 14:30 ` [PATCH bpf v3 9/9] selftests/bpf: Add test for apply_bytes when a redirect sends a part Jiayuan Chen

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=20261202143337.400831-1-jiayuan.chen@linux.dev \
    --to=jiayuan.chen@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=emil@etsalapatis.com \
    --cc=horms@kernel.org \
    --cc=ihor.solodrai@linux.dev \
    --cc=jakub@cloudflare.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mattia.meleleo@coralogix.com \
    --cc=memxor@gmail.com \
    --cc=mhal@rbox.co \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rhkrqnwk98@gmail.com \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=willemb@google.com \
    --cc=yonghong.song@linux.dev \
    --cc=zijianzhang@bytedance.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox