mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH net v5 0/2] net: mptcp: fix unreleased socket in accept queue
@ 2022-09-11  4:14 menglong8.dong
  2022-09-11  4:14 ` [PATCH net v5 1/2] net: mptcp: factor out __mptcp_close() without socket lock menglong8.dong
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: menglong8.dong @ 2022-09-11  4:14 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.

And in the 2th 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 v4:
- keep sock_hold() in __mptcp_close() in the 1th patch
- rename cancel_work to do_cancel_work in the 1th patch
- don't make mptcp_cancel_work() inline in the 2th patch

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

Menglong Dong (2):
  net: mptcp: factor out __mptcp_close() without socket lock
  net: mptcp: fix unreleased socket in accept queue

 net/mptcp/protocol.c | 16 +++++++++++++---
 net/mptcp/protocol.h |  2 ++
 net/mptcp/subflow.c  | 33 +++++++--------------------------
 3 files changed, 22 insertions(+), 29 deletions(-)

-- 
2.37.2


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

end of thread, other threads:[~2022-09-19 15:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-11  4:14 [PATCH net v5 0/2] net: mptcp: fix unreleased socket in accept queue menglong8.dong
2022-09-11  4:14 ` [PATCH net v5 1/2] net: mptcp: factor out __mptcp_close() without socket lock menglong8.dong
2022-09-11  4:14 ` [PATCH net v5 2/2] net: mptcp: fix unreleased socket in accept queue menglong8.dong
2022-09-19 14:17 ` [PATCH net v5 0/2] " Paolo Abeni
2022-09-19 15:14 ` Matthieu Baerts

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).