On Tue, Jun 27, 2023 at 03:25:57PM +0200, Matthieu Baerts wrote: > From: Paolo Abeni <pabeni@xxxxxxxxxx> > > commit 81c1d029016001f994ce1c46849c5e9900d8eab8 upstream. > > An orphaned msk releases the used resources via the worker, > when the latter first see the msk in CLOSED status. > > If the msk status transitions to TCP_CLOSE in the release callback > invoked by the worker's final release_sock(), such instance of the > workqueue will not take any action. > > Additionally the MPTCP code prevents scheduling the worker once the > socket reaches the CLOSE status: such msk resources will be leaked. > > The only code path that can trigger the above scenario is the > __mptcp_check_send_data_fin() in fallback mode. > > Address the issue removing the special handling of fallback socket > in __mptcp_check_send_data_fin(), consolidating the state machine > for fallback and non fallback socket. > > Since non-fallback sockets do not send and do not receive data_fin, > the mptcp code can update the msk internal status to match the next > step in the SM every time data fin (ack) should be generated or > received. > > As a consequence we can remove a bunch of checks for fallback from > the fastpath. > > Fixes: 6e628cd3a8f7 ("mptcp: use mptcp release_cb for delayed tasks") > Cc: stable@xxxxxxxxxxxxxxx > Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx> > Reviewed-by: Mat Martineau <martineau@xxxxxxxxxx> > Signed-off-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> > Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> > Signed-off-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> > --- > Conflicting with: > - 0522b424c4c2 ("mptcp: add do_check_data_fin to replace copied") > - 3e5014909b56 ("mptcp: cleanup MPJ subflow list handling") > > I took the new modifications but leaving the old variable name for > "copied" instead of "do_check_data_fin" and the calls to > __mptcp_flush_join_list() > > Applied on top of d2efde0d1c2e ("Linux 5.15.119-rc1"). > > Signed-off-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> All backports now queued up, thanks. greg k-h