[PATCH mptcp-net] Squash-to: "mptcp: handle consistently DSS corruption"

Paolo Abeni posted 1 patch 2 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/dfce01586ff42d63cffce0a2ca10149e30ec71fe.1727881810.git.pabeni@redhat.com
net/mptcp/protocol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH mptcp-net] Squash-to: "mptcp: handle consistently DSS corruption"
Posted by Paolo Abeni 2 months, 2 weeks ago
Instead of re-inventing the wheel, use the flag we already
track to easily check if fallback is allowed.

Note that we could not check conn_list in a reliable way,
as the call side is not under the msk socket lock.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index ba5f4f44f4b3..fd1c2e866e8e 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -622,7 +622,7 @@ static bool mptcp_check_data_fin(struct sock *sk)
 
 static void mptcp_dss_corruption(struct mptcp_sock *msk, struct sock *ssk)
 {
-	if (list_is_singular(&msk->conn_list) && msk->first == ssk) {
+	if (READ_ONCE(msk->allow_infinite_fallback)) {
 		MPTCP_INC_STATS(sock_net(ssk),
 				MPTCP_MIB_DSSCORRUPTIONFALLBACK);
 		mptcp_do_fallback(ssk);
-- 
2.45.2
Re: [PATCH mptcp-net] Squash-to: "mptcp: handle consistently DSS corruption"
Posted by Matthieu Baerts 2 months, 2 weeks ago
Hi Paolo,

On 02/10/2024 17:10, Paolo Abeni wrote:
> Instead of re-inventing the wheel, use the flag we already
> track to easily check if fallback is allowed.
> 
> Note that we could not check conn_list in a reliable way,
> as the call side is not under the msk socket lock.
Thank you for the fix!

Now in our tree:

New patches for t/upstream-net and t/upstream:
- 0752f9d4d42a: "squashed" in "mptcp: handle consistently DSS corruption"
- Results: 0a6d0fb8fae4..98b1e473ae39 (export-net)
- Results: 624ef948c8bd..48a08655247c (export)

Tests are now in progress:

- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/3faf828e7f45c82863516b4c157433c1c343349e/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/b4046d581b70c4a32d20a1a582db9a6d256a6849/checks

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-net] Squash-to: "mptcp: handle consistently DSS corruption"
Posted by Matthieu Baerts 2 months, 2 weeks ago
Hi Paolo,

On 02/10/2024 17:10, Paolo Abeni wrote:
> Instead of re-inventing the wheel, use the flag we already
> track to easily check if fallback is allowed.

Funny, I was going to react on that too :-)

I was looking at another issue with Christoph where a fallback is not
done, but a RST is done instead. I will try to open a ticket on GitHub
before the weekly meeting today (I don't know if you can join).

I will wait for the CI to test this before applying it.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.