mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
mptcp: ensure snd_una is properly initialized on connect
commit8031b58c3a
upstream. This is strictly related to commitfb7a0d3348
("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@kernel.org> Fixes:8fd738049a
("mptcp: fallback in case of simultaneous connect") Cc: stable@vger.kernel.org Reported-by: Christoph Paasch <cpaasch@apple.com> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/485 Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://lore.kernel.org/r/20240607-upstream-net-20240607-misc-fixes-v1-1-1ab9ddfa3d00@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
510a6c0dfa
commit
ef473bf1dd
1 changed files with 1 additions and 0 deletions
|
@ -3731,6 +3731,7 @@ static int mptcp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
|
||||||
|
|
||||||
WRITE_ONCE(msk->write_seq, subflow->idsn);
|
WRITE_ONCE(msk->write_seq, subflow->idsn);
|
||||||
WRITE_ONCE(msk->snd_nxt, subflow->idsn);
|
WRITE_ONCE(msk->snd_nxt, subflow->idsn);
|
||||||
|
WRITE_ONCE(msk->snd_una, subflow->idsn);
|
||||||
if (likely(!__mptcp_check_fallback(msk)))
|
if (likely(!__mptcp_check_fallback(msk)))
|
||||||
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPCAPABLEACTIVE);
|
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPCAPABLEACTIVE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue