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 E66B57E0E9; Wed, 7 Aug 2024 15:05:59 +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=1723043160; cv=none; b=t3oxlCf8Xo5AIbGDMOakWEYIQj1CvlDo/NQx5Kxw9tlGDfMPrVWNIR2yBfQoNXD/vC9QWORiUaa/nv/7cSd+ct0Ez+OjebB0BXZ1zij99nJAiMw0fpvbX93OvILUvsqzxZo3W9wVtYr9x29vcAc2zGOulzy+5BWoFa4obD1pYhg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723043160; c=relaxed/simple; bh=G5dc9L3timznhr/ymZbkLuoP2OLk3sXFo+dPS4+RD9E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a2FCA99UuoR3roJi5E+Vq5QH15K7jyFKkbby5Yocf3lrde5Rh0ZidpMdmxhO8hjCAMB+wgXGNiTmtQwCrW6tcDB6QZqXhP3Sl8SLCv258cTVsuewrfCcFQdQeLmSIwXNQcGAHP6WKW/Z1+N9bdJZ+C4rdXMPkQt7oIDYKa3RHtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=POjU8+SO; 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="POjU8+SO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 343B8C32781; Wed, 7 Aug 2024 15:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723043159; bh=G5dc9L3timznhr/ymZbkLuoP2OLk3sXFo+dPS4+RD9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=POjU8+SOjkKs/FiOHz0qC3Mc1hqWdRQgsiK2aNCgo3RLNwbMyyfgN2VEyRIlOUx0K Nm6LpVp7WKpiVaryBwxwzLS42ahvVXkondMvNEc0xmCHJID2SNoZvN0pISzAi5SzIT +wbOKzn87Ljv2NrSNjpyPYr26h9nXoBAOCESQHBs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mat Martineau , "Matthieu Baerts (NGI0)" , Paolo Abeni Subject: [PATCH 6.10 113/123] mptcp: distinguish rcv vs sent backup flag in requests Date: Wed, 7 Aug 2024 17:00:32 +0200 Message-ID: <20240807150024.528875310@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240807150020.790615758@linuxfoundation.org> References: <20240807150020.790615758@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthieu Baerts (NGI0) commit efd340bf3d7779a3a8ec954d8ec0fb8a10f24982 upstream. When sending an MP_JOIN + SYN + ACK, it is possible to mark the subflow as 'backup' by setting the flag with the same name. Before this patch, the backup was set if the other peer set it in its MP_JOIN + SYN request. It is not correct: the backup flag should be set in the MPJ+SYN+ACK only if the host asks for it, and not mirroring what was done by the other peer. It is then required to have a dedicated bit for each direction, similar to what is done in the subflow context. Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- net/mptcp/options.c | 2 +- net/mptcp/protocol.h | 1 + net/mptcp/subflow.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -909,7 +909,7 @@ bool mptcp_synack_options(const struct r return true; } else if (subflow_req->mp_join) { opts->suboptions = OPTION_MPTCP_MPJ_SYNACK; - opts->backup = subflow_req->backup; + opts->backup = subflow_req->request_bkup; opts->join_id = subflow_req->local_id; opts->thmac = subflow_req->thmac; opts->nonce = subflow_req->local_nonce; --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -443,6 +443,7 @@ struct mptcp_subflow_request_sock { u16 mp_capable : 1, mp_join : 1, backup : 1, + request_bkup : 1, csum_reqd : 1, allow_join_id0 : 1; u8 local_id; --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -2005,6 +2005,7 @@ static void subflow_ulp_clone(const stru new_ctx->fully_established = 1; new_ctx->remote_key_valid = 1; new_ctx->backup = subflow_req->backup; + new_ctx->request_bkup = subflow_req->request_bkup; WRITE_ONCE(new_ctx->remote_id, subflow_req->remote_id); new_ctx->token = subflow_req->token; new_ctx->thmac = subflow_req->thmac;