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 4FE013AA1BA; Tue, 16 Jun 2026 17:55:03 +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=1781632505; cv=none; b=bSAS0CSu8LuarjAC+l8yp7JxPoRRLhXXVnRnN7Kjyq8hc42gk64ec1fKFgEQTHkpjY0dTlzDmeKRRA5L714y5wrklhO9pVx6qGTZJu4JGxwgmfzrfXwTRfw2GY96J+hogTi/mayneRL5KWBv4zpaXFEglUCvWJBuja0IkJp8n0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781632505; c=relaxed/simple; bh=eVL1Rv6n9z6TGeLorSGdVaHUJTISmVl4T01wwudNu5c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V0OCRGJpPTokJZJoE8VHwv+gaHgv208hUvGvZ9/3iVEV8WZMG/xe/7Pe60lU3gf9P2XfPT8NcbGqWQKXxe9CV709QPgwJiBjgSN41H9E4ecayuk6mHsPu3bbj+PSLk8PEf758RFgQKsKHL8+wHV8StBWyXQ/T1QyfTh9PLqCoPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dDii0nQk; 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="dDii0nQk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C0161F000E9; Tue, 16 Jun 2026 17:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781632503; bh=P7YZu+i0/1BOt+ARDGEuo3UQNOl0WjZkjSKqLT7N+DE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dDii0nQkbQbdGRuUUVFLDKaS5dgg6fZa5daOvMDY/2xwwag8gdP/PXGiw3LLf/EpY fPrxek+5QpOrH8HLuxxnv0/jUS+BZ8Af7Z4Z59+UzhapDk8PHkqwb3aTMUugnOjm98 taPA4wNW2kPgwweRs83rIFLaKy3rPYmwp8KQwy64= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mat Martineau , "Matthieu Baerts (NGI0)" , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 424/522] mptcp: pm: ADD_ADDR rtx: fix potential data-race Date: Tue, 16 Jun 2026 20:29:31 +0530 Message-ID: <20260616145145.824087750@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145125.307082728@linuxfoundation.org> References: <20260616145125.307082728@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Matthieu Baerts (NGI0)" [ 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. Fixes: 00cfd77b9063 ("mptcp: retransmit ADD_ADDR when timeout") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20260505-net-mptcp-pm-fixes-7-1-rc3-v1-3-fca8091060a4@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/mptcp/pm_netlink.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -315,6 +315,13 @@ static void mptcp_pm_add_timer(struct ti 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; @@ -343,6 +350,7 @@ static void mptcp_pm_add_timer(struct ti mptcp_pm_subflow_established(msk); out: + bh_unlock_sock(sk); __sock_put(sk); }