From nobody Fri Nov 22 08:30:57 2024 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 2538A1D9333; Wed, 4 Sep 2024 14:33:15 +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=1725460396; cv=none; b=NsfJM4t62pVQ90Q7BcCxyoq3OoKl64tPj11QbYC3frjKiR2XLb5toQ7jdI4Uz3KuEzmI24SQea9I9r7ZwkIfrpggC7iLZgmu+FPLdXleajjaQUZedNrpyFR2TvgjXCq9uOwK6vYLF9LJgvWnmHPW2OKY78z6uaeO5t+mKeQFfjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725460396; c=relaxed/simple; bh=NKDd2yuDDdtvsItKxUlH3Pk+YfpEbPY1GQ9/VMnWNnM=; h=Subject:To:Cc:From:Date:In-Reply-To:Message-ID:MIME-Version: Content-Type; b=cHn3o7A0wolsmEllMzhhUeV7I9osI6ytbu4dNbFx7vKdSYwOEn9KhpjrDtusVIsdQPev7kgNQ4G/l+aI/o3DxiOkw0fa1JWvR5HgOZ1jhyAKawUuFdgupET5IU8GdUJrcIfhu+hQ8NUYFV+kjc0e5TcpmI8uAiikdK4HN+28Qlc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SPzXQaOl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SPzXQaOl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 561E5C4CEC2; Wed, 4 Sep 2024 14:33:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725460395; bh=NKDd2yuDDdtvsItKxUlH3Pk+YfpEbPY1GQ9/VMnWNnM=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=SPzXQaOlR3kRKcWOPfVXAwOxb+f4185lrmQg6XcaJMYTj7mv8kIcjXzG9vJZeDqds ykIOjbwo0M36+s29haBuX3U6AjskpWS5tVVbvUC0E5/CHbDVyNZvdhGa0zSP+HMBtU WbSXdmrk177lLHcTf2i5Yb2opTlFVjzHnoUWaIg4= Subject: Patch "mptcp: pm: fullmesh: select the right ID later" has been added to the 6.1-stable tree To: gregkh@linuxfoundation.org,kuba@kernel.org,martineau@kernel.org,matttbe@kernel.org,mptcp@lists.linux.dev Cc: From: Date: Wed, 04 Sep 2024 16:32:51 +0200 In-Reply-To: <20240904105627.4074381-2-matttbe@kernel.org> Message-ID: <2024090450-account-churn-df45@gregkh> 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-stable: commit X-Patchwork-Hint: ignore Content-Type: text/plain; charset="utf-8" This is a note to let you know that I've just added the patch titled mptcp: pm: fullmesh: select the right ID later to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.git= ;a=3Dsummary The filename of the patch is: mptcp-pm-fullmesh-select-the-right-id-later.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From stable+bounces-73001-greg=3Dkroah.com@vger.kernel.org Wed Sep 4 12:58= :26 2024 From: "Matthieu Baerts (NGI0)" Date: Wed, 4 Sep 2024 12:56:28 +0200 Subject: mptcp: pm: fullmesh: select the right ID later To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: MPTCP Upstream , "Matthieu Baerts (NGI0)" , Mat Martineau , Jakub Kicinski Message-ID: <20240904105627.4074381-2-matttbe@kernel.org> From: "Matthieu Baerts (NGI0)" commit 09355f7abb9fbfc1a240be029837921ea417bf4f upstream. When reacting upon the reception of an ADD_ADDR, the in-kernel PM first looks for fullmesh endpoints. If there are some, it will pick them, using their entry ID. It should set the ID 0 when using the endpoint corresponding to the initial subflow, it is a special case imposed by the MPTCP specs. Note that msk->mpc_endpoint_id might not be set when receiving the first ADD_ADDR from the server. So better to compare the addresses. Fixes: 1a0d6136c5f0 ("mptcp: local addresses fullmesh") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-12-38035= d40de5b@kernel.org Signed-off-by: Jakub Kicinski [ Conflicts in pm_netlink.c, because the new 'mpc_addr' variable is added where the 'local' one was, before commit b9d69db87fb7 ("mptcp: let the in-kernel PM use mixed IPv4 and IPv6 addresses"), that is not a candidate for the backports. This 'local' variable has been moved to the new place to reduce the scope, and help with possible future backports. ] Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: Greg Kroah-Hartman --- net/mptcp/pm_netlink.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -648,7 +648,7 @@ static unsigned int fill_local_addresses { struct sock *sk =3D (struct sock *)msk; struct mptcp_pm_addr_entry *entry; - struct mptcp_addr_info local; + struct mptcp_addr_info mpc_addr; struct pm_nl_pernet *pernet; unsigned int subflows_max; int i =3D 0; @@ -656,6 +656,8 @@ static unsigned int fill_local_addresses pernet =3D pm_nl_get_pernet_from_msk(msk); subflows_max =3D mptcp_pm_get_subflows_max(msk); =20 + mptcp_local_address((struct sock_common *)msk, &mpc_addr); + rcu_read_lock(); list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) { if (!(entry->flags & MPTCP_PM_ADDR_FLAG_FULLMESH)) @@ -673,7 +675,13 @@ static unsigned int fill_local_addresses =20 if (msk->pm.subflows < subflows_max) { msk->pm.subflows++; - addrs[i++] =3D entry->addr; + addrs[i] =3D entry->addr; + + /* Special case for ID0: set the correct ID */ + if (mptcp_addresses_equal(&entry->addr, &mpc_addr, entry->addr.port)) + addrs[i].id =3D 0; + + i++; } } rcu_read_unlock(); @@ -682,6 +690,8 @@ static unsigned int fill_local_addresses * 'IPADDRANY' local address */ if (!i) { + struct mptcp_addr_info local; + memset(&local, 0, sizeof(local)); local.family =3D msk->pm.remote.family; =20 Patches currently in stable-queue which might be from matttbe@kernel.org are queue-6.1/mptcp-pm-fix-rm_addr-id-for-the-initial-subflow.patch queue-6.1/selftests-mptcp-join-validate-fullmesh-endp-on-1st-sf.patch queue-6.1/mptcp-pm-fix-id-0-endp-usage-after-multiple-re-creations.patch queue-6.1/mptcp-make-pm_remove_addrs_and_subflows-static.patch queue-6.1/mptcp-pm-avoid-possible-uaf-when-selecting-endp.patch queue-6.1/mptcp-pm-reuse-id-0-after-delete-and-re-add.patch queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-id.patch queue-6.1/selftests-mptcp-join-test-for-flush-re-add-endpoints.patch queue-6.1/selftests-mptcp-add-explicit-test-case-for-remove-re.patch queue-6.1/selftests-mptcp-add-explicit-test-case-for-remove-readd.patch queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-.patch queue-6.1/selftests-mptcp-join-check-re-using-id-of-closed-subflow.patch queue-6.1/mptcp-pm-fullmesh-select-the-right-id-later.patch queue-6.1/mptcp-pr_debug-add-missing-n-at-the-end.patch queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add.patch queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add_addr.patch