Skip to content

Commit

Permalink
Revert "mptcp: fix possible memory leak on syn_recv race"
Browse files Browse the repository at this point in the history
This reverts commit 1272755.

According to Paolo, this one is causing issue #370 and it was needed
because of "mptcp: drop legacy code".

Closes: #370
Signed-off-by: Matthieu Baerts <[email protected]>
  • Loading branch information
matttbe committed Mar 9, 2023
1 parent 413207f commit 7f66433
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions net/mptcp/subflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
child = listener->icsk_af_ops->syn_recv_sock(sk, skb, req, dst,
req_unhash, own_req);

if (likely(child && *own_req)) {
if (child && *own_req) {
struct mptcp_subflow_context *ctx = mptcp_subflow_ctx(child);

tcp_rsk(req)->drop_req = false;
Expand Down Expand Up @@ -898,12 +898,6 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKRX);
tcp_rsk(req)->drop_req = true;
}
} else if (child) {
/* inet_csk_complete_hashdance() is going to drop the sock
* soon, but context must be explicitly deleted or will be
* leaked
*/
mptcp_subflow_drop_ctx(child);
}

out:
Expand Down

0 comments on commit 7f66433

Please sign in to comment.