[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <154ce327ae50ea1e3ebde8a1b73c83ac0b547f61@linux.dev>
Date: Mon, 03 Nov 2025 12:52:07 +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 2/3] bpf,sockmap: disallow MPTCP sockets from
sockmap
October 28, 2025 at 20:03, "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:
>
> >
> > MPTCP creates subflows for data transmission, and these sockets should not
> > be added to sockmap because MPTCP sets specialized data_ready handlers
> > that would be overridden by sockmap.
> >
> > Additionally, for the parent socket of MPTCP subflows (plain TCP socket),
> > MPTCP sk requires specific protocol handling that conflicts with sockmap's
> > operation(mptcp_prot).
> >
> > This patch adds proper checks to reject MPTCP subflows and their parent
> > sockets from being added to sockmap, while preserving compatibility with
> > reuseport functionality for listening MPTCP sockets.
> >
> It's unclear to me why that is safe. sockmap is going to change the
> listener msk proto ops.
>
> The listener could disconnect and create an egress connection, still
> using the wrong ops.
sockmap only replaces read/write handler of a sk and keeps another handler.
But I agree with you; I also don't think sockmap should replace the handlers of
the listen socket. Because for a listen socket, sockmap is merely used as a container,
just like hash map or array map. But in reality, that's exactly what it does...
> I think sockmap should always be prevented for mptcp socket, or at least
> a solid explanation of why such exception is safe should be included in
> the commit message.
>
> Note that the first option allows for solving the issue entirely in the
> mptcp code, setting dummy/noop psock_update_sk_prot for mptcp sockets
> and mptcp subflows.
I will do it.
Powered by blists - more mailing lists