linux-stable/net/mptcp
Paolo Abeni 0226436acf mptcp: do not rely on implicit state check in mptcp_listen()
Since the blamed commit, closing the first subflow resets the first
subflow socket state to SS_UNCONNECTED.

The current mptcp listen implementation relies only on such
state to prevent touching not-fully-disconnected sockets.

Incoming mptcp fastclose (or paired endpoint removal) unconditionally
closes the first subflow.

All the above allows an incoming fastclose followed by a listen() call
to successfully race with a blocking recvmsg(), potentially causing the
latter to hit a divide by zero bug in cleanup_rbuf/__tcp_select_window().

Address the issue explicitly checking the msk socket state in
mptcp_listen(). An alternative solution would be moving the first
subflow socket state update into mptcp_disconnect(), but in the long
term the first subflow socket should be removed: better avoid relaying
on it for internal consistency check.

Fixes: b29fcfb54c ("mptcp: full disconnect implementation")
Cc: stable@vger.kernel.org
Reported-by: Christoph Paasch <cpaasch@apple.com>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/414
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-07-05 10:51:14 +01:00
..
bpf.c bpf: Add bpf_skc_to_mptcp_sock_proto 2022-05-20 15:29:00 -07:00
crypto.c
crypto_test.c
ctrl.c
diag.c
fastopen.c mptcp: fix NULL pointer dereference on fastopen early fallback 2023-04-13 09:58:55 -07:00
Kconfig
Makefile mptcp: implement delayed seq generation for passive fastopen 2022-11-29 20:24:25 -08:00
mib.c mptcp: introduces more address related mibs 2023-05-18 20:06:32 -07:00
mib.h mptcp: introduces more address related mibs 2023-05-18 20:06:32 -07:00
mptcp_diag.c tcp: Access &tcp_hashinfo via net. 2022-09-20 10:21:49 -07:00
options.c mptcp: track some aggregate data counters 2023-06-21 22:45:57 -07:00
pm.c mptcp: unify pm set_flags interfaces 2023-06-10 00:05:59 -07:00
pm_netlink.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-22 18:40:38 -07:00
pm_userspace.c mptcp: pass addr to mptcp_pm_alloc_anno_list 2023-06-21 22:45:58 -07:00
protocol.c mptcp: do not rely on implicit state check in mptcp_listen() 2023-07-05 10:51:14 +01:00
protocol.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-22 18:40:38 -07:00
sockopt.c mptcp: introduce MPTCP_FULL_INFO getsockopt 2023-06-21 22:45:57 -07:00
subflow.c Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
syncookies.c
token.c mptcp: add statistics for mptcp socket in use 2023-01-09 07:30:50 +00:00
token_test.c mptcp: init sk->sk_prot in build_msk() 2023-01-09 07:30:50 +00:00