[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ddd7d72644ebd5826caa244cad6a6491410c00a@linux.dev>
Date: Mon, 03 Nov 2025 12:44:15 +0000
From: "Jiayuan Chen" <jiayuan.chen@...ux.dev>
To: "Paolo Abeni" <pabeni@...hat.com>, mptcp@...ts.linux.dev
Cc: stable@...r.kernel.org, "Jakub Sitnicki" <jakub@...udflare.com>, "John
Fastabend" <john.fastabend@...il.com>, "Eric Dumazet"
<edumazet@...gle.com>, "Kuniyuki Iwashima" <kuniyu@...gle.com>, "Willem
de Bruijn" <willemb@...gle.com>, "David S. Miller" <davem@...emloft.net>,
"Jakub Kicinski" <kuba@...nel.org>, "Simon Horman" <horms@...nel.org>,
"Matthieu Baerts" <matttbe@...nel.org>, "Mat Martineau"
<martineau@...nel.org>, "Geliang Tang" <geliang@...nel.org>, "Andrii
Nakryiko" <andrii@...nel.org>, "Eduard Zingerman" <eddyz87@...il.com>,
"Alexei Starovoitov" <ast@...nel.org>, "Daniel Borkmann"
<daniel@...earbox.net>, "Martin KaFai Lau" <martin.lau@...ux.dev>, "Song
Liu" <song@...nel.org>, "Yonghong Song" <yonghong.song@...ux.dev>, "KP
Singh" <kpsingh@...nel.org>, "Stanislav Fomichev" <sdf@...ichev.me>, "Hao
Luo" <haoluo@...gle.com>, "Jiri Olsa" <jolsa@...nel.org>, "Shuah Khan"
<shuah@...nel.org>, "Florian Westphal" <fw@...len.de>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
bpf@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net v3 1/3] net,mptcp: fix proto fallback detection with
BPF sockmap
October 28, 2025 at 19:30, "Paolo Abeni" <pabeni@...hat.com mailto:pabeni@...hat.com?to=%22Paolo%20Abeni%22%20%3Cpabeni%40redhat.com%3E > wrote:
>
> On 10/23/25 2:54 PM, Jiayuan Chen wrote:
>
> >
> > When the server has MPTCP enabled but receives a non-MP-capable request
> > from a client, it calls mptcp_fallback_tcp_ops().
> >
> > Since non-MPTCP connections are allowed to use sockmap, which replaces
> > sk->sk_prot, using sk->sk_prot to determine the IP version in
> > mptcp_fallback_tcp_ops() becomes unreliable. This can lead to assigning
> > incorrect ops to sk->sk_socket->ops.
> >
> I don't see how sockmap could modify the to-be-accepted socket sk_prot
> before mptcp_fallback_tcp_ops(), as such call happens before the fd is
> installed, and AFAICS sockmap can only fetch sockets via fds.
>
> Is this patch needed?
"mptcp_fallback_tcp_ops" is only called during the accept process. However,
before that, for an already established TCP socket, its sk_prot is replaced via the following path:
tcp_rcv_state_process()
tcp_init_transfer(BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB)
call bpf prog
bpf_sock_map_update(sk)
tcp_bpf_update_proto()
However, after discussing with Matthieu, we've concluded that this patch is indeed no
longer necessary, as we have a simpler way to intercept the operation."
Thanks~
Powered by blists - more mailing lists