From: Gang Yan <gang.yan@linux.dev>
To: mptcp@lists.linux.dev
Cc: pabeni@redhat.com, Gang Yan <yangang@kylinos.cn>,
Geliang Tang <geliang@kernel.org>
Subject: [PATCH mptcp-net v4 4/5] mptcp: fix the dead_loack in mptcp_data_ready
Date: Mon, 30 Mar 2026 13:32:59 +0800 [thread overview]
Message-ID: <20260330053300.15717-5-gang.yan@linux.dev> (raw)
In-Reply-To: <20260330053300.15717-1-gang.yan@linux.dev>
From: Gang Yan <yangang@kylinos.cn>
This patch defers mptcp_check_data_fin from __mptcp_move_skbs to avoid
deadlock.
When processing backlogged data in softirq context, __mptcp_move_skbs
directly calls mptcp_check_data_fin, which can lead to a deadlock if
the msk socket is in TCP_FIN_WAIT2 state. In that case,
mptcp_check_data_fin calls mptcp_shutdown_subflows, which attempts to
lock the subflow socket with lock_sock_fast() - a sleeping function
that cannot be called in atomic context (softirq).
The correct pattern is already used in move_skbs_to_msk: if a data fin
is pending, schedule the work to be processed later in process context
rather than handling it directly.
Reported-by: Geliang Tang <geliang@kernel.org>
Co-developed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Gang Yan <yangang@kylinos.cn>
---
net/mptcp/protocol.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 16c5dcab8982..872022f4796b 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2247,8 +2247,12 @@ static bool __mptcp_move_skbs(struct sock *sk, struct list_head *skbs, u32 *delt
}
__mptcp_ofo_queue(msk);
- if (moved)
- mptcp_check_data_fin((struct sock *)msk);
+ if (moved) {
+ if (mptcp_pending_data_fin(sk, NULL))
+ mptcp_schedule_work(sk);
+ else
+ mptcp_check_data_fin(sk);
+ }
return moved;
}
--
2.43.0
next prev parent reply other threads:[~2026-03-30 5:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 5:32 [PATCH mptcp-net v4 0/5] mptcp: fix stall because of data_ready Gang Yan
2026-03-30 5:32 ` [PATCH mptcp-net v4 1/5] mptcp: replace backlog_list with backlog_queue Gang Yan
2026-03-30 5:32 ` [PATCH mptcp-net v4 2/5] mptcp: fix the stall problems using backlog_queue Gang Yan
2026-03-30 5:32 ` [PATCH mptcp-net v4 3/5] mptcp: fix the stall problems with data_ready Gang Yan
2026-03-30 5:32 ` Gang Yan [this message]
2026-03-30 5:33 ` [PATCH mptcp-net v4 5/5] selftests: mptcp: test transmission with small rcvbuf Gang Yan
2026-03-30 6:56 ` [PATCH mptcp-net v4 0/5] mptcp: fix stall because of data_ready MPTCP CI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260330053300.15717-5-gang.yan@linux.dev \
--to=gang.yan@linux.dev \
--cc=geliang@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=yangang@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.