]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mptcp: pm: ADD_ADDR rtx: free sk if last
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Tue, 5 May 2026 15:00:53 +0000 (17:00 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 May 2026 01:16:44 +0000 (18:16 -0700)
commitb7b9a461569734d33d3259d58d2507adfac107ed
tree64a46f9b0c0787c4c5a7a41f64fab2ad0ba8b7ca
parent9634cb35af17019baec21ca648516ce376fa10e6
mptcp: pm: ADD_ADDR rtx: free sk if last

When an ADD_ADDR is retransmitted, the sk is held in sk_reset_timer(),
and released at the end.

If at that moment, it was the last reference being held, the sk would
not be freed. sock_put() should then be called instead of __sock_put().

But that's not enough: if it is the last reference, sock_put() will call
sk_free(), which will end up calling sk_stop_timer_sync() on the same
timer, and waiting indefinitely to finish. So it is needed to mark that
the timer is done at the end of the timer handler when it has not been
rescheduled, not to call sk_stop_timer_sync() on "itself".

Fixes: 00cfd77b9063 ("mptcp: retransmit ADD_ADDR when timeout")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260505-net-mptcp-pm-fixes-7-1-rc3-v1-5-fca8091060a4@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm.c