MPTCP Linux Development
 help / color / mirror / Atom feed
From: Gang Yan <gang.yan@linux.dev>
To: mptcp@lists.linux.dev
Cc: pabeni@redhat.com, Gang Yan <yangang@kylinos.cn>
Subject: [PATCH mptcp-next v2 0/7] mptcp: add bpf_setsockopt support
Date: Tue, 21 Jul 2026 10:40:55 +0800	[thread overview]
Message-ID: <cover.1784601268.git.yangang@kylinos.cn> (raw)

From: Gang Yan <yangang@kylinos.cn>

Changelog:
v2:
  - Patches 1 and 2 are new in this series; they address TCP_MAXSEG
    handling in the bpf_setsockopt() path [1].
  - Patch 4 adds an early return to fix msk->sk_rcvlowat being
    unexpectedly modified, an issue seen in v1.
  - Patch 5 makes the hook safe for the non-tcp master socket: it guards
    bpf_sock_ops_cb_flags_set() with sk_is_tcp() to prevent out-of-bounds
    heap reads/writes through tcp_sk(sk)->bpf_sock_ops_cb_flags, and does
    not set is_locked_tcp_sock for the msk (unlike tcp_call_bpf()). That
    flag authorizes the verifier's direct tcp_sock-offset field accesses;
    since the msk is not a tcp_sock, leaving it at the default 0 is safe.

v1:
  Link: https://patchwork.kernel.org/project/mptcp/cover/20260713095735.1222033-1-gang.yan@linux.dev/

Gang Yan (7):
  mptcp: drop unused @max arg of __mptcp_setsockopt_set_val
  mptcp: take TCP_MAXSEG handling into __mptcp_setsockopt_set_val
  mptcp: use sockopt_lock/release_sock in sockopt
  mptcp: reject sockopt requiring ssks' lock in BPF context
  mptcp: enable bpf_setsockopt on the master socket
  mptcp: add TCP_CONNECT_CB sock_ops hook
  selftests: bpf: verify mptcp bpf_setsockopt from TCP_CONNECT_CB

 include/net/mptcp.h                           |   9 ++
 net/core/filter.c                             |  10 ++
 net/ipv4/tcp.c                                |   1 +
 net/mptcp/protocol.c                          |   6 +
 net/mptcp/protocol.h                          |  29 ++++
 net/mptcp/sockopt.c                           | 149 +++++++++---------
 .../testing/selftests/bpf/prog_tests/mptcp.c  |  61 +++++++
 .../selftests/bpf/progs/mptcp_setsockopt.c    |  32 ++++
 8 files changed, 223 insertions(+), 74 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/mptcp_setsockopt.c

-- 
2.43.0


             reply	other threads:[~2026-07-21  2:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21  2:40 Gang Yan [this message]
2026-07-21  2:40 ` [PATCH mptcp-next v2 1/7] mptcp: drop unused @max arg of __mptcp_setsockopt_set_val Gang Yan
2026-07-21  2:40 ` [PATCH mptcp-next v2 2/7] mptcp: take TCP_MAXSEG handling into __mptcp_setsockopt_set_val Gang Yan
2026-07-21  2:40 ` [PATCH mptcp-next v2 3/7] mptcp: use sockopt_lock/release_sock in sockopt Gang Yan
2026-07-21  2:40 ` [PATCH mptcp-next v2 4/7] mptcp: reject sockopt requiring ssks' lock in BPF context Gang Yan
2026-07-21  2:41 ` [PATCH mptcp-next v2 5/7] mptcp: enable bpf_setsockopt on the master socket Gang Yan
2026-07-21  2:41 ` [PATCH mptcp-next v2 6/7] mptcp: add TCP_CONNECT_CB sock_ops hook Gang Yan
2026-07-21  2:41 ` [PATCH mptcp-next v2 7/7] selftests: bpf: verify mptcp bpf_setsockopt from TCP_CONNECT_CB Gang Yan
2026-07-21  3:46 ` [PATCH mptcp-next v2 0/7] mptcp: add bpf_setsockopt support MPTCP CI

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=cover.1784601268.git.yangang@kylinos.cn \
    --to=gang.yan@linux.dev \
    --cc=mptcp@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=yangang@kylinos.cn \
    /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