diff options
author | Paolo Abeni <pabeni@redhat.com> | 2023-09-16 12:52:45 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-06 14:57:00 +0200 |
commit | 5d6613ed2b7dca6c5ed6dee8f9fd1dff5966e85f (patch) | |
tree | ec8eeb4beafbaf10cc404bd8052824369ac4e991 | |
parent | 00c27bffdba6a9c7ecab241ee74e04656060c8d5 (diff) | |
download | linux-stable-5d6613ed2b7dca6c5ed6dee8f9fd1dff5966e85f.tar.gz linux-stable-5d6613ed2b7dca6c5ed6dee8f9fd1dff5966e85f.tar.bz2 linux-stable-5d6613ed2b7dca6c5ed6dee8f9fd1dff5966e85f.zip |
mptcp: fix bogus receive window shrinkage with multiple subflows
commit 6bec041147a2a64a490d1f813e8a004443061b38 upstream.
In case multiple subflows race to update the mptcp-level receive
window, the subflow losing the race should use the window value
provided by the "winning" subflow to update it's own tcp-level
rcv_wnd.
To such goal, the current code bogusly uses the mptcp-level rcv_wnd
value as observed before the update attempt. On unlucky circumstances
that may lead to TCP-level window shrinkage, and stall the other end.
Address the issue feeding to the rcv wnd update the correct value.
Fixes: f3589be0c420 ("mptcp: never shrink offered window")
Cc: stable@vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/427
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/mptcp/options.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 6b2ef3bb53a3..0c786ceda5ee 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -1248,12 +1248,13 @@ static void mptcp_set_rwin(struct tcp_sock *tp, struct tcphdr *th) if (rcv_wnd == rcv_wnd_old) break; - if (before64(rcv_wnd_new, rcv_wnd)) { + + rcv_wnd_old = rcv_wnd; + if (before64(rcv_wnd_new, rcv_wnd_old)) { MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_RCVWNDCONFLICTUPDATE); goto raise_win; } MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_RCVWNDCONFLICT); - rcv_wnd_old = rcv_wnd; } return; } |