]> git.baikalelectronics.ru Git - kernel.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:34:02 +0000 (13:34 +0100)
commit6738eeeef1c7989f7f6ee4b25845e0fce97e32bb
treecad9b288673f6916544ca31dfd0be3b4527ad4c5
parentde4c1e51b19a0bcf188e3cd368dfa7ce232d2106
mptcp: fix lockdep false positive in mptcp_pm_nl_create_listen_socket()

commit 1c6801ff728db051120bd48f86b83e2410c8fb26 upstream.

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: 8f1319551a64 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mptcp/pm_netlink.c