Skip to content

Commit 5c28989

Browse files
committed
mptcp: cope racing subflow creation in mptcp_rcv_space_adjust
jira VULN-46443 cve CVE-2024-53122 commit-author Paolo Abeni <[email protected]> commit ce7356a upstream-diff A recent change f410cbe introduced in v6.10-rc1 tcp annotate data-races around tp->window_clamp had some fuzz due to the WRITE_ONCE and keep the original code. No conflicts in merged in code. 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]> (cherry picked from commit ce7356a) Signed-off-by: Jonathan Maple <[email protected]>
1 parent cd74e4f commit 5c28989

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
@@ -1980,7 +1980,8 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
19801980
slow = lock_sock_fast(ssk);
19811981
WRITE_ONCE(ssk->sk_rcvbuf, rcvbuf);
19821982
tcp_sk(ssk)->window_clamp = window_clamp;
1983-
tcp_cleanup_rbuf(ssk, 1);
1983+
if (tcp_can_send_ack(ssk))
1984+
tcp_cleanup_rbuf(ssk, 1);
19841985
unlock_sock_fast(ssk, slow);
19851986
}
19861987
}

0 commit comments

Comments
 (0)