From nobody Sat Jun 27 10:05:08 2026 Received: from canpmsgout03.his.huawei.com (canpmsgout03.his.huawei.com [113.46.200.218]) (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 CD05F3BE623 for ; Thu, 30 Apr 2026 10:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777546754; cv=none; b=PkpY6YfjfBxkbVe5cPVZwzA+je0IzP57AGSNL/RcsMTFNfSc5QbBvRSyabjtIpsTm68PUtSfZDhlQBy02AO0yi/6XZnLsn67APwJhUZszAr+D76jE6URJ7cryJh0Qf+jYw+wBbthdGojqRAm/qWvGwmXuIX/6Ta0sDYrK7eLM7s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777546754; c=relaxed/simple; bh=gaPWN26xhYkFH1aZ743VzyjxXZ98+OjhnhPa1ujgKQM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nvuRSMqp49lM4uT0/7rgy3VbAtWzSi8VHSKQ+FXa1tCzj0mppPxO4pNqUs6t5x2ZgoktFh/kbiLRv1+a86atVdl6JGpskzqRL5DR7iIxxIohLzzcoHTvKhb6cRIqEw7DtHQmj/7ZFtuU7VA6yatEHNB9vx9eaX8YRuoZiWaAqs0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=AIGS/p2I; arc=none smtp.client-ip=113.46.200.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="AIGS/p2I" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=KQwJFIAA/GiPHvAcWuWyTgGr+QgLBDKSRsya3RNQa60=; b=AIGS/p2IwCpfSnIxpnhZMvtnxJ3KARo0MeN7VuiSMtRvzByP+RU2zEEWWfGGJWwD13O+I+Sml hTQqdp4DadHmA98jji1rvRNexWSbDfqU+TJFIXJLdJw8KAYZvpdawo8phTwu+zewcXXWRu4dzuG IqClAAqJPIGTKj/xaV+GkrI= Received: from mail.maildlp.com (unknown [172.19.162.144]) by canpmsgout03.his.huawei.com (SkyGuard) with ESMTPS id 4g5rbX0NN1zpStj for ; Thu, 30 Apr 2026 18:52:24 +0800 (CST) Received: from kwepemj500018.china.huawei.com (unknown [7.202.194.48]) by mail.maildlp.com (Postfix) with ESMTPS id CDEF74056E for ; Thu, 30 Apr 2026 18:59:02 +0800 (CST) Received: from huawei.com (10.50.85.128) by kwepemj500018.china.huawei.com (7.202.194.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 30 Apr 2026 18:59:02 +0800 From: Li Xiasong To: CC: , , , Subject: [PATCH mptcp-net v2 1/2] mptcp: pm: fix ADD_ADDR timer infinite retry on option space insufficient Date: Thu, 30 Apr 2026 19:20:25 +0800 Message-ID: <20260430112026.343691-2-lixiasong1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260430112026.343691-1-lixiasong1@huawei.com> References: <20260430112026.343691-1-lixiasong1@huawei.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems500001.china.huawei.com (7.221.188.70) To kwepemj500018.china.huawei.com (7.202.194.48) Content-Type: text/plain; charset="utf-8" When TCP option space is insufficient (e.g., when sending ADD_ADDR with an IPv6 address and port while tcp_timestamps is enabled), the original code jumped to out_unlock without clearing the addr_signal flag. This caused mptcp_pm_add_timer to keep rescheduling indefinitely, not sending ADD_ADDR, preventing subsequent addresses in the endpoint list from being announced. Handle this case by clearing the ADD_ADDR signal and skipping the matching ADD_ADDR retransmission entry. The skip path cancels the matching timer (with id check) and advances PM state progression, preserving forward progress to subsequent PM work. This avoids endless retries for an ADD_ADDR that cannot be emitted in the current pure-ACK option-space constrained path. Fixes: 00cfd77b9063 ("mptcp: retransmit ADD_ADDR when timeout") Signed-off-by: Li Xiasong --- net/mptcp/pm.c | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 57a456690406..a94177d9f265 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -401,6 +401,13 @@ mptcp_pm_del_add_timer(struct mptcp_sock *msk, return entry; } =20 +static void mptcp_pm_add_addr_skip(struct mptcp_sock *msk, + const struct mptcp_addr_info *addr) +{ + mptcp_pm_del_add_timer(msk, addr, true); + mptcp_pm_subflow_established(msk); +} + bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk, const struct mptcp_addr_info *addr) { @@ -860,6 +867,7 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, c= onst struct sk_buff *skb, struct mptcp_addr_info *addr, bool *echo, bool *drop_other_suboptions) { + bool skip_add_addr =3D false; int ret =3D false; u8 add_addr; u8 family; @@ -881,24 +889,47 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk,= const struct sk_buff *skb, } =20 *echo =3D mptcp_pm_should_add_signal_echo(msk); - port =3D !!(*echo ? msk->pm.remote.port : msk->pm.local.port); - - family =3D *echo ? msk->pm.remote.family : msk->pm.local.family; - if (remaining < mptcp_add_addr_len(family, *echo, port)) - goto out_unlock; - if (*echo) { *addr =3D msk->pm.remote; add_addr =3D msk->pm.addr_signal & ~BIT(MPTCP_ADD_ADDR_ECHO); + port =3D !!msk->pm.remote.port; + family =3D msk->pm.remote.family; } else { *addr =3D msk->pm.local; add_addr =3D msk->pm.addr_signal & ~BIT(MPTCP_ADD_ADDR_SIGNAL); + port =3D !!msk->pm.local.port; + family =3D msk->pm.local.family; } - WRITE_ONCE(msk->pm.addr_signal, add_addr); + + if (remaining < mptcp_add_addr_len(family, *echo, port)) { + struct net *net =3D sock_net((struct sock *)msk); + + if (!*drop_other_suboptions) + goto out_unlock; + + if (*echo) { + MPTCP_INC_STATS(net, MPTCP_MIB_ECHOADDTXDROP); + } else { + skip_add_addr =3D true; + MPTCP_INC_STATS(net, MPTCP_MIB_ADDADDRTXDROP); + } + goto drop_signal_mark; + } + ret =3D true; =20 +drop_signal_mark: + WRITE_ONCE(msk->pm.addr_signal, add_addr); + out_unlock: spin_unlock_bh(&msk->pm.lock); + + /* On pure-ACK option-space exhaustion, stop retrying this ADD_ADDR: + * clear the signal bit, cancel the matching retransmission timer, and + * let the PM state machine progress. + */ + if (skip_add_addr) + mptcp_pm_add_addr_skip(msk, addr); return ret; } =20 --=20 2.34.1