Received: by 10.213.65.68 with SMTP id h4csp2147190imn; Sun, 8 Apr 2018 20:56:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx48YqGZg1ikaWTWYj6w7urT2bYo4u6C1ec4dMOl7skWUJsVjMDg+uzOTuB5GPS6Ab5Mvc6tp X-Received: by 2002:a17:902:5501:: with SMTP id f1-v6mr36508492pli.50.1523246195726; Sun, 08 Apr 2018 20:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523246195; cv=none; d=google.com; s=arc-20160816; b=sqEj7UpBF7gcPnB7DguvSLhoxGt7D8auj3h6YUtZeSsOm2FpmLQ4TQ6Rj6mc0CyTol eByCDh+LVaXQP7vuZ4c+R+QmIkz5Y7DfsqzXDMBPrKlOOC/oJgCPI2U95UclvI7yHoM5 ynOz9TseivvXz1zwSUXSmft8hZQQhXT0jBmCmCv+S3Kur9GOZ0ISt2T0v0hue1I+i8Eo ireZX+WZHj98pZuQBOBiM5Z7JdiITCqWwLTKcqxOAMJ2giuq3ArgXUkJONqAGYv0W19b 2XGVRcfhTPm4QplN7DoPQehNgs6BzGTb1wZRnhWmMoKl1gtJUPYDupG65A3wFOxLQ0i8 mA2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=1lJ3fgWiEaMAMMytfEkRnvvYOIc+Ee2D6Xdwm1XaONs=; b=dG5AXRtwMSAszdzparKr1g+6LqI6l8RiT66zpKTorqy7kUV4NhT646Umc62JoPrqrf pxuAOaLc1fnyskM+mzvVmG4v0+15r2INJmX9vdbZhZe0LSgvPEm/MmTzFw5TgPgE1vLG Bc3t6U/VUjLh044I3VKx3C3QctefxAPTgZdm8xcG06mqsibDzgiqYhUobLghkv3w70/5 UaFsEovYKWVHl1YlP+/R5m1UZAELyui/2SCFHhHsbThjS7Pd8QIoqpWeoOmvK8P/S8VG WwGiLjJUqRyrUBoP51YW/Ngt+dCQPY+iG3AEKJwW3hih5EUzxpofSKLf0T0xnrX3TbsR HwtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=nAZ8Ryct; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2-v6si13531634plh.44.2018.04.08.20.55.59; Sun, 08 Apr 2018 20:56:35 -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=@microsoft.com header.s=selector1 header.b=nAZ8Ryct; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754787AbeDIDul (ORCPT + 99 others); Sun, 8 Apr 2018 23:50:41 -0400 Received: from mail-sn1nam02on0102.outbound.protection.outlook.com ([104.47.36.102]:30848 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754056AbeDIAT3 (ORCPT ); Sun, 8 Apr 2018 20:19:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1lJ3fgWiEaMAMMytfEkRnvvYOIc+Ee2D6Xdwm1XaONs=; b=nAZ8RyctfU++VJd/lzloGs7vmSz/yx74WIdBbDsSR9toFGXS1iY3pO8Dwz6zT5mnhBN0YCaLrS8ZnpPQ0xY7qxp15MlOG3YeJh0Y9hIab8SUkPdnsqyaDD6QjimT+evC5eAkBvFn8nSrL2PKbhjnVQ4W1w+kCUJjJecqCrq7DPY= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0726.namprd21.prod.outlook.com (10.167.108.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:19:26 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:19:26 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "Gustavo A. R. Silva" , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 112/189] tcp_nv: fix potential integer overflow in tcpnv_acked Thread-Topic: [PATCH AUTOSEL for 4.15 112/189] tcp_nv: fix potential integer overflow in tcpnv_acked Thread-Index: AQHTz5hAGNlBI1tgiE2ugMFgxKAUAQ== Date: Mon, 9 Apr 2018 00:18:14 +0000 Message-ID: <20180409001637.162453-112-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0726;7:tCo66M/PKX/oJzYlqG1M03lqSSL0HD73ZTKC18yLho/4AhSDqTLumC7GQQrvCPEg7xL7AVKWvPwC99jnXH16BjDg6SMHr6SM9viUUEPK8HZsnsufsmqofYxrhbW9hwwk9uqV6MHKqCgU4gFsUC7MNzFJdvga5r8xkJhZCD484Lz14wa64VbgkwHVE/cf6Gn2vtN4hn8I0lJFQ0y5mA4kjESKxEgVWWdpfHXSgRkTAqtr7na8hA6uinpTUtigU5WX;20:HueNMBhdAbWlzWx/qqgU/yjoUszJSgxggVnROMFOLiRPZe+xK930fkZKLwy14TSrhQ0MvhAnA/WgXznBrf/mMydzNgy9vCPo18gOS2RlNuxZ6VrFGU2TCAV2raRF9q22RRLuicYBOGkY+M6yVUBDqox1f5tZlA2wnaVZxmAHWEA= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 9e6d87c1-0527-42b5-8abb-08d59daf8d7f x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0726; x-ms-traffictypediagnostic: DM5PR2101MB0726: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB0726;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0726; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(39380400002)(39860400002)(396003)(376002)(199004)(189003)(6486002)(26005)(6512007)(4326008)(81166006)(6666003)(6436002)(81156014)(8676002)(97736004)(186003)(36756003)(72206003)(53936002)(107886003)(2906002)(86362001)(76176011)(110136005)(305945005)(10090500001)(486006)(3660700001)(102836004)(5660300001)(14454004)(476003)(86612001)(446003)(99286004)(68736007)(66066001)(11346002)(54906003)(2616005)(1076002)(7736002)(5250100002)(25786009)(8936002)(478600001)(2900100001)(2501003)(3280700002)(105586002)(59450400001)(316002)(106356001)(22452003)(6506007)(3846002)(10290500003)(6116002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0726;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: +EcaegKWa0oPGLGHQjE5asrgbzdGrPOnSi6m8seD0K1GQ8jMZWGdDE4MpQH3b7OO/1L59G/inCYYvtVq7dQGGoNrPBy9FADhRsekhtuZyuH7VSs4sP2V6N1gVdlmSdD9fZnZnK8FKxlE5yiw1dS7OUEOUUJpDxLYMZx70pw/6+Qm3Qt3xWto+c3ujeWymYuGpOVAM3a2b7JBFq0h5bdw8neiPbcwlSjqI46q6qaxwyKT1OfdShJJQojCUk8R6zdjpVc0WsE1CqzgOfgUTHl0/IrVkma9r8jATdKVuQ5DLnL0BeLzHcFvQF6VqRpl/MBdJ8cXX33w8sG3cM06w+GFS0GF3fA3MIGBtSXyJxUt2Tc1mZ/9cPlUKH56aNvx0ywuLYPG2GGHYwXLl7xVJ/WpAYkcTWjK+V6Zx01Mo0z3D9Y= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e6d87c1-0527-42b5-8abb-08d59daf8d7f X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:18:14.5841 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0726 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Gustavo A. R. Silva" [ Upstream commit e4823fbd229bfbba368b40cdadb8f4eeb20604cc ] Add suffix ULL to constant 80000 in order to avoid a potential integer overflow and give the compiler complete information about the proper arithmetic to use. Notice that this constant is used in a context that expects an expression of type u64. The current cast to u64 effectively applies to the whole expression as an argument of type u64 to be passed to div64_u64, but it does not prevent it from being evaluated using 32-bit arithmetic instead of 64-bit arithmetic. Also, once the expression is properly evaluated using 64-bit arithmentic, there is no need for the parentheses and the external cast to u64. Addresses-Coverity-ID: 1357588 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/tcp_nv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_nv.c b/net/ipv4/tcp_nv.c index 0b5a05bd82e3..d18f4672beae 100644 --- a/net/ipv4/tcp_nv.c +++ b/net/ipv4/tcp_nv.c @@ -364,7 +364,7 @@ static void tcpnv_acked(struct sock *sk, const struct a= ck_sample *sample) */ cwnd_by_slope =3D (u32) div64_u64(((u64)ca->nv_rtt_max_rate) * ca->nv_min_rtt, - (u64)(80000 * tp->mss_cache)); + 80000ULL * tp->mss_cache); max_win =3D cwnd_by_slope + nv_pad; =20 /* If cwnd > max_win, decrease cwnd --=20 2.15.1