From: Paolo Abeni <[email protected]>

The mptcp scheduler may race with subflow sockets state change: data
transmission on the selected socket may fail and a later release could
try to use mss_now reset to 0 for a divide operation.

Address the issue by explicitly checking for the critical scenario.

Fixes: c886d70286bf ("mptcp: do not queue data on closed subflows")
Cc: [email protected]
Reported-by: Shardul Bankar <[email protected]>
Reported-by: Xinyang Ge <[email protected]>
Closes: 
https://lore.kernel.org/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Link: 
https://patch.msgid.link/20260917-net-mptcp-misc-fixes-7-3-rc4-v2-2-0cf5c7266...@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
(cherry picked from commit 42064de57fb83231fcc89663a94885f228a1ee53)

https://virtuozzo.atlassian.net/browse/VSTOR-155322
Feature: fix ms/net

Signed-off-by: Eva Kurchatova <[email protected]>
---
 net/mptcp/protocol.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 1d4754b20cea..685c8a395476 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1434,7 +1434,9 @@ struct sock *mptcp_subflow_get_send(struct mptcp_sock 
*msk)
 
 static void mptcp_push_release(struct sock *ssk, struct mptcp_sendmsg_info 
*info)
 {
-       tcp_push(ssk, 0, info->mss_now, tcp_sk(ssk)->nonagle, info->size_goal);
+       if (info->mss_now)
+               tcp_push(ssk, 0, info->mss_now, tcp_sk(ssk)->nonagle,
+                        info->size_goal);
        release_sock(ssk);
 }
 
-- 
2.56.1

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to