* [PATCH net 0/2] mptcp: new reviewer and prevent a warning
@ 2023-12-26 12:10 Matthieu Baerts
2023-12-26 12:10 ` [PATCH net 1/2] MAINTAINERS: add Geliang as reviewer for MPTCP Matthieu Baerts
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Matthieu Baerts @ 2023-12-26 12:10 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: linux-kernel, netdev, Matthieu Baerts, stable,
syzbot+5a01c3a666e726bc8752
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.
Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
---
Matthieu Baerts (1):
MAINTAINERS: add Geliang as reviewer for MPTCP
Paolo Abeni (1):
mptcp: prevent tcp diag from closing listener subflows
MAINTAINERS | 1 +
net/mptcp/subflow.c | 13 +++++++++++++
2 files changed, 14 insertions(+)
---
base-commit: dff90e4a092b771354287fbe55e557467c9da620
change-id: 20231226-upstream-net-20231226-mptcp-prevent-warn-24f9494bb2a0
Best regards,
--
Matthieu Baerts <matttbe@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net 1/2] MAINTAINERS: add Geliang as reviewer for MPTCP
2023-12-26 12:10 [PATCH net 0/2] mptcp: new reviewer and prevent a warning Matthieu Baerts
@ 2023-12-26 12:10 ` Matthieu Baerts
2023-12-26 12:10 ` [PATCH net 2/2] mptcp: prevent tcp diag from closing listener subflows Matthieu Baerts
2024-01-03 0:20 ` [PATCH net 0/2] mptcp: new reviewer and prevent a warning patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2023-12-26 12:10 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: linux-kernel, netdev, Matthieu Baerts
For a long time now, Geliang has contributed to a lot of code and
reviews related to MPTCP. So let's reflect that in the MAINTAINERS file.
This should also encourage patch submitters to add him to the CC list.
Acked-by: Geliang Tang <geliang.tang@linux.dev>
Acked-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 7cef2d2ef8d7..cc9e2dc4ad9a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15078,6 +15078,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
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net 2/2] mptcp: prevent tcp diag from closing listener subflows
2023-12-26 12:10 [PATCH net 0/2] mptcp: new reviewer and prevent a warning Matthieu Baerts
2023-12-26 12:10 ` [PATCH net 1/2] MAINTAINERS: add Geliang as reviewer for MPTCP Matthieu Baerts
@ 2023-12-26 12:10 ` Matthieu Baerts
2024-01-03 0:20 ` [PATCH net 0/2] mptcp: new reviewer and prevent a warning patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2023-12-26 12:10 UTC (permalink / raw)
To: mptcp, Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: linux-kernel, netdev, Matthieu Baerts, stable,
syzbot+5a01c3a666e726bc8752
From: Paolo Abeni <pabeni@redhat.com>
The MPTCP protocol does not expect that any other entity could change
the first subflow status when such socket is listening.
Unfortunately the TCP diag interface allows aborting any TCP socket,
including MPTCP listeners subflows. As reported by syzbot, that trigger
a WARN() and could lead to later bigger trouble.
The MPTCP protocol needs to do some MPTCP-level cleanup actions to
properly shutdown the listener. To keep the fix simple, prevent
entirely the diag interface from stopping such listeners.
We could refine the diag callback in a later, larger patch targeting
net-next.
Fixes: 57fc0f1ceaa4 ("mptcp: ensure listener is unhashed before updating the sk status")
Cc: stable@vger.kernel.org
Reported-by: <syzbot+5a01c3a666e726bc8752@syzkaller.appspotmail.com>
Closes: https://lore.kernel.org/netdev/0000000000004f4579060c68431b@google.com/
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
---
net/mptcp/subflow.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
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);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net 0/2] mptcp: new reviewer and prevent a warning
2023-12-26 12:10 [PATCH net 0/2] mptcp: new reviewer and prevent a warning Matthieu Baerts
2023-12-26 12:10 ` [PATCH net 1/2] MAINTAINERS: add Geliang as reviewer for MPTCP Matthieu Baerts
2023-12-26 12:10 ` [PATCH net 2/2] mptcp: prevent tcp diag from closing listener subflows Matthieu Baerts
@ 2024-01-03 0:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-03 0:20 UTC (permalink / raw)
To: Matthieu Baerts
Cc: mptcp, martineau, geliang.tang, davem, edumazet, kuba, pabeni,
linux-kernel, netdev, stable, syzbot+5a01c3a666e726bc8752
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 26 Dec 2023 13:10:16 +0100 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net,1/2] MAINTAINERS: add Geliang as reviewer for MPTCP
https://git.kernel.org/netdev/net/c/118ba479d02c
- [net,2/2] mptcp: prevent tcp diag from closing listener subflows
https://git.kernel.org/netdev/net/c/4c0288299fd0
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-03 0:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-26 12:10 [PATCH net 0/2] mptcp: new reviewer and prevent a warning Matthieu Baerts
2023-12-26 12:10 ` [PATCH net 1/2] MAINTAINERS: add Geliang as reviewer for MPTCP Matthieu Baerts
2023-12-26 12:10 ` [PATCH net 2/2] mptcp: prevent tcp diag from closing listener subflows Matthieu Baerts
2024-01-03 0:20 ` [PATCH net 0/2] mptcp: new reviewer and prevent a warning patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox