mptcp: ensure snd_una is properly initialized on connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Paolo Abeni <pabeni@xxxxxxxxxx>

commit 8031b58c3a9b1db3ef68b3bd749fbee2e1e1aaa3 upstream.

This is strictly related to commit fb7a0d334894 ("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 <martineau@xxxxxxxxxx>
Fixes: 8fd738049ac3 ("mptcp: fallback in case of simultaneous connect")
Cc: stable@xxxxxxxxxxxxxxx
Reported-by: Christoph Paasch <cpaasch@xxxxxxxxx>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/485
Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
Reviewed-by: Mat Martineau <martineau@xxxxxxxxxx>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-1-1ab9ddfa3d00@xxxxxxxxxx
Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 net/mptcp/protocol.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3398,6 +3398,7 @@ static int mptcp_stream_connect(struct s
 
 	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);
 


Patches currently in stable-queue which might be from pabeni@xxxxxxxxxx are

queue-5.15/ipv6-sr-block-bh-in-seg6_output_core-and-seg6_input_.patch
queue-5.15/af_unix-annotate-data-race-of-net-unx.sysctl_max_dgr.patch
queue-5.15/af_unix-annotate-data-race-of-sk-sk_shutdown-in-sk_d.patch
queue-5.15/af_unix-annotate-data-race-of-sk-sk_state-in-unix_st.patch-5290
queue-5.15/net-geneve-support-ipv4-ipv6-as-inner-protocol.patch
queue-5.15/af_unix-annotate-data-race-of-sk-sk_state-in-unix_in.patch
queue-5.15/af_unix-annodate-data-races-around-sk-sk_state-for-w.patch
queue-5.15/af_unix-set-sk-sk_state-under-unix_state_lock-for-tr.patch
queue-5.15/ipv6-fix-possible-race-in-__fib6_drop_pcpu_from.patch
queue-5.15/af_unix-annotate-data-race-of-sk-sk_state-in-unix_st.patch
queue-5.15/mptcp-ensure-snd_una-is-properly-initialized-on-connect.patch
queue-5.15/af_unix-annotate-data-races-around-sk-sk_state-in-un.patch-6162
queue-5.15/af_unix-annotate-data-races-around-sk-sk_state-in-se.patch
queue-5.15/af_unix-use-unix_recvq_full_lockless-in-unix_stream_.patch
queue-5.15/af_unix-use-skb_queue_len_lockless-in-sk_diag_show_r.patch
queue-5.15/af_unix-use-skb_queue_empty_lockless-in-unix_release.patch
queue-5.15/af_unix-annotate-data-races-around-sk-sk_state-in-un.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux