Skip to content

Commit

Permalink
mptcp: properly annotate nested lock
Browse files Browse the repository at this point in the history
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 <[email protected]>
Fixes: e16163b ("mptcp: refactor shutdown and close")
Signed-off-by: Paolo Abeni <[email protected]>
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Paolo Abeni authored and kuba-moo committed Dec 17, 2020
1 parent 0c14846 commit 3f8b266
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f8b266

Please sign in to comment.