Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2894385pxb; Tue, 24 Aug 2021 10:03:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+ZQFwZlNbq37hp5L8y0Qtm8RQw2pYzpTllZ/vv/tfz5JkbnjsRPXfEr6Fo/Oq77q77+qy X-Received: by 2002:a05:6e02:1250:: with SMTP id j16mr27873305ilq.215.1629824589152; Tue, 24 Aug 2021 10:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824589; cv=none; d=google.com; s=arc-20160816; b=QGV3ey5A/C0HZJALLT69kEsC2a+yCm/aor27qUPUqCSRthQdvdCw9yKUifLO1n7U13 9Gmfqw8FoO6B7kFXl0ZyyGN6aOcif5HWdfnCme0yz21gozDfKhHzJn2X0MzBMRJUdF2u sB7gUy+NfNxoe6ixD3tf7vfyEACGnVUEstqDa52a05qw2n4gGUYFdXBF3Z6PnUByJfd1 oK7fjVTvFZiJWY4UAByZBausOqSiWSVfuONQ/HsYHf54oGtY1IJshfdg+T5So+tNGpya ZzSAMieucShfyUkDDaMvgaNBgAAB5BY2sAWqEx5K+kBKiX5rgc167ZmSGW3AuxNJr9pg gl4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ssi5mdk/CXINEjyvT1LTDTKchTylVaQl4Tc/7cvoHGE=; b=dx4XJXSRu9tjgDOlrjDKzsSbFto0jwc4t7fRX2TfgiwOCfRCmaIIfvZ1T05OY7LLfe ltxWRsbKcDedh1Fm+xIGrLDd4swhOSvJY6vdvgbTxeQdp8S9I9M+dn+GMDMyoMBkaYn2 NmFkyLLuZz0RVul0/wG+1tCXrCa6vk1q7R9Tmp8F/t2rJ5incdFzEVN5rhKCak+VXSW5 wqPGZR8tD045b8IA+s4ouPNKFZu/q+8fg9J0tlA4aylE1DJlPKg2HkfH8fGmLTINcYx6 jsaN7zZinBObJlfOVVu9Zcq3IrfFaYE6uj4ZczRkpIOcINxPbaUzGZ099B6RHzEIiPM7 0JKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pQ6h6MIx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si8598539ila.10.2021.08.24.10.02.50; Tue, 24 Aug 2021 10:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pQ6h6MIx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233401AbhHXRBo (ORCPT + 99 others); Tue, 24 Aug 2021 13:01:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:39584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238709AbhHXQ6v (ORCPT ); Tue, 24 Aug 2021 12:58:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 12AEE61503; Tue, 24 Aug 2021 16:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824244; bh=iLV9+TYkAZlo6dIemTw4D2PVHafrNUoadYokXndKSwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pQ6h6MIxiYysAETI6lP+rU95sYoFR2Ru7rko3lYWr6jY+cq7cP+Jr6BajYEapBA+/ slJQ4MBpooZsQOzmYmhAO+eiibYrGnL+d+/6fPPjhbqqFVyIVzK72JR6HYSmAPR807 b9o7LfQxmwmP0yVweBkBH1VqN76y4d6qE+vyfGJv5pu/t7anejUThyArXKTayT7fMg ZZuluYkiLle9zJXco2GbaLf+LzcoPZ9DBWpSrlvLreP9G6zcclYN1yXsxEHHvaLScs iMBJyIjdr8a86kHvkb6LH2iX6fvOW8nHrFCEkba/JLop7TPqe5/YY+l4iWAS89Tmjn QdDup3PYG443w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Matthieu Baerts , Mat Martineau , "David S . Miller" , Sasha Levin Subject: [PATCH 5.13 077/127] mptcp: full fully established support after ADD_ADDR Date: Tue, 24 Aug 2021 12:55:17 -0400 Message-Id: <20210824165607.709387-78-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165607.709387-1-sashal@kernel.org> References: <20210824165607.709387-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.13.13-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.13.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.13.13-rc1 X-KernelTest-Deadline: 2021-08-26T16:55+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthieu Baerts [ Upstream commit 67b12f792d5eaeb8b4fca3b2053e6b819eb3bf0f ] If directly after an MP_CAPABLE 3WHS, the client receives an ADD_ADDR with HMAC from the server, it is enough to switch to a "fully established" mode because it has received more MPTCP options. It was then OK to enable the "fully_established" flag on the MPTCP socket. Still, best to check if the ADD_ADDR looks valid by looking if it contains an HMAC (no 'echo' bit). If an ADD_ADDR echo is received while we are not in "fully established" mode, it is strange and then we should not switch to this mode now. But that is not enough. On one hand, the path-manager has be notified the state has changed. On the other hand, the "fully_established" flag on the subflow socket should be turned on as well not to re-send the MP_CAPABLE 3rd ACK content with the next ACK. Fixes: 84dfe3677a6f ("mptcp: send out dedicated ADD_ADDR packet") Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/mptcp/options.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 4f08e04e1ab7..f3ec85779733 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -843,20 +843,16 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk, return subflow->mp_capable; } - if (mp_opt->dss && mp_opt->use_ack) { + if ((mp_opt->dss && mp_opt->use_ack) || + (mp_opt->add_addr && !mp_opt->echo)) { /* subflows are fully established as soon as we get any - * additional ack. + * additional ack, including ADD_ADDR. */ subflow->fully_established = 1; WRITE_ONCE(msk->fully_established, true); goto fully_established; } - if (mp_opt->add_addr) { - WRITE_ONCE(msk->fully_established, true); - return true; - } - /* If the first established packet does not contain MP_CAPABLE + data * then fallback to TCP. Fallback scenarios requires a reset for * MP_JOIN subflows. -- 2.30.2