]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mptcp: reset rcv wnd on disconnect
authorPaolo Abeni <pabeni@redhat.com>
Fri, 15 May 2026 04:27:35 +0000 (06:27 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 19 May 2026 13:36:35 +0000 (15:36 +0200)
If the MPTCP socket fallback to TCP before the MP handshake completion,
the IASN remain 0, and the rcv_wnd_sent field is not explicitly
initialized, just incremented over time with the data transfer.

At disconnect time such value is not cleared. If the next connection falls
back to TCP before the MP handshake completion, the data transfer will
keep incrementing the receive window end sequence starting from the last
value used in the previous connection: the announced window will be
unrelated from the actual receiver buffer size and likely too big.

Address the issue zeroing the field at disconnect time.

Fixes: b29fcfb54cd7 ("mptcp: full disconnect implementation")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260515-net-mptcp-misc-fixes-7-1-rc4-v2-4-701e96419f2f@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/mptcp/protocol.c

index 859df49e16dc21c7b31fd56b5b574b4164fcbb29..a72a6ad6ee8b1da8c331640808c15fd66a777d39 100644 (file)
@@ -3487,6 +3487,7 @@ static int mptcp_disconnect(struct sock *sk, int flags)
 
        /* for fallback's sake */
        WRITE_ONCE(msk->ack_seq, 0);
+       atomic64_set(&msk->rcv_wnd_sent, 0);
 
        WRITE_ONCE(sk->sk_shutdown, 0);
        sk_error_report(sk);