From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EB6CC30AAC8 for ; Mon, 27 Oct 2025 16:37:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761583029; cv=none; b=Yyw+RTA/+tR+JIXrSk5RW9Dgo3uipQ4tEjdV1K+yfzlH5AvX/THQ9tCpYufORqflkbLXzlkGfl88WQGpfymREKmoIV62vjaN9BkdDRXkXOvHRbkrj+Xa0bQ+/ESdH+s3zqWAPzqmynj7P01MO9OMT7/HgV+Xz2q1kfKH2KkqJq0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761583029; c=relaxed/simple; bh=kb8/KlNpxSqXw/8IyqJVI3d0Z3qm7JCTI5HwwdyJAqo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=moinJRjTOZkVcHgiW+xPudbBDM1YrqWSPHv68hz+0wV5T+uZlg/oHYwVHV7CqCz9krjRGEzyX8tn9Iv3G1AW1B252QAne4xnTNLDwc4Z942pLjwRRyZV0R9nC8nYE5tSBDCPA6bG1YXmkSoQQKUkOkmL0NVJlJ9p9VXqOq3Sn24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E9oELwSO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E9oELwSO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB292C4CEF1; Mon, 27 Oct 2025 16:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761583026; bh=kb8/KlNpxSqXw/8IyqJVI3d0Z3qm7JCTI5HwwdyJAqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E9oELwSO37ybgtW6Q1EM2tNvh7YQexOOiZWiLonwu8l6ibZ6776K38ZucYJjqol51 v4w698UEvbpjFxdBUYmIKTVTIagt2uUhs6GfpOzvNoTvlRs8/Hnd4uAXA3IDVF/WA8 cnR6TzZy7wN/Zk//R5e1myufFNuM05S/L4KhHx4e9CAt5Q9FMltwrZ/7qi5WDrSyod 3F9I8ZotUUyrJiKvl2LLLHtFxxSShgvQZQNMu5VTVb/YcyIAZPt2p/x96zE7A3lJy0 Z/PyQnB8qeLmlL2PoVXm9Uq3Zw8+3sHxDcA5Qsih8UzM6mPab+X48sqbo+2TGgi/DO lkwhmN71cb+7Q== From: Sasha Levin To: stable@vger.kernel.org Cc: "Matthieu Baerts (NGI0)" , Geliang Tang , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1.y] mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR Date: Mon, 27 Oct 2025 12:37:03 -0400 Message-ID: <20251027163703.582252-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2025102642-improper-revered-93ac@gregkh> References: <2025102642-improper-revered-93ac@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Matthieu Baerts (NGI0)" [ Upstream commit e84cb860ac3ce67ec6ecc364433fd5b412c448bc ] The special C-flag case expects the ADD_ADDR to be received when switching to 'fully-established'. But for various reasons, the ADD_ADDR could be sent after the "4th ACK", and the special case doesn't work. On NIPA, the new test validating this special case for the C-flag failed a few times, e.g. 102 default limits, server deny join id 0 syn rx [FAIL] got 0 JOIN[s] syn rx expected 2 Server ns stats (...) MPTcpExtAddAddrTx 1 MPTcpExtEchoAdd 1 Client ns stats (...) MPTcpExtAddAddr 1 MPTcpExtEchoAddTx 1 synack rx [FAIL] got 0 JOIN[s] synack rx expected 2 ack rx [FAIL] got 0 JOIN[s] ack rx expected 2 join Rx [FAIL] see above syn tx [FAIL] got 0 JOIN[s] syn tx expected 2 join Tx [FAIL] see above I had a suspicion about what the issue could be: the ADD_ADDR might have been received after the switch to the 'fully-established' state. The issue was not easy to reproduce. The packet capture shown that the ADD_ADDR can indeed be sent with a delay, and the client would not try to establish subflows to it as expected. A simple fix is not to mark the endpoints as 'used' in the C-flag case, when looking at creating subflows to the remote initial IP address and port. In this case, there is no need to try. Note: newly added fullmesh endpoints will still continue to be used as expected, thanks to the conditions behind mptcp_pm_add_addr_c_flag_case. Fixes: 4b1ff850e0c1 ("mptcp: pm: in-kernel: usable client side with C-flag") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20251020-net-mptcp-c-flag-late-add-addr-v1-1-8207030cb0e8@kernel.org Signed-off-by: Jakub Kicinski [ applied to pm_netlink.c instead of pm_kernel.c ] Signed-off-by: Sasha Levin --- net/mptcp/pm_netlink.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 614ddae9c0a5b..b7a49010e2a78 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -623,6 +623,10 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) } subflow: + /* No need to try establishing subflows to remote id0 if not allowed */ + if (mptcp_pm_add_addr_c_flag_case(msk)) + goto exit; + /* check if should create a new subflow */ while (msk->pm.local_addr_used < local_addr_max && msk->pm.subflows < subflows_max) { @@ -654,6 +658,8 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) __mptcp_subflow_connect(sk, &local.addr, &addrs[i]); spin_lock_bh(&msk->pm.lock); } + +exit: mptcp_pm_nl_check_work_pending(msk); } -- 2.51.0