mptcp: properly annotate nested lock
authorPaolo Abeni <pabeni@redhat.com>
Wed, 16 Dec 2020 11:48:33 +0000 (12:48 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 17 Dec 2020 18:24:47 +0000 (10:24 -0800)
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 <geliangtang@gmail.com>
Fixes: e16163b6e2b7 ("mptcp: refactor shutdown and close")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c

index d24243a..64c0c54 100644 (file)
@@ -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