From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6A97C43603 for ; Thu, 19 Dec 2019 19:06:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B0E0222C2 for ; Thu, 19 Dec 2019 19:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576782416; bh=DVLRCuw/kCiZMLvrAGMJZSgzkirhhQfxlDgNJghG6zg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=al9TWKH8Q+Z46BrGX7iyiVOtsPXSsEnOb7kRcC5fGwxD5/rR1A2QynW1vuBq2tFFY b3hGGdrIpONRi5KiSHLRA6qKMCHLLmh18rbIdFNQcLWdhtb66nNULD1kLLPxnwB5de z9jEReMTpU6TheeSRXeEUpithN7ZPbQkkV399TYs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728291AbfLSTGv (ORCPT ); Thu, 19 Dec 2019 14:06:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:35590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728078AbfLSSnt (ORCPT ); Thu, 19 Dec 2019 13:43:49 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A830524672; Thu, 19 Dec 2019 18:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781029; bh=DVLRCuw/kCiZMLvrAGMJZSgzkirhhQfxlDgNJghG6zg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=acnYl95+rRRbVDkDb7eT+FSTv7LWoOJwinkftjojeqi0ID4ssJaZmwOo/+9x7vWRU nfiJpxbYJsuzsDBimMWr2eQMV+HPRbJXpMUaI4XG7kQvnbHhwOhnP4tIlRfb7aLFHl GlhuVinH1dC6UkcixsQZ/D9/QvjDo6yWIi/AgTYw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yuchung Cheng , Eric Dumazet , Neal Cardwell , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 054/199] tcp: fix off-by-one bug on aborting window-probing socket Date: Thu, 19 Dec 2019 19:32:16 +0100 Message-Id: <20191219183217.949954774@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yuchung Cheng [ Upstream commit 3976535af0cb9fe34a55f2ffb8d7e6b39a2f8188 ] Previously there is an off-by-one bug on determining when to abort a stalled window-probing socket. This patch fixes that so it is consistent with tcp_write_timeout(). Signed-off-by: Yuchung Cheng Signed-off-by: Eric Dumazet Signed-off-by: Neal Cardwell Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/tcp_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index d9e364c4863af..ad0083f7b5dd3 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -372,7 +372,7 @@ static void tcp_probe_timer(struct sock *sk) return; } - if (icsk->icsk_probes_out > max_probes) { + if (icsk->icsk_probes_out >= max_probes) { abort: tcp_write_err(sk); } else { /* Only send another probe if we didn't close things up. */ -- 2.20.1