Skip to content

Commit

Permalink
mptcp: fix bogus receive window shrinkage with multiple subflows
Browse files Browse the repository at this point in the history
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: f3589be ("mptcp: never shrink offered window")
Closes: #427
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
  • Loading branch information
Paolo Abeni authored and jenkins-tessares committed Sep 15, 2023
1 parent b4c64e6 commit 6ef428b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/mptcp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,12 +1269,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;
}
Expand Down

0 comments on commit 6ef428b

Please sign in to comment.