]> git.dujemihanovic.xyz Git - linux.git/commit
mptcp: fix lockdep false positive in mptcp_pm_nl_create_listen_socket()
authorPaolo Abeni <pabeni@redhat.com>
Thu, 9 Mar 2023 14:50:04 +0000 (15:50 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Mar 2023 05:42:56 +0000 (21:42 -0800)
commitcee4034a3db1d30c3243dd51506a9d4ab1a849fa
treeffd410e1124391f1527773d9d5d762391f14ca5a
parent3ba14528684f528566fb7d956bfbfb958b591d86
mptcp: fix lockdep false positive in mptcp_pm_nl_create_listen_socket()

Christoph reports a lockdep splat in the mptcp_subflow_create_socket()
error path, when such function is invoked by
mptcp_pm_nl_create_listen_socket().

Such code path acquires two separates, nested socket lock, with the
internal lock operation lacking the "nested" annotation. Adding that
in sock_release() for mptcp's sake only could be confusing.

Instead just add a new lockclass to the in-kernel msk socket,
re-initializing the lockdep infra after the socket creation.

Fixes: ad2171009d96 ("mptcp: fix locking for in-kernel listener creation")
Cc: stable@vger.kernel.org
Reported-by: Christoph Paasch <cpaasch@apple.com>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/354
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Tested-by: Christoph Paasch <cpaasch@apple.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm_netlink.c