Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3713977ybv; Mon, 10 Feb 2020 05:11:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxgArucmXUGp47B0AM0zuUjorylyMMHiYIFjFgY/tAOx0jQ73+4BTCBpvG22Oa5HD1Ekvr8 X-Received: by 2002:a9d:664a:: with SMTP id q10mr946346otm.298.1581340266624; Mon, 10 Feb 2020 05:11:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581340266; cv=none; d=google.com; s=arc-20160816; b=iiB+v4BqaxfUd5WwW64U0ceahmWI+LIWwhuzsN8BoRj9tNjrEGvBPKABOakQI3A2mB ZrjUW4W57xbcUyAQlnHH7BCvXnSqbFS9JXcFv7OSh7twA9tZXOwT9ZJO+J641lTWKXk1 vycvnoFDavucO3ELeOALQjNH9K5cOQO77/Ls+whMw300FbAP6o3t3cXtowDszv9NSMmE fDfBiBjGhZP6exFsx3Hzc6Zz1Im+5lgD28t4tiQE23TqVy3X9lFXRqgIB+RqrooJZUpo l1S4X+vlKIxtbp2hxZ+pzFKUEeuaaNNTY24xe/UuZitH0AK0hbVql3Scbr4BF8euwE2v jXwA== 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=624tvt220Zi6xihG8kUUgmqiDyHwnTfViSJbmvrfRR8=; b=mKa6FmDpc45HdT+5E3YW5TP+tqPisyxOHHOG/fu1HF30YueS47CZ3rBbDOH8bCtvxQ zAAm4Mx9YvFyqnY4l7lE9zRUyA3gpykgWLtpm1TZ8c/LRuIcEILFllo9BFSTDJpt/+o/ hExGxclrzWUOxcOonlrAnAII+ISugk/gBoejJ7MJK/Z/wAbXkoNfTNQbM+9zy3jZJOFq 1k38lgkLvCs3kOXGAPu+BLT7xvdrG7Q3Pue3vaehkosufaVrjLQVJR0lDrxS6+ZPf6TR Sfr4wTbmoodzkND3HXYz+bZ/z4MzD/Brze7E4Qny13Ml6My3z/AaSLEBEzY9Hzc2pfSD 9NMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SFDVNAnc; 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.10.54; Mon, 10 Feb 2020 05:11:06 -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=SFDVNAnc; 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 S1730687AbgBJNJp (ORCPT + 99 others); Mon, 10 Feb 2020 08:09:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:36710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729382AbgBJMjR (ORCPT ); Mon, 10 Feb 2020 07:39:17 -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 B728120842; Mon, 10 Feb 2020 12:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338356; bh=Gvpt5PObihmq+yOXAZrgvlGx38xG4WBKr073JZjWVdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SFDVNAnc69tojvRDjow7+aQKFM6hUv8SHpW/RqmNWqyn+OUCNlTVMLCszRSTomvbq 5ET6F5JaprjzAscDHDkHBxZsgz0HOAi64jdHqNjmnvqeLOkhbV+oze2Xe075WMHeoO TlM5/LubUhQ7DU+D2J1bqN/gYNcDIQFug66RtWj8= 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.5 014/367] tcp: clear tp->segs_{in|out} in tcp_disconnect() Date: Mon, 10 Feb 2020 04:28:47 -0800 Message-Id: <20200210122425.174971418@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@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 @@ -2638,6 +2638,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;