All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-net] mptcp: fix data re-injection from stale subflow
@ 2024-01-23 21:03 Paolo Abeni
  2024-01-23 22:01 ` mptcp: fix data re-injection from stale subflow: Tests Results MPTCP CI
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Paolo Abeni @ 2024-01-23 21:03 UTC (permalink / raw)
  To: mptcp

When the MPTCP PM detects that a subflow is stale, all the packet
scheduler must re-inject all the mptcp-level unacked data. To avoid
acquiring unneeded locks, it first try to check if any unacked data
is present at all in the RTX queue, but such check is currently
broken, as it uses TCP-specific helper on an MPTCP socket.

Funnily enough fuzzers and static checkers are happy, as the accessed
memory still belongs to the mptcp_sock struct, and even from a
functional perspective the recovery completed successfully, as
the short-cut test always failed.

A recent unrelated TCP change - commit d5fed5addb2b ("tcp: reorganize
tcp_sock fast path variables") - exposed the issue, as the tcp field
reorganization makes the mptcp code always skip the re-inection.

Fix the issue dropping the bogus call: we are on a slow path, the early
optimization proved once again to be evil.

Fixes: 1e1d9d6f119c ("mptcp: handle pending data on closed subflow")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/468
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/protocol.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 53d6c5544900..a8a94b34a51e 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2339,9 +2339,6 @@ bool __mptcp_retransmit_pending_data(struct sock *sk)
 	if (__mptcp_check_fallback(msk))
 		return false;
 
-	if (tcp_rtx_and_write_queues_empty(sk))
-		return false;
-
 	/* the closing socket has some data untransmitted and/or unacked:
 	 * some data in the mptcp rtx queue has not really xmitted yet.
 	 * keep it simple and re-inject the whole mptcp level rtx queue
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-01-31 11:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 21:03 [PATCH mptcp-net] mptcp: fix data re-injection from stale subflow Paolo Abeni
2024-01-23 22:01 ` mptcp: fix data re-injection from stale subflow: Tests Results MPTCP CI
2024-01-23 22:32 ` MPTCP CI
2024-01-24  1:14 ` [PATCH mptcp-net] mptcp: fix data re-injection from stale subflow Mat Martineau
2024-01-24  2:25 ` mptcp: fix data re-injection from stale subflow: Tests Results MPTCP CI
2024-01-24  2:33 ` MPTCP CI
2024-01-30 11:59 ` [PATCH mptcp-net] mptcp: fix data re-injection from stale subflow Matthieu Baerts
2024-01-30 15:12   ` Paolo Abeni
2024-01-30 17:52     ` Matthieu Baerts
2024-01-30 18:53       ` Paolo Abeni
2024-01-31 11:12         ` Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.