Skip to content

mptcp: plug mptcp_accept memory leaks

Florian Westphal mptcp 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 2 repliesSuperseded
  3. v13 patches 3 repliesSuperseded

v2 from the cover letter

- rename helper in patch 2
- add back crucial mptcp_init_sock() after clone in patch 3. This was lost during rebase and broke the tests but i forgot to refresh this patch when i sent v1.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mptcp: release mptcp socket in mptcp_closenet/mptcp/protocol.c+5 -00 replies
2/3mptcp: store tcp socket, not tcp sock in subflow ctxnet/mptcp/protocol.c net/mptcp/protocol.h net/mptcp/subflow.c+22 -170 replies
3/3mptcp: accept: don't leak mptcp socket structurenet/mptcp/protocol.c+46 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [MPTCP] [PATCH mptcp v3 0/3] mptcp: plug mptcp_accept memory leaks

v3: rebase & fix erroneous conditional in patch #3.

v2 cover letter:
v2:
- rename helper in patch 2
- add back crucial mptcp_init_sock() after clone in patch 3. This was lost during rebase and broke the tests but i forgot to refresh this patch when i sent v1.

This series resolves the memory leaks that occur when running mptcp_connect.sh.

I don't mind if they get squashed.
I've decided to split this into 3 distinct changes to make it a bit clearer what is going on.

Second patch is not a bug fix, i can resend and drop it if the consensus is to continue using the sk->sk_socket back reference.

Third patch is a bit large due to the change in how the new mptcp socket is created.

See the commit messages for more details.
After these changes kmemleak doesn't report any leaks when the test script has completed.