mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH net v4 0/3] net: mptcp: fix unreleased socket in accept queue
@ 2022-09-09  5:49 menglong8.dong
  2022-09-09  5:49 ` [PATCH net v4 1/3] net: mptcp: factor out __mptcp_close() without socket lock menglong8.dong
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: menglong8.dong @ 2022-09-09  5:49 UTC (permalink / raw)
  To: pabeni; +Cc: mptcp, Menglong Dong

From: Menglong Dong <imagedong@tencent.com>

The mptcp socket and its subflow sockets in accept queue can't be
released after the process exit.

While the release of a mptcp socket in listening state, the
corresponding tcp socket will be released too. Meanwhile, the tcp
socket in the unaccept queue will be released too. However, only init
subflow is in the unaccept queue, and the joined subflow is not in the
unaccept queue, which makes the joined subflow won't be released, and
therefore the corresponding unaccepted mptcp socket will not be released
to.

In the 1th patch, we factor-out __mptcp_close() which should run under
socket lock.

In the 2th patch, we move mptcp_cancel_work() to protocol.h and make it
as an inline, as we need to use it in subflow.c.

And in the 3th patch, we fix the problem we mentioned above by closing
all of the unaccepted mptcp socket in mptcp_subflow_queue_clean()
with __mptcp_close().

Changes since v3:
- factor out __mptcp_close() and replace mptcp_close() with it in
  mptcp_subflow_queue_clean()

Menglong Dong (3):
  net: mptcp: factor out __mptcp_close() without socket lock
  net: mptcp: move mptcp_cancel_work() to protocol.h
  net: mptcp: fix unreleased socket in accept queue

 net/mptcp/protocol.c | 27 ++++++++++++++-------------
 net/mptcp/protocol.h |  9 +++++++++
 net/mptcp/subflow.c  | 37 +++++++++++--------------------------
 3 files changed, 34 insertions(+), 39 deletions(-)

-- 
2.37.2


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

end of thread, other threads:[~2022-09-10  4:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09  5:49 [PATCH net v4 0/3] net: mptcp: fix unreleased socket in accept queue menglong8.dong
2022-09-09  5:49 ` [PATCH net v4 1/3] net: mptcp: factor out __mptcp_close() without socket lock menglong8.dong
2022-09-09  7:31   ` Paolo Abeni
2022-09-10  4:22     ` Menglong Dong
2022-09-09  5:49 ` [PATCH net v4 2/3] net: mptcp: move mptcp_cancel_work() to protocol.h menglong8.dong
2022-09-09  7:33   ` Paolo Abeni
2022-09-10  4:22     ` Menglong Dong
2022-09-09  5:49 ` [PATCH net v4 3/3] net: mptcp: fix unreleased socket in accept queue menglong8.dong
2022-09-09  7:40   ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).