Skip to content

Commit ce7356a

Browse files
Paolo Abenikuba-moo
authored andcommitted
mptcp: cope racing subflow creation in mptcp_rcv_space_adjust
Additional active subflows - i.e. created by the in kernel path manager - are included into the subflow list before starting the 3whs. A racing recvmsg() spooling data received on an already established subflow would unconditionally call tcp_cleanup_rbuf() on all the current subflows, potentially hitting a divide by zero error on the newly created ones. Explicitly check that the subflow is in a suitable state before invoking tcp_cleanup_rbuf(). Fixes: c76c695 ("mptcp: call tcp_cleanup_rbuf on subflows") Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Matthieu Baerts (NGI0) <[email protected]> Link: https://patch.msgid.link/02374660836e1b52afc91966b7535c8c5f7bafb0.1731060874.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5813022 commit ce7356a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/mptcp/protocol.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,8 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
20822082
slow = lock_sock_fast(ssk);
20832083
WRITE_ONCE(ssk->sk_rcvbuf, rcvbuf);
20842084
WRITE_ONCE(tcp_sk(ssk)->window_clamp, window_clamp);
2085-
tcp_cleanup_rbuf(ssk, 1);
2085+
if (tcp_can_send_ack(ssk))
2086+
tcp_cleanup_rbuf(ssk, 1);
20862087
unlock_sock_fast(ssk, slow);
20872088
}
20882089
}

0 commit comments

Comments
 (0)