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 BEFA217A300 for ; Mon, 18 May 2026 13:45:31 +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=1779111931; cv=none; b=HXIB1VlX5AfhpDlIrSMds7es7mN3qldmZTsyXnkCAbdyXlVvTGdPB+9G4QfGOAKmBKHsYwleG+RBzBXBgUg098nYdhuavRHZrAqRaCY7yGhBzOCjNBoe6oBoXDKUbzxlxLIhD4wv9iatT6O3TjXMMd9X9FoSwBh1vbudx5zfSr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779111931; c=relaxed/simple; bh=JCtKFrjOvCVCJbxtpy0KDerGz0qSjPSw1fu0wUmhGfQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WG9KK0q+7x+VrGcDC3FnntImtl6Hbcdzb5hwWOf38nbQbbkY3Z0ugd8K/7DO3cNfjeHEpHUEr1hvxx3IBPnwTvOQq6HZizARCzewpRhVGd0tL60qiUrshbRzYq4Q08easfZhReEazlGH02iUeJnOjUP/BIzXQqZmJjXMEqFXvjg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=saSHdwa9; 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="saSHdwa9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C968DC2BCB7; Mon, 18 May 2026 13:45:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779111931; bh=JCtKFrjOvCVCJbxtpy0KDerGz0qSjPSw1fu0wUmhGfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=saSHdwa9QbZTrX2mRavM1PtCuXW+dt+eNOPJVqUaE3Q0VIv0QxxXr7v7StjWw6sYU ily55EZPW7SAamVR5B9Ks+XLrESgNNpSD3RcPxbZRNRVItVz+RrzrHEbECTeaWjKVv WRzFjoS4CtsI6lGjpjzIUM8Y4okssPijf/9PHskNjz4ROMBAovhcnNlZ9lzqnPUtuI C8xQkp7NGIcqzaAEDjAqfqTqow5EFmL9dPW8CNHyAoCvVpwkDOrciJ4LIikh75iTyU 6H8dY+P2a51ea4A9moqEscfW9YyeIhUkBxO82IUpK2AJXijnvFweO23svPdgmeXa4l 2d2i9eoXzgTYQ== From: Sasha Levin To: stable@vger.kernel.org Cc: "Matthieu Baerts (NGI0)" , Mat Martineau , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6.y] mptcp: pm: kernel: correctly retransmit ADD_ADDR ID 0 Date: Mon, 18 May 2026 09:45:28 -0400 Message-ID: <20260518134529.1135588-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026051244-unrivaled-everglade-a9bc@gregkh> References: <2026051244-unrivaled-everglade-a9bc@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 b12014d2d36eaed4e4bec5f1ac7e91110eeb100d ] When adding the ADD_ADDR to the list, the address including the IP, port and ID are copied. On the other hand, when the endpoint corresponds to the one from the initial subflow, the ID is set to 0, as specified by the MPTCP protocol. The issue is that the ID was reset after having copied the ID in the ADD_ADDR entry. So the retransmission was done, but using a different ID than the initial one. Fixes: 8b8ed1b429f8 ("mptcp: pm: reuse ID 0 after delete and re-add") 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-1-fca8091060a4@kernel.org Signed-off-by: Jakub Kicinski [ applied to net/mptcp/pm_netlink.c instead of upstream's pm_kernel.c ] Signed-off-by: Sasha Levin --- net/mptcp/pm_netlink.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 28f8d7fb7bdf3..a12379619ab4f 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -591,6 +591,8 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) /* check first for announce */ if (msk->pm.add_addr_signaled < add_addr_signal_max) { + u8 endp_id; + /* due to racing events on both ends we can reach here while * previous add address is still running: if we invoke now * mptcp_pm_announce_addr(), that will fail and the @@ -604,19 +606,20 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) if (!select_signal_address(pernet, msk, &local)) goto subflow; + /* Special case for ID0: set the correct ID */ + endp_id = local.addr.id; + if (endp_id == msk->mpc_endpoint_id) + local.addr.id = 0; + /* If the alloc fails, we are on memory pressure, not worth * continuing, and trying to create subflows. */ if (!mptcp_pm_alloc_anno_list(msk, &local.addr)) return; - __clear_bit(local.addr.id, msk->pm.id_avail_bitmap); + __clear_bit(endp_id, msk->pm.id_avail_bitmap); msk->pm.add_addr_signaled++; - /* Special case for ID0: set the correct ID */ - if (local.addr.id == msk->mpc_endpoint_id) - local.addr.id = 0; - mptcp_pm_announce_addr(msk, &local.addr, false); mptcp_pm_nl_addr_send_ack(msk); -- 2.53.0