[PATCH mptcp-net] mptcp: avoid bogus reset on fallback close

Paolo Abeni posted 1 patch 9 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/ee258a29aba5deeede5aa200f53a1d7e9284817a.1690478147.git.pabeni@redhat.com
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Mat Martineau <martineau@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
net/mptcp/protocol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH mptcp-net] mptcp: avoid bogus reset on fallback close
Posted by Paolo Abeni 9 months, 1 week ago
Since the blamed commit, the MPTCP protocol unconditionally sends
TCP resets on all the subflows on disconnect().

That fits full-blown MPTCP sockets - to implement the fastclose
mechanism - but causes unexpected corruption of the data stream,
catched as sporadic self-tests failures.

Fixes: d21f83485518 ("mptcp: use fastclose on more edge scenarios")
Tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/419
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8b9ff7457d56..4031a43c03b0 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2346,7 +2346,7 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk,
 
 	lock_sock_nested(ssk, SINGLE_DEPTH_NESTING);
 
-	if (flags & MPTCP_CF_FASTCLOSE) {
+	if ((flags & MPTCP_CF_FASTCLOSE) && !__mptcp_check_fallback(msk)) {
 		/* be sure to force the tcp_disconnect() path,
 		 * to generate the egress reset
 		 */
-- 
2.41.0
Re: [PATCH mptcp-net] mptcp: avoid bogus reset on fallback close
Posted by Matthieu Baerts 9 months, 1 week ago
Hi Paolo,

On 27/07/2023 19:15, Paolo Abeni wrote:
> Since the blamed commit, the MPTCP protocol unconditionally sends
> TCP resets on all the subflows on disconnect().
> 
> That fits full-blown MPTCP sockets - to implement the fastclose
> mechanism - but causes unexpected corruption of the data stream,
> catched as sporadic self-tests failures.

Thank you for the fix! It looks good to me!

Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>

Now in our tree (fixes for -net):

New patches for t/upstream-net and t/upstream:
- 12ee162a0d4d: mptcp: avoid bogus reset on fallback close
- Results: be9e061da26c..f8d0d9188a92 (export-net)
- Results: c4e88c45e27d..b5ba626e6a54 (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export-net/20230728T105820
https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20230728T105820

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net