Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4811538yba; Tue, 30 Apr 2019 04:55:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPuI82wFoHUcGf888w2+asZ12Z5IFijh6VDGJt8aTwNSwpXu3Do+GCM867w91TcAK4BaUx X-Received: by 2002:a17:902:e382:: with SMTP id ch2mr67470406plb.94.1556625312092; Tue, 30 Apr 2019 04:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556625312; cv=none; d=google.com; s=arc-20160816; b=O3in+G/qVOQ1FQJEy+vPwAbulUdL3zZtgyn+git7KqvHP1nQ7QhJCZb0Vtqm7jYUsb f4zlrXteb/F//2BI/K3qYZB4kjPYilmGusbSGohnoa96kq2G7O2BTsBRdZrCVbtT/CJb rYSnuXfp2LQJNRciU/H9YOUnR+8iFQUcrRtw+vBJz437EBh+/cHjM+1AygktaEfTWXXi 9IHO28BMBNY4QJklbttGmTBNXAqcRRy/DradI/mekYiy0DKKwv1JspJvFqg/hIT3T8wP 2+t644pBYb+jr+OzxmA2gzMS+huCQAijKQwBwefjEooIYyHpihhe/tK1r57W4VOdftO7 E8xg== 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=8+AmrFkHI2CPptzDzjfKnVJpv94qQCGgKtXNfPTygk0=; b=qcyfHmru2YyRQjF97tWJdGrFbjRB7mcty26LkfwcYG+6D4edb44zLq90ZHbatUe00S x2CTI5mJEIFukKBPCN6DnwCxqvLQKXYrNIE62OaH9a0xPO5AtXfIEUYVTPQpg7Ru1tfI OjhP0RMGnfeZFnlmqPnx3wlgr1eciX6Ucjxmh1YSq2fXlJC61tAfANVxRwaaLrB6H1xa C/v/7CW3IWjety7fSGVFiqrZiCVIZdot/K0UrBhjYUEp18EUe1RzO6crRU+tBFn9IU9K Y7YilG+MPIwnOj6em2j4jjLXfjpPxHFTKMmX/NFayyDsvlGYlsCTt2g78RqWxIy/Ms9L BSjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Dar5zj/m"; 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 30si29295077pgo.5.2019.04.30.04.54.56; Tue, 30 Apr 2019 04:55:12 -0700 (PDT) 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="Dar5zj/m"; 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 S1731290AbfD3Lu5 (ORCPT + 99 others); Tue, 30 Apr 2019 07:50:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:38244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730609AbfD3Luy (ORCPT ); Tue, 30 Apr 2019 07:50:54 -0400 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 1BE3620449; Tue, 30 Apr 2019 11:50:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556625053; bh=5YCjkaI2QIXlBzK3QcJgY4n7zbzF292tiykPg2mKO6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dar5zj/mSnogihdPiqPGxystD3ZFq6mJb1fEheMW6ZE9CtLavw+42Ct+v5E024Y86 KCC6gliupvPnJ0OEWod+gPXFTscRUbkisI08UgQ+oa8RCMQyGcoSxqTCfIoOD3c38Q JGhjhq/Ww58NQ0xPDRRSDorpmq/53ViTrs7Jhl/E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, ZhangXiaoxu , "David S. Miller" Subject: [PATCH 5.0 73/89] ipv4: set the tcp_min_rtt_wlen range from 0 to one day Date: Tue, 30 Apr 2019 13:39:04 +0200 Message-Id: <20190430113613.171700620@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@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: ZhangXiaoxu [ Upstream commit 19fad20d15a6494f47f85d869f00b11343ee5c78 ] There is a UBSAN report as below: UBSAN: Undefined behaviour in net/ipv4/tcp_input.c:2877:56 signed integer overflow: 2147483647 * 1000 cannot be represented in type 'int' CPU: 3 PID: 0 Comm: swapper/3 Not tainted 5.1.0-rc4-00058-g582549e #1 Call Trace: dump_stack+0x8c/0xba ubsan_epilogue+0x11/0x60 handle_overflow+0x12d/0x170 ? ttwu_do_wakeup+0x21/0x320 __ubsan_handle_mul_overflow+0x12/0x20 tcp_ack_update_rtt+0x76c/0x780 tcp_clean_rtx_queue+0x499/0x14d0 tcp_ack+0x69e/0x1240 ? __wake_up_sync_key+0x2c/0x50 ? update_group_capacity+0x50/0x680 tcp_rcv_established+0x4e2/0xe10 tcp_v4_do_rcv+0x22b/0x420 tcp_v4_rcv+0xfe8/0x1190 ip_protocol_deliver_rcu+0x36/0x180 ip_local_deliver+0x15b/0x1a0 ip_rcv+0xac/0xd0 __netif_receive_skb_one_core+0x7f/0xb0 __netif_receive_skb+0x33/0xc0 netif_receive_skb_internal+0x84/0x1c0 napi_gro_receive+0x2a0/0x300 receive_buf+0x3d4/0x2350 ? detach_buf_split+0x159/0x390 virtnet_poll+0x198/0x840 ? reweight_entity+0x243/0x4b0 net_rx_action+0x25c/0x770 __do_softirq+0x19b/0x66d irq_exit+0x1eb/0x230 do_IRQ+0x7a/0x150 common_interrupt+0xf/0xf It can be reproduced by: echo 2147483647 > /proc/sys/net/ipv4/tcp_min_rtt_wlen Fixes: f672258391b42 ("tcp: track min RTT using windowed min-filter") Signed-off-by: ZhangXiaoxu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- Documentation/networking/ip-sysctl.txt | 1 + net/ipv4/sysctl_net_ipv4.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt @@ -422,6 +422,7 @@ tcp_min_rtt_wlen - INTEGER minimum RTT when it is moved to a longer path (e.g., due to traffic engineering). A longer window makes the filter more resistant to RTT inflations such as transient congestion. The unit is seconds. + Possible values: 0 - 86400 (1 day) Default: 300 tcp_moderate_rcvbuf - BOOLEAN --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -49,6 +49,7 @@ static int ip_ping_group_range_min[] = { static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX }; static int comp_sack_nr_max = 255; static u32 u32_max_div_HZ = UINT_MAX / HZ; +static int one_day_secs = 24 * 3600; /* obsolete */ static int sysctl_tcp_low_latency __read_mostly; @@ -1151,7 +1152,9 @@ static struct ctl_table ipv4_net_table[] .data = &init_net.ipv4.sysctl_tcp_min_rtt_wlen, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dointvec_minmax, + .extra1 = &zero, + .extra2 = &one_day_secs }, { .procname = "tcp_autocorking",