Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3028569ybt; Mon, 29 Jun 2020 13:18:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNfnwUVL8ivW5NIcQ2wQ2GIuNWt7Dg/q+JXIPnIchWaudHpmbcXTQLRR+EaM6PTDJz1oEc X-Received: by 2002:a17:906:434c:: with SMTP id z12mr10298122ejm.33.1593461931845; Mon, 29 Jun 2020 13:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593461931; cv=none; d=google.com; s=arc-20160816; b=AnJCGyVilxHt3NXw0jwHDmuB+7vgKcPFI8Yu/PkwleWaZdDfxZ+CfZX1TvO51VZKlo xqhcloBisIOJunyx0HXQCrRWqb9Ajl24buz9PICJYUAxiGUuIaFCGNmWvYp0W+dnkN6T axJFEqHIJ1PEPikJx6pboit/vtVIzv3uQHzUgOXUL2uBIFV3PhqcPA7K1ozYsZ+bKfU+ j/txgvPIRy3zm6hMMsdRV5tWuU8B8crVdlO+sZYto/ClMc34/4NjCx1mFI9zhRgGhKIG AX5WdX85mbwMTb4rz/v5OE3VVZi6PmscCMI0JepA731rHklpkhdYM0rwW+M9fHwHZOH/ vj1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=w8mC8fTRSGQFB30upWUsTLK7+6vHXwpy5g5QSbuLR2c=; b=rP7yM8SKHC9Rq2UEge28szgeV4Z4Pt3sWHBu9WD3vpStwtIvA+q8POToEAB+X3YfYh T2tiief+EM7Woqncq0MqYVJXwCB1KgJZpEEpAiXShk+c6hPoCEK4uMOtTWOgVn75e6T6 vGrC42TbQ7DejALUpQPxz2NC0aVufL40ON09AzOX6TNGLCQS1dXE+eWYNaJ09d9//yqd kAPOE8APz8ykQF2VLeC3AhFsBGgEj6Nd3LnXp1kNeGUqkl+lwmwaqIIutuXjjdBaPeKY iQDYX0linTbVORjbksfYwrXky1xYxwDpeIkn5kuMwVCHuGpeiDnylxy4YvYhlkc/OjF1 VMaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J6arOE5K; 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 kt13si365579ejb.297.2020.06.29.13.18.28; Mon, 29 Jun 2020 13:18:51 -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=default header.b=J6arOE5K; 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 S1732968AbgF2UQz (ORCPT + 99 others); Mon, 29 Jun 2020 16:16:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:40554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732197AbgF2TaQ (ORCPT ); Mon, 29 Jun 2020 15:30:16 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 96C5525221; Mon, 29 Jun 2020 15:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593444939; bh=ZjfaqJcqCoYR9S2k6hGkT0Xs4RvC6KD+LU81NfTLZvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J6arOE5KCaLv8VkpBgyyBSWCOSggRgyvkK4gOljLq23kS5HDYo4wjPXlK48MjIbTs RlB3HZduMfZVVVxHS9TA50Y3LODVHeKb9JfQ75Qn0twIao/Iw1tdo9ir18Uj1LjPJq hBzSKVfg8BKc55jzG0IE7kSEiMk93mDf21r80fG4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Neal Cardwell , Mirja Kuehlewind , Eric Dumazet , Soheil Hassas Yeganeh , "David S . Miller" , Greg Kroah-Hartman Subject: [PATCH 4.19 036/131] tcp_cubic: fix spurious HYSTART_DELAY exit upon drop in min RTT Date: Mon, 29 Jun 2020 11:33:27 -0400 Message-Id: <20200629153502.2494656-37-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629153502.2494656-1-sashal@kernel.org> References: <20200629153502.2494656-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.131-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.19.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.19.131-rc1 X-KernelTest-Deadline: 2020-07-01T15:34+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Neal Cardwell [ Upstream commit b344579ca8478598937215f7005d6c7b84d28aee ] Mirja Kuehlewind reported a bug in Linux TCP CUBIC Hystart, where Hystart HYSTART_DELAY mechanism can exit Slow Start spuriously on an ACK when the minimum rtt of a connection goes down. From inspection it is clear from the existing code that this could happen in an example like the following: o The first 8 RTT samples in a round trip are 150ms, resulting in a curr_rtt of 150ms and a delay_min of 150ms. o The 9th RTT sample is 100ms. The curr_rtt does not change after the first 8 samples, so curr_rtt remains 150ms. But delay_min can be lowered at any time, so delay_min falls to 100ms. The code executes the HYSTART_DELAY comparison between curr_rtt of 150ms and delay_min of 100ms, and the curr_rtt is declared far enough above delay_min to force a (spurious) exit of Slow start. The fix here is simple: allow every RTT sample in a round trip to lower the curr_rtt. Fixes: ae27e98a5152 ("[TCP] CUBIC v2.3") Reported-by: Mirja Kuehlewind Signed-off-by: Neal Cardwell Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp_cubic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index 78bfadfcf3426..8b5ba0a5cd386 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c @@ -403,6 +403,8 @@ static void hystart_update(struct sock *sk, u32 delay) if (hystart_detect & HYSTART_DELAY) { /* obtain the minimum delay of more than sampling packets */ + if (ca->curr_rtt > delay) + ca->curr_rtt = delay; if (ca->sample_cnt < HYSTART_MIN_SAMPLES) { if (ca->curr_rtt == 0 || ca->curr_rtt > delay) ca->curr_rtt = delay; -- 2.25.1