From: Paolo Abeni Date: Wed, 16 Dec 2020 11:48:33 +0000 (+0100) Subject: mptcp: properly annotate nested lock X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3f8b2667f257c21a992bda33bfb919ee164a429c;p=linux.git mptcp: properly annotate nested lock MPTCP closes the subflows while holding the msk-level lock. While acquiring the subflow socket lock we need to use the correct nested annotation, or we can hit a lockdep splat at runtime. Reported-and-tested-by: Geliang Tang Fixes: e16163b6e2b7 ("mptcp: refactor shutdown and close") Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Jakub Kicinski --- diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index d24243a28fced..64c0c54c80e80 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2119,7 +2119,7 @@ void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, list_del(&subflow->node); - lock_sock(ssk); + lock_sock_nested(ssk, SINGLE_DEPTH_NESTING); /* if we are invoked by the msk cleanup code, the subflow is * already orphaned