From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89052305043 for ; Mon, 3 Nov 2025 12:44:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762173867; cv=none; b=bqHuVUyoeNTGxWwG+fgQl0jS3BwqBZrOXdpNxYq6iNJPsFeJAk4dNlRitZyEIm0s+L/lsKMGzWi5z9OZdo1pTdLZBHklf4BElrQ0y9cGd656DI6zn3Px07KjbPeZia8tguNm/ZFa3kAnjUzRWp31pHW6rV51wA2+rrz9pXxQNxg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762173867; c=relaxed/simple; bh=vT6PArFNlD9ATQBYI/ysNDAumFVMhzxz9dljQq1FEo4=; h=MIME-Version:Date:Content-Type:From:Message-ID:Subject:To:Cc: In-Reply-To:References; b=jDIgKKQPwlGeptfPI/WrCNGAF/ytKU6f7nwKkTS6KAfHklf1dP/Bqy3G2CUBQU70OYKJxDsmH1h8IINNl/mbUjz+g3h0Fjq4Sup1HEILU4HMJy7BWIkj3pOZqXFY/5ysvmLSn01bteKlx9f/ens2nGHLIKLa9q8odhiYSg3M4Uw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=RmGgkokm; arc=none smtp.client-ip=95.215.58.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="RmGgkokm" Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1762173862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HCESdiFfePQnHxAf5Hjx+NZwOKZOc1DIfGTWc/CkQFI=; b=RmGgkokmZWSo8UB9yGc4Wq07j7MdQpgB0b3cW0rSbLfwQyuO9LTYotTkkJPN3r4augRIlF l7yY27AMCqp6lE9/YHUWl6UdnxZg/JOhepCTkF7MTPAISgKfqjWtkrarP+kHNzCwFXBDP/ MJigcA7V0TLszG04FEJ92ouXtktg/jA= Date: Mon, 03 Nov 2025 12:44:15 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Jiayuan Chen" Message-ID: <3ddd7d72644ebd5826caa244cad6a6491410c00a@linux.dev> TLS-Required: No Subject: Re: [PATCH net v3 1/3] net,mptcp: fix proto fallback detection with BPF sockmap To: "Paolo Abeni" , mptcp@lists.linux.dev Cc: stable@vger.kernel.org, "Jakub Sitnicki" , "John Fastabend" , "Eric Dumazet" , "Kuniyuki Iwashima" , "Willem de Bruijn" , "David S. Miller" , "Jakub Kicinski" , "Simon Horman" , "Matthieu Baerts" , "Mat Martineau" , "Geliang Tang" , "Andrii Nakryiko" , "Eduard Zingerman" , "Alexei Starovoitov" , "Daniel Borkmann" , "Martin KaFai Lau" , "Song Liu" , "Yonghong Song" , "KP Singh" , "Stanislav Fomichev" , "Hao Luo" , "Jiri Olsa" , "Shuah Khan" , "Florian Westphal" , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org In-Reply-To: References: <20251023125450.105859-1-jiayuan.chen@linux.dev> <20251023125450.105859-2-jiayuan.chen@linux.dev> X-Migadu-Flow: FLOW_OUT October 28, 2025 at 19:30, "Paolo Abeni" wrote: >=20 >=20On 10/23/25 2:54 PM, Jiayuan Chen wrote: >=20 >=20>=20 >=20> When the server has MPTCP enabled but receives a non-MP-capable req= uest > > from a client, it calls mptcp_fallback_tcp_ops(). > >=20=20 >=20> Since non-MPTCP connections are allowed to use sockmap, which repl= aces > > sk->sk_prot, using sk->sk_prot to determine the IP version in > > mptcp_fallback_tcp_ops() becomes unreliable. This can lead to assign= ing > > incorrect ops to sk->sk_socket->ops. > >=20 >=20I don't see how sockmap could modify the to-be-accepted socket sk_pro= t > before mptcp_fallback_tcp_ops(), as such call happens before the fd is > installed, and AFAICS sockmap can only fetch sockets via fds. >=20 >=20Is this patch needed? "mptcp_fallback_tcp_ops" is only called during the accept process. Howeve= r, before that, for an already established TCP socket, its sk_prot is replac= ed 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~