From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0B483B9D95 for ; Thu, 20 Aug 2026 10:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787222568; cv=none; b=VvDRT/mPv2h2FzWLVxQqCeEqyAoF9q3P6/GkjDvTSjtglV7VVYAfTjeaoszuoY1uaL1luWg3JmdtDDJK1gqKXDAPBMOpRP8fYt0/y9YK3fe1YxGO4ekhF13vGblFQkUhzUVZZq+2ygwF2uAWVf7hggwHA3Un36m34AL/ErHrRPI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787222568; c=relaxed/simple; bh=ba8PrxWWrP/iVbqM+kJLR3mSlO0e93ezQE3AK1SQH+E=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=BYk3TGoB2cpG3JttO47Y/UGFO6Cr6b6YrKs9cBwNDST7H0y5fE+AljJCkDJpeRKlOx5iavFlUkQEh5eKPTK7aStvPlQSu1GUw8l4EzRZnrf9/Hd9n+fZwlFHLRc3pX2ZNu/SJFQFHakqY6AEWqPUhPjxj29il/dDqqy2As8pPrk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ukErEWRW; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ukErEWRW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04EA41F000E9; Thu, 20 Aug 2026 10:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787222567; bh=B7twN6cb9rJcFk25Zr1ARxI6aVd53+i0JVuJzRZwHXI=; h=Subject:To:Cc:From:Date; b=ukErEWRWLyzXSanKw6ZD6TW0MYS3Mywug9Wtk7GLSBGO4THPLpNW4OkZGojKTH30n xafb9U5/IQZ17PFapCLWWMTT+Ylsjwle6UlQGwU9ULRU260KwjOsIV1uCK5hpFBxtE az8bWWb4wZfsfhEbQ9qw4qDek6GtlN99tw+5ijrQ= Subject: FAILED: patch "[PATCH] mptcp: pm: fix data race in add_addr timer callback" failed to apply to 5.15-stable tree To: luoqing@kylinos.cn,kuba@kernel.org,matttbe@kernel.org Cc: From: Date: Thu, 20 Aug 2026 12:42:26 +0200 Message-ID: <2026082026-treble-stylized-d851@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x a7aad5b69d3bdaec20a3ed9284e184502450c0cd # git commit -s git send-email --to '' --in-reply-to '2026082026-treble-stylized-d851@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From a7aad5b69d3bdaec20a3ed9284e184502450c0cd Mon Sep 17 00:00:00 2001 From: Qing Luo Date: Mon, 3 Aug 2026 18:16:36 +0200 Subject: [PATCH] mptcp: pm: fix data race in add_addr timer callback The timer callback reads entry->retrans_times outside pm.lock to decide whether to call mptcp_pm_subflow_established(). Since mptcp_pm_announced_del_timer() can concurrently set retrans_times = ADD_ADDR_RETRANS_MAX under pm.lock, a race condition exists. I discovered this issue while studying the code. AI tools helped me to verify the issue can potentially happen under race conditions. Use a local 'retransmit' flag set inside pm.lock to capture whether retransmission is still possible when the lock is taken. This allows to call mptcp_pm_subflow_established() accordingly, and not depending on the situation that can be different when checked outside the pm.lock. Fixes: 348d5c1dec60 ("mptcp: move to next addr when timeout") Cc: stable@vger.kernel.org Signed-off-by: Qing Luo Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20260803-net-mptcp-misc-fixes-7-2-rc6-v2-4-b8f496d71664@kernel.org Signed-off-by: Jakub Kicinski diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 6afd39aea110..c71dcf887683 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -380,6 +380,7 @@ static void mptcp_pm_add_addr_timer(struct timer_list *timer) struct mptcp_sock *msk = entry->sock; struct sock *sk = (struct sock *)msk; unsigned int timeout = 0; + bool retransmit; pr_debug("msk=%p\n", msk); @@ -412,14 +413,15 @@ static void mptcp_pm_add_addr_timer(struct timer_list *timer) entry->retrans_times++; } - if (entry->retrans_times < ADD_ADDR_RETRANS_MAX) + retransmit = entry->retrans_times < ADD_ADDR_RETRANS_MAX; + if (retransmit) timeout <<= entry->retrans_times; else timeout = 0; spin_unlock_bh(&msk->pm.lock); - if (entry->retrans_times == ADD_ADDR_RETRANS_MAX) + if (!retransmit) mptcp_pm_subflow_established(msk); out: