diff options
author | Jakub Kicinski <kuba@kernel.org> | 2024-01-03 03:12:49 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-01-03 03:12:49 +0300 |
commit | d5a13915ae2f4df738bf4254ec25e19f82e3ff49 (patch) | |
tree | c7b846e65031b478531943f31beaf87da87d8aac | |
parent | fe6d8300a7af390667359c661d78a24b733dc5ad (diff) | |
parent | 4c0288299fd09ee7c6fbe2f57421f314d8c981db (diff) | |
download | linux-d5a13915ae2f4df738bf4254ec25e19f82e3ff49.tar.xz |
Merge branch 'mptcp-new-reviewer-and-prevent-a-warning'
Matthieu Baerts says:
====================
mptcp: new reviewer and prevent a warning
Patch 1 adds MPTCP long time contributor -- Geliang Tang -- as a new
reviewer for the project. Thanks!
Patch 2 prevents a warning when TCP Diag is used to close internal MPTCP
listener subflows. This is a correction for a patch introduced in v6.4
which was fixing an issue from v5.17.
====================
Link: https://lore.kernel.org/r/20231226-upstream-net-20231226-mptcp-prevent-warn-v1-0-1404dcc431ea@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | MAINTAINERS | 1 | ||||
-rw-r--r-- | net/mptcp/subflow.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 409946ed5e98..14cb0732c375 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15077,6 +15077,7 @@ K: \bmdo_ NETWORKING [MPTCP] M: Matthieu Baerts <matttbe@kernel.org> M: Mat Martineau <martineau@kernel.org> +R: Geliang Tang <geliang.tang@linux.dev> L: netdev@vger.kernel.org L: mptcp@lists.linux.dev S: Maintained diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 6d7684c35e93..852b3f4af000 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -1982,6 +1982,17 @@ static void tcp_release_cb_override(struct sock *ssk) tcp_release_cb(ssk); } +static int tcp_abort_override(struct sock *ssk, int err) +{ + /* closing a listener subflow requires a great deal of care. + * keep it simple and just prevent such operation + */ + if (inet_sk_state_load(ssk) == TCP_LISTEN) + return -EINVAL; + + return tcp_abort(ssk, err); +} + static struct tcp_ulp_ops subflow_ulp_ops __read_mostly = { .name = "mptcp", .owner = THIS_MODULE, @@ -2026,6 +2037,7 @@ void __init mptcp_subflow_init(void) tcp_prot_override = tcp_prot; tcp_prot_override.release_cb = tcp_release_cb_override; + tcp_prot_override.diag_destroy = tcp_abort_override; #if IS_ENABLED(CONFIG_MPTCP_IPV6) /* In struct mptcp_subflow_request_sock, we assume the TCP request sock @@ -2061,6 +2073,7 @@ void __init mptcp_subflow_init(void) tcpv6_prot_override = tcpv6_prot; tcpv6_prot_override.release_cb = tcp_release_cb_override; + tcpv6_prot_override.diag_destroy = tcp_abort_override; #endif mptcp_diag_subflow_init(&subflow_ulp_ops); |