Skip to content

Commit

Permalink
mptcp: don't leak msk in token container
Browse files Browse the repository at this point in the history
When the left-over msk is freed by subflow_syn_recv_sock(),
we don't invoke the proto->destroy() method, to the socket
is not removed from the token container, leading to later
UaF.

Address the issue explicitly removing the token even in the
above error path.

Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Paolo Abeni authored and jenkins-tessares committed Jun 5, 2020
1 parent 3c886ec commit 36b7954
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/mptcp/subflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ static void mptcp_sock_destruct(struct sock *sk)
sock_orphan(sk);
}

mptcp_token_destroy(mptcp_sk(sk));
inet_sock_destruct(sk);
}

Expand Down

0 comments on commit 36b7954

Please sign in to comment.