Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3731259ybv; Mon, 10 Feb 2020 05:28:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyHuvTM+JDInKXlesixkBm/u8rBLewxFFaoh1BJfUhLd/WHcEFuA/CxJPFF3IZuZ5MysxFu X-Received: by 2002:aca:f242:: with SMTP id q63mr838295oih.72.1581341316765; Mon, 10 Feb 2020 05:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581341316; cv=none; d=google.com; s=arc-20160816; b=Zq4BQDVoS6kT75GWiPGefzYsxoJpZRQvgnSVR8W2ljZLERFR0N2mSxXHPobEoJQPz8 goRCctd1QxB7D7bKzqMIaqxrtV4q1xBTwyaeqmMJztDsZkz/3FGmCTW/mjipKGuEV2Ms 5w9lm85zqWypNcCg/lCmxmA2CzxMFK8PBqe/y2ePzFeLR74zU95HHHP3Ai2YuBj/197y gV/3FI402pMKhlq/4KamOWH+YKSjtNqZpYLGX1O4tKpAPRY4hfC4L7zF8KtSZoH55ay5 6HcnH4g3NNn0TH+R6ztL9tN4bctHgyFakA5UzLxg2zmbV3UIH8OBQzYl2PHedyl6YSKq /t3A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=L1FIml3UMf+LgyXGHUbeooQvrVqwp3XYaCYfvYbo62M=; b=OPBi8nkwNVN+pUOxWvOTxz+EIeVKQWaLofkBpGhKxYZrdwLCRWXNVenIcGIzHgB8xo c2wjmtLTJ8met14PqeHglkmfOwjoqdcyHz5/CK5k9srYKfvOkWWLLzXe2LQnn0CZ3dWa IsAbYg4XdTDi795DpAUOBusUkPSF1KUCNkf8bJ9eGWt3SvGUrKXPYVWa0ZCR6RhGb1EJ 3E0sKE6LfxttiRXXpGaXncwQaUK7qIIZs0TDs4gpg3b4pDQ1DQH1kn5eW94F6W6t+few zkQEJt1Rw9GCDSIGjyXL8bF4jJAWFMjCviZb6M84CfBbdmurPjAZT3XhkQejzWxHOXbS ppQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GNIqD0Qs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si197197ots.284.2020.02.10.05.28.23; Mon, 10 Feb 2020 05:28:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GNIqD0Qs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731087AbgBJN0z (ORCPT + 99 others); Mon, 10 Feb 2020 08:26:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:56634 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728473AbgBJMgl (ORCPT ); Mon, 10 Feb 2020 07:36:41 -0500 Received: from localhost (unknown [209.37.97.194]) (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 05AE820733; Mon, 10 Feb 2020 12:36:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338201; bh=LTkYHbx/ejkEJkCfHHhialRWrg/S/rzsmTOtS+vvSUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GNIqD0Qs8vwAj34X4S0EUUuQvmqF+ZvSczjRls5OY5vQSqCSf2jHszoxo692RL4dx pGBOdLAJhwSUGYvS58fDeef4EZjVda3DLcwYDhbnfwJ2QXrD7ASW5wZmwFAdMS0a0F Ah+zjsiF/q1cmlLgazETQI7UBuNL/Yiw64EhYSn4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Marcelo Ricardo Leitner , Yuchung Cheng , Neal Cardwell , Jakub Kicinski Subject: [PATCH 5.4 017/309] tcp: clear tp->segs_{in|out} in tcp_disconnect() Date: Mon, 10 Feb 2020 04:29:33 -0800 Message-Id: <20200210122407.647977825@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122406.106356946@linuxfoundation.org> References: <20200210122406.106356946@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet [ Upstream commit 784f8344de750a41344f4bbbebb8507a730fc99c ] tp->segs_in and tp->segs_out need to be cleared in tcp_disconnect(). tcp_disconnect() is rarely used, but it is worth fixing it. Fixes: 2efd055c53c0 ("tcp: add tcpi_segs_in and tcpi_segs_out to tcp_info") Signed-off-by: Eric Dumazet Cc: Marcelo Ricardo Leitner Cc: Yuchung Cheng Cc: Neal Cardwell Acked-by: Neal Cardwell Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2635,6 +2635,8 @@ int tcp_disconnect(struct sock *sk, int sk->sk_rx_dst = NULL; tcp_saved_syn_free(tp); tp->compressed_ack = 0; + tp->segs_in = 0; + tp->segs_out = 0; tp->bytes_sent = 0; tp->bytes_acked = 0; tp->bytes_received = 0;