linux-stable/net/mptcp
Geliang Tang 14c56686a6 mptcp: avoid sending RST when closing the initial subflow
When closing the first subflow, the MPTCP protocol unconditionally
calls tcp_disconnect(), which in turn generates a reset if the subflow
is established.

That is unexpected and different from what MPTCP does with MPJ
subflows, where resets are generated only on FASTCLOSE and other edge
scenarios.

We can't reuse for the first subflow the same code in place for MPJ
subflows, as MPTCP clean them up completely via a tcp_close() call,
while must keep the first subflow socket alive for later re-usage, due
to implementation constraints.

This patch adds a new helper __mptcp_subflow_disconnect() that
encapsulates, a logic similar to tcp_close, issuing a reset only when
the MPTCP_CF_FASTCLOSE flag is set, and performing a clean shutdown
otherwise.

Fixes: c2b2ae3925 ("mptcp: handle correctly disconnect() failures")
Cc: stable@vger.kernel.org
Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20231018-send-net-20231018-v1-4-17ecb002e41d@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-10-19 09:10:00 -07:00
..
bpf.c bpf: Add update_socket_protocol hook 2023-08-16 10:22:16 -07:00
crypto.c kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
crypto_test.c mptcp: move crypto test to KUNIT 2020-06-26 16:21:39 -07:00
ctrl.c sysctl-6.6-rc1 2023-08-29 17:39:15 -07:00
diag.c mptcp: allow dumping subflow context to userspace 2020-03-29 22:14:48 -07:00
fastopen.c mptcp: fix NULL pointer dereference on fastopen early fallback 2023-04-13 09:58:55 -07:00
Kconfig kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
Makefile mptcp: add struct mptcp_sched_ops 2023-08-22 17:31:18 -07: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: fix bogus receive window shrinkage with multiple subflows 2023-09-18 12:47:55 +01:00
pm.c mptcp: drop last_snd and MPTCP_RESET_SCHEDULER 2023-08-22 17:31:18 -07:00
pm_netlink.c mptcp: drop last_snd and MPTCP_RESET_SCHEDULER 2023-08-22 17:31:18 -07:00
pm_userspace.c mptcp: userspace pm allow creating id 0 subflow 2023-10-05 09:34:32 -07:00
protocol.c mptcp: avoid sending RST when closing the initial subflow 2023-10-19 09:10:00 -07:00
protocol.h mptcp: fix delegated action races 2023-10-05 09:34:31 -07:00
sched.c mptcp: register default scheduler 2023-08-22 17:31:19 -07:00
sockopt.c inet: move inet->transparent to inet->inet_flags 2023-08-16 11:09:17 +01:00
subflow.c mptcp: fix delegated action races 2023-10-05 09:34:31 -07:00
syncookies.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00
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