FAILED: patch "[PATCH] mptcp: pm: ADD_ADDR rtx: fix potential data-race" failed to apply to 6.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.1-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 <[email protected]>.
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-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 5cd6e0ad79d2615264f63929f8b457ad97ae550d
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026051215-bacon-cartoon-33fb@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 5cd6e0ad79d2615264f63929f8b457ad97ae550d Mon Sep 17 00:00:00 2001
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Tue, 5 May 2026 17:00:51 +0200
Subject: [PATCH] mptcp: pm: ADD_ADDR rtx: fix potential data-race
This mptcp_pm_add_timer() helper is executed as a timer callback in softirq context. To avoid any data races, the socket lock needs to be held with bh_lock_sock().
If the socket is in use, retry again soon after, similar to what is done with the keepalive timer.
net/mptcp/pm.c +8 -0
@@ -337,6 +337,13 @@ static void mptcp_pm_add_timer(struct timer_list *timer)if (inet_sk_state_load (sk) ==TCP_CLOSE )return ; +bh_lock_sock (sk); +if (sock_owned_by_user (sk)) { +/* Try again later. */ +sk_reset_timer (sk, timer, jiffies +HZ /20 ); + goto out; + } +if (mptcp_pm_should_add_signal_addr (msk)) {sk_reset_timer (sk, timer, jiffies +TCP_RTO_MAX /8 ); goto out;
@@ -365,6 +372,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)mptcp_pm_subflow_established (msk); out: +bh_unlock_sock (sk);__sock_put (sk); }
Sasha Levin
maintainerPATCH 1/1 mptcp: pm: ADD_ADDR rtx: fix potential data-race
From: "Matthieu Baerts (NGI0)" <[email protected]>
[ Upstream commit 5cd6e0ad79d2615264f63929f8b457ad97ae550d ]
This mptcp_pm_add_timer() helper is executed as a timer callback in softirq context. To avoid any data races, the socket lock needs to be held with bh_lock_sock().
If the socket is in use, retry again soon after, similar to what is done with the keepalive timer.
--- net/mptcp/pm_netlink.c | 8 ++++++++ 1 file changed, 8 insertions(+)
net/mptcp/pm_netlink.c +8 -0
@@ -318,6 +318,13 @@ static void mptcp_pm_add_timer(struct timer_list *timer)if (!entry->addr.id)return ; +bh_lock_sock (sk); +if (sock_owned_by_user (sk)) { +/* Try again later. */ +sk_reset_timer (sk, timer, jiffies +HZ /20 ); + goto out; + } +if (mptcp_pm_should_add_signal_addr (msk)) {sk_reset_timer (sk, timer, jiffies +TCP_RTO_MAX /8 ); goto out;
@@ -346,6 +353,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)mptcp_pm_subflow_established (msk); out: +bh_unlock_sock (sk);__sock_put (sk); }
Signature · 1 line
2.53.0