From: Matthieu Baerts <matttbe@kernel.org>
To: gang.yan@linux.dev, sashiko-reviews@lists.linux.dev
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v3 5/5] Squash to "mptcp: pm: init and release mptcp_pm_ops"
Date: Thu, 20 Aug 2026 13:06:22 +0200 [thread overview]
Message-ID: <1e62d538-721f-486b-bb91-64864b3c5c8d@kernel.org> (raw)
In-Reply-To: <74e63e9935103e9fab16ea81e0ea7480f9c7d736@linux.dev>
On 20/08/2026 12:16, gang.yan@linux.dev wrote:
> August 20, 2026 at 5:07 PM, "Matthieu Baerts" <matttbe@kernel.org mailto:matttbe@kernel.org?to=%22Matthieu%20Baerts%22%20%3Cmatttbe%40kernel.org%3E > wrote:
>
>> Can you first check if this can happen? I thought that
>> mptcp_destroy_common would first close all subflows, remove the token,
>> then release everything linked to the PM → so the PM will no longer be
>> called at that point for this msk, right? (I didn't check)
>>
>
> Hi Matt,
>
> Thans for looking at this and kindly remind.
> Yes, I just checked the order you described is right, but I thought it
> could happen in such order:
>
> CPU A (softirq) CPU B(disconnect)
> ->subflow_token_join_request
> ->mptcp_token_get_sock()
> ->mptcp_destroy_common()
> ->pm_ops_release
> ->mptcp_pm_get_local_id():
> msk->pm.ops->get_local_id() <- NULL deref
Ah yes, indeed, subflow_token_join_request doesn't hold the msk lock.
> WDYT? And, I think the window seems too narrow, we may not see it in practice,
> maybe a NULL check is enough?
Would it be safe to have a NULL check? Could you have something like this?
CPU A CPU B
-> if (ops)
-> mptcp_destroy_common()
-> pm_ops_release()
-> msk->pm.ops->get_local_id()
The BPF module might have been unloaded.
(Again, I didn't check in details, only looking at your reply.)
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2026-08-20 11:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 12:56 [PATCH mptcp-next v3 0/5] mptcp: avoid data-races around the sysctls Gang Yan
2026-08-19 12:56 ` [PATCH mptcp-next v3 1/5] mptcp: sched: change scheduler sysctl atomically Gang Yan
2026-08-19 12:56 ` [PATCH mptcp-next v3 2/5] mptcp: pm: change path_manager " Gang Yan
2026-08-19 12:56 ` [PATCH mptcp-next v3 3/5] mptcp: use READ_ONCE() over sysctls Gang Yan
2026-08-19 12:56 ` [PATCH mptcp-next v3 4/5] mptcp: pm: use WRITE_ONCE() for the pm_type sysctl Gang Yan
2026-08-19 12:56 ` [PATCH mptcp-next v3 5/5] Squash to "mptcp: pm: init and release mptcp_pm_ops" Gang Yan
2026-08-19 13:12 ` sashiko-bot
2026-08-20 6:36 ` gang.yan
2026-08-20 9:07 ` Matthieu Baerts
2026-08-20 10:16 ` gang.yan
2026-08-20 11:06 ` Matthieu Baerts [this message]
2026-08-20 11:39 ` gang.yan
2026-08-20 7:56 ` [PATCH mptcp-next v3 0/5] mptcp: avoid data-races around the sysctls 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=1e62d538-721f-486b-bb91-64864b3c5c8d@kernel.org \
--to=matttbe@kernel.org \
--cc=gang.yan@linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox