Skip to content

Commit e04fe0f

Browse files
Paolo Abeniintel-lab-lkp
authored andcommitted
mptcp: reset fallback status gracefully at disconnect() time
mptcp_disconnect() clears the fallback bit unconditionally, without touching the associated flags. The bit clear is safe, as no fallback operation can race with that - all subflow are already in TCP_CLOSE status thanks to the previous FASTCLOSE - but we need to consistently reset all the fallback related status. Also acquire the relevant lock, to avoid fouling static analyzers. Fixes: b29fcfb ("mptcp: full disconnect implementation") Signed-off-by: Paolo Abeni <[email protected]>
1 parent 3228ab2 commit e04fe0f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

net/mptcp/protocol.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3143,7 +3143,16 @@ static int mptcp_disconnect(struct sock *sk, int flags)
31433143
* subflow
31443144
*/
31453145
mptcp_destroy_common(msk, MPTCP_CF_FASTCLOSE);
3146+
3147+
/* The first subflow is already in TCP_CLOSE status, the following
3148+
* can't overlap with a fallback anymore
3149+
*/
3150+
spin_lock_bh(&msk->fallback_lock);
3151+
msk->allow_subflows = true;
3152+
msk->allow_infinite_fallback = true;
31463153
WRITE_ONCE(msk->flags, 0);
3154+
spin_unlock_bh(&msk->fallback_lock);
3155+
31473156
msk->cb_flags = 0;
31483157
msk->recovery = false;
31493158
WRITE_ONCE(msk->can_ack, false);

0 commit comments

Comments
 (0)