Skip to content

Commit 4b5af44

Browse files
Paolo Abenidavem330
authored andcommitted
mptcp: don't leak msk in token container
If a listening MPTCP socket has unaccepted sockets at close time, the related msks are freed via mptcp_sock_destruct(), which in turn does not invoke the proto->destroy() method nor the mptcp_token_destroy() function. Due to the above, the child msk 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. Fixes: 79c0949 ("mptcp: Add key generation and token tree") Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5969856 commit 4b5af44

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/mptcp/subflow.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ static void mptcp_sock_destruct(struct sock *sk)
393393
sock_orphan(sk);
394394
}
395395

396+
mptcp_token_destroy(mptcp_sk(sk)->token);
396397
inet_sock_destruct(sk);
397398
}
398399

0 commit comments

Comments
 (0)