[PATCH net] MPTCP: fix lock class name family in pm_nl_create_listen_socket

Li Xiasong posted 1 patch 2 days, 19 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20260319112159.3118874-1-lixiasong1@huawei.com
net/mptcp/pm_kernel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH net] MPTCP: fix lock class name family in pm_nl_create_listen_socket
Posted by Li Xiasong 2 days, 19 hours ago
In mptcp_pm_nl_create_listen_socket(), use entry->addr.family
instead of sk->sk_family for lock class setup. The 'sk' parameter
is a netlink socket, not the MPTCP subflow socket being created.

Fixes: cee4034a3db1 ("mptcp: fix lockdep false positive in mptcp_pm_nl_create_listen_socket()")
Signed-off-by: Li Xiasong <lixiasong1@huawei.com>
---
 net/mptcp/pm_kernel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
index b2b9df43960e..82e59f9c6dd9 100644
--- a/net/mptcp/pm_kernel.c
+++ b/net/mptcp/pm_kernel.c
@@ -838,7 +838,7 @@ static struct lock_class_key mptcp_keys[2];
 static int mptcp_pm_nl_create_listen_socket(struct sock *sk,
 					    struct mptcp_pm_addr_entry *entry)
 {
-	bool is_ipv6 = sk->sk_family == AF_INET6;
+	bool is_ipv6 = entry->addr.family == AF_INET6;
 	int addrlen = sizeof(struct sockaddr_in);
 	struct sockaddr_storage addr;
 	struct sock *newsk, *ssk;
-- 
2.34.1
Re: [PATCH net] MPTCP: fix lock class name family in pm_nl_create_listen_socket
Posted by patchwork-bot+netdevbpf@kernel.org 2 days, 14 hours ago
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 19 Mar 2026 19:21:59 +0800 you wrote:
> In mptcp_pm_nl_create_listen_socket(), use entry->addr.family
> instead of sk->sk_family for lock class setup. The 'sk' parameter
> is a netlink socket, not the MPTCP subflow socket being created.
> 
> Fixes: cee4034a3db1 ("mptcp: fix lockdep false positive in mptcp_pm_nl_create_listen_socket()")
> Signed-off-by: Li Xiasong <lixiasong1@huawei.com>
> 
> [...]

Here is the summary with links:
  - [net] MPTCP: fix lock class name family in pm_nl_create_listen_socket
    https://git.kernel.org/netdev/net/c/7ab4a7c5d969

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH net] MPTCP: fix lock class name family in pm_nl_create_listen_socket
Posted by Matthieu Baerts 2 days, 17 hours ago
Hi Li,

On 19/03/2026 12:21, Li Xiasong wrote:
> In mptcp_pm_nl_create_listen_socket(), use entry->addr.family
> instead of sk->sk_family for lock class setup. The 'sk' parameter
> is a netlink socket, not the MPTCP subflow socket being created.
> 
> Fixes: cee4034a3db1 ("mptcp: fix lockdep false positive in mptcp_pm_nl_create_listen_socket()")
> Signed-off-by: Li Xiasong <lixiasong1@huawei.com>
> ---
>  net/mptcp/pm_kernel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
> index b2b9df43960e..82e59f9c6dd9 100644
> --- a/net/mptcp/pm_kernel.c
> +++ b/net/mptcp/pm_kernel.c
> @@ -838,7 +838,7 @@ static struct lock_class_key mptcp_keys[2];
>  static int mptcp_pm_nl_create_listen_socket(struct sock *sk,
>  					    struct mptcp_pm_addr_entry *entry)
>  {
> -	bool is_ipv6 = sk->sk_family == AF_INET6;
> +	bool is_ipv6 = entry->addr.family == AF_INET6;

Good catch! 'sk' name is confusing, it would probably be better to pass
"struct net *" instead. But this can be done later, that's more a
net-next material.

(For next time, please use 'mptcp:' prefix instead of 'MPTCP:' in the
subject, similar to all other commits in this directory.)


Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>


@Netdev maintainers: this patch can be applied in the 'net' tree directly.

>  	int addrlen = sizeof(struct sockaddr_in);
>  	struct sockaddr_storage addr;
>  	struct sock *newsk, *ssk;

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH net] MPTCP: fix lock class name family in pm_nl_create_listen_socket
Posted by MPTCP CI 2 days, 18 hours ago
Hi Li,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Unstable: 1 failed test(s): packetdrill_dss 🔴
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/23292439480

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/41f128de64b6
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1069207


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)