From: sashiko-bot@kernel.org
To: "Geliang Tang" <geliang@kernel.org>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v2 1/2] mptcp: give MPTCP sockets a distinct lockdep class
Date: Fri, 16 Oct 2026 01:46:50 +0000 [thread overview]
Message-ID: <sashiko-outbox-173561@kernel.org> (raw)
In-Reply-To: <8651f29fb4e11de14a7ea7d05d97a33b1e5390f3.1792114102.git.tanggeliang@kylinos.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] mptcp: lockdep warning fix bypassed for passive sockets
--
commit 554f965b1a52d1d1bbbc1a03f3a216e91642e81f
Author: Geliang Tang <geliang@kernel.org>
mptcp: give MPTCP sockets a distinct lockdep class
This commit extracts lock reclassification logic into mptcp_reclassify_socket()
and calls it from __mptcp_init_sock() to fix a lockdep "possible recursive
locking" warning. It aims to cover both active and passive socket creation
paths.
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 60cbd91be6320..68f339311993e 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
[ ... ]
> @@ -3245,6 +3245,9 @@ static void __mptcp_init_sock(struct sock *sk)
> /* re-use the csk retrans timer for MPTCP-level retrans */
> timer_setup(&sk->mptcp_retransmit_timer, mptcp_retransmit_timer, 0);
> timer_setup(&msk->sk.mptcp_tout_timer, mptcp_tout_timer, 0);
> +
> + if (sk->sk_socket)
> + mptcp_reclassify_socket(sk);
[Severity: Medium]
Does this check evaluate to false for cloned passive sockets, bypassing the
lock reclassification entirely?
During passive socket creation, mptcp_sk_clone_init() calls sk_clone_lock(),
which clones the socket, acquires its spinlock, and explicitly clears sk_socket:
net/core/sock.c:sk_clone() {
...
sk_set_socket(newsk, NULL);
...
}
When mptcp_sk_clone_init() then calls __mptcp_init_sock(), sk->sk_socket
is NULL, causing the intended lockdep fix to be bypassed for passive sockets.
Additionally, if mptcp_reclassify_socket() were called unconditionally here
without the sk_socket check, would it re-initialize the actively held spinlock
from sk_clone_lock() and cause a BUG on unlock?
> }
>
> static void mptcp_ca_reset(struct sock *sk)
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1792114102.git.tanggeliang@kylinos.cn?part=1
next prev parent reply other threads:[~2026-10-16 1:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 1:35 [PATCH mptcp-next v2 0/2] add distinct lockdep class for MPTCP sockets Geliang Tang
2026-10-16 1:35 ` [PATCH mptcp-next v2 1/2] mptcp: give MPTCP sockets a distinct lockdep class Geliang Tang
2026-10-16 1:46 ` sashiko-bot [this message]
2026-10-16 8:03 ` Matthieu Baerts
2026-10-16 1:35 ` [PATCH mptcp-next v2 2/2] mptcp: kunit: add sockopt test for subflow socket locking Geliang Tang
2026-10-16 8:05 ` Matthieu Baerts
2026-10-16 2:49 ` [PATCH mptcp-next v2 0/2] add distinct lockdep class for MPTCP sockets MPTCP CI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-173561@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=geliang@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.