Skip to content

Commit

Permalink
mptcp: ensure snd_una is properly initialized on connect
Browse files Browse the repository at this point in the history
commit 8031b58 upstream.

This is strictly related to commit fb7a0d3 ("mptcp: ensure snd_nxt
is properly initialized on connect"). It turns out that syzkaller can
trigger the retransmit after fallback and before processing any other
incoming packet - so that snd_una is still left uninitialized.

Address the issue explicitly initializing snd_una together with snd_nxt
and write_seq.

Suggested-by: Mat Martineau <[email protected]>
Fixes: 8fd7380 ("mptcp: fallback in case of simultaneous connect")
Cc: [email protected]
Reported-by: Christoph Paasch <[email protected]>
Closes: multipath-tcp/mptcp_net-next#485
Signed-off-by: Paolo Abeni <[email protected]>
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-1-1ab9ddfa3d00@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 7b9c7fc8600b64a86e4b47b2d190bba380267726)
Signed-off-by: Vijayendra Suman <[email protected]>
  • Loading branch information
Paolo Abeni authored and vijay-suman committed Jul 31, 2024
1 parent 6f1d2f0 commit 6df6177
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -3398,6 +3398,7 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,

WRITE_ONCE(msk->write_seq, subflow->idsn);
WRITE_ONCE(msk->snd_nxt, subflow->idsn);
WRITE_ONCE(msk->snd_una, subflow->idsn);
if (likely(!__mptcp_check_fallback(msk)))
MPTCP_INC_STATS(sock_net(sock->sk), MPTCP_MIB_MPCAPABLEACTIVE);

Expand Down

0 comments on commit 6df6177

Please sign in to comment.