]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: don't leak msk in token container
authorPaolo Abeni <pabeni@redhat.com>
Wed, 10 Jun 2020 08:49:00 +0000 (10:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Jun 2020 23:07:00 +0000 (16:07 -0700)
commit869856a3d8b385f5ee55fec2975180422e9802ff
tree3877dcdff57f964dad44d3f2e6f562e4ae758b07
parent00aa040cdbf34b9faf249825fd7a87c846ce0a0e
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: 763873e77a3e ("mptcp: Add key generation and token tree")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/subflow.c