[PATCH mptcp-net] mptcp: do not propagate fallback subflow status on error

Paolo Abeni posted 1 patch 1 year, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/97f7deb4132d567132088d43f3e7f5ff0602a45b.1674668294.git.pabeni@redhat.com
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Mat Martineau <mathew.j.martineau@linux.intel.com>
net/mptcp/subflow.c | 1 -
1 file changed, 1 deletion(-)
[PATCH mptcp-net] mptcp: do not propagate fallback subflow status on error
Posted by Paolo Abeni 1 year, 3 months ago
Currently the subflow error report callback unconditionally
propagates the fallback subflow status to the owning msk.

That is not needed as there is a great deal of infrastructure
trying to propagate correctly the fallback subflow status to
the owning mptcp socket, e.g. via mptcp_subflow_eof() and
subflow_sched_work_if_closed().

And in some circumstances - specifically if the msk is already
orphaned - it prevents the code from correctly tracking the msk
moving to the TCP_CLOSE state and doing the appropriate
cleanup.

All the above causes increasing memory usage over time and
sporadic self-tests failures.

Address the issue simply removing the unneeded state update.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/339
Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/subflow.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index beaec843f5ca..5f952d0e06d4 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1410,7 +1410,6 @@ void __mptcp_error_report(struct sock *sk)
 		if (sk->sk_state != TCP_SYN_SENT && !__mptcp_check_fallback(msk))
 			continue;
 
-		inet_sk_state_store(sk, inet_sk_state_load(ssk));
 		sk->sk_err = -err;
 
 		/* This barrier is coupled with smp_rmb() in mptcp_poll() */
-- 
2.39.1
Re: [PATCH mptcp-net] mptcp: do not propagate fallback subflow status on error
Posted by Matthieu Baerts 1 year, 3 months ago
Hi Paolo,

On 25/01/2023 18:38, Paolo Abeni wrote:
> Currently the subflow error report callback unconditionally
> propagates the fallback subflow status to the owning msk.
> 
> That is not needed as there is a great deal of infrastructure
> trying to propagate correctly the fallback subflow status to
> the owning mptcp socket, e.g. via mptcp_subflow_eof() and
> subflow_sched_work_if_closed().
> 
> And in some circumstances - specifically if the msk is already
> orphaned - it prevents the code from correctly tracking the msk
> moving to the TCP_CLOSE state and doing the appropriate
> cleanup.
> 
> All the above causes increasing memory usage over time and
> sporadic self-tests failures.
> 
> Address the issue simply removing the unneeded state update.
> 
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/339
> Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Good catch!

Thank you for the quick fix!

It looks good to me and it seems to fix the issue on my side as well
(with a slow VM) :)

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

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