Commit 13a9499e authored by Paolo Abeni's avatar Paolo Abeni Committed by Jakub Kicinski

mptcp: fix locking in mptcp_disconnect()

tcp_disconnect() expects the caller acquires the sock lock,
but mptcp_disconnect() is not doing that. Add the missing
required lock.
Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Fixes: 76e2a55d ("mptcp: better msk-level shutdown.")
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/f818e82b58a556feeb71dcccc8bf1c87aafc6175.1610638176.git.pabeni@redhat.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 25537d71
...@@ -2646,8 +2646,13 @@ static int mptcp_disconnect(struct sock *sk, int flags) ...@@ -2646,8 +2646,13 @@ static int mptcp_disconnect(struct sock *sk, int flags)
struct mptcp_sock *msk = mptcp_sk(sk); struct mptcp_sock *msk = mptcp_sk(sk);
__mptcp_flush_join_list(msk); __mptcp_flush_join_list(msk);
mptcp_for_each_subflow(msk, subflow) mptcp_for_each_subflow(msk, subflow) {
tcp_disconnect(mptcp_subflow_tcp_sock(subflow), flags); struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
lock_sock(ssk);
tcp_disconnect(ssk, flags);
release_sock(ssk);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment