mptcp: be careful on subflow status propagation on errors
authorPaolo Abeni <pabeni@redhat.com>
Tue, 7 Feb 2023 13:04:16 +0000 (14:04 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Feb 2023 09:39:34 +0000 (09:39 +0000)
commit1249db44a102d9d3541ed7798d4b01ffdcf03524
treefa6babcd138920d2fcc012674ab91c757c440a6c
parentad2171009d968104ccda9dc517f5a3ba891515db
mptcp: be careful on subflow status propagation on errors

Currently the subflow error report callback unconditionally
propagates the fallback subflow status to the owning msk.

If the msk is already orphaned, the above 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.

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():
in the error propagation path we need only to cope with unorphaned
sockets.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/339
Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/subflow.c