Received: by 10.213.65.68 with SMTP id h4csp2121873imn; Sun, 8 Apr 2018 20:14:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx48eIS7x03LGiWv08qlEJMUIKuEpv+nr5BE4fLw9Ekz0w5kpOR2FCPEBhIk8yl4xSQlE2vVA X-Received: by 2002:a17:902:6009:: with SMTP id r9-v6mr5986917plj.70.1523243670531; Sun, 08 Apr 2018 20:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243670; cv=none; d=google.com; s=arc-20160816; b=AU5PVQ9+QNm0q3JeVIBis40DR2m81TK2gmsCBg+x80GapGTX6It03g047R2HuGpVwU XpjpBYV6nFYELNeJfiZE48Jjq+XdI7dqYGGJxs56YPG8m5AIDLY1VX7/cvT86G3pwYKC SQ8fwlOhXn+XajFv3exUHH9d3zvGhh6CrdldnltdIrwAuxaIEBhbUC8J6WvfgD5JTqZY ZB6809Cx1JxQGEADot8GbX9nb58hKDlVDvcg9+usf1tJL1YX/riDWyd0KctX/YIpsNJi g7xWXG3Vj35T/eX2iXj+HRRq8pDhlCcVZ7a0GpxZkaQJQ+/rMyNSHABIrvQVeHz5BsQG q+fA== 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=Mu6AAgV+064yHX06Aa3/YRUBpVYDTxVLagaZqulEd+E=; b=niey8amJqVGe1hCxejiUjS6yTiYmL8z6YWIw6P3XOzmaBhY4uZolrYyogd9j9cPAwd Jga4X8ux2OQMc6OS3krVnZmvtj+B0RUzk8gkFbvCa12VgRPswyL+0Z+Q7WACPsn1NFOO Q+uBIC5N/RhgZsAM2p8YF9UYQw+CDZsAhVVRl0mWULiOqM+y3CfN+a3tQauGHImAo9Hu TaAZmTj0HBcO5HzYKCefRtKsW51m7/NZ6HQLZjIMwbDCxUij4VoK6H9jkPkVHVjSwa4h ED3tI0FvrxlCsllGDBtNg08i7TLnpnS6yVh9/t+kAVGqR1F4DsScvno1XmUtCtPQlw8j etZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=iwlJMBWL; 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 2-v6si14141819pld.596.2018.04.08.20.13.54; Sun, 08 Apr 2018 20:14:30 -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=iwlJMBWL; 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 S1754223AbeDIDH4 (ORCPT + 99 others); Sun, 8 Apr 2018 23:07:56 -0400 Received: from mail-by2nam03on0117.outbound.protection.outlook.com ([104.47.42.117]:63840 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932084AbeDIAYh (ORCPT ); Sun, 8 Apr 2018 20:24:37 -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=Mu6AAgV+064yHX06Aa3/YRUBpVYDTxVLagaZqulEd+E=; b=iwlJMBWL7MX/CtFy9EkkaUmnR988En6XbXi2eF0vEHzCjUUtIu2g5g1Ri93KQV17TtTnfLHBBeGfuC9kgnTYo97lWSgBiZppo7cf86JwG998S6jV/kjiubYKEGJ19TQ54U4vUSmFBVZOTZ9eVFgqP7bf0DNhj//FKyk4W1rG1UQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0984.namprd21.prod.outlook.com (52.132.133.30) 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:24:33 +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:24:33 +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.14 092/161] tcp_nv: fix potential integer overflow in tcpnv_acked Thread-Topic: [PATCH AUTOSEL for 4.14 092/161] tcp_nv: fix potential integer overflow in tcpnv_acked Thread-Index: AQHTz5ikrQ/M50ayzUaqkui/pvzBnA== Date: Mon, 9 Apr 2018 00:21:03 +0000 Message-ID: <20180409001936.162706-92-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB0984;7:aeVOLyv8qz2GnznqcjlLEV8GNCkVwoKYnBXDKLXIqFDlMEhSA+gSbeGm7fgx2Yeo3UoWRm5Ffz87F51A8pM8uR0jKMmWW9GNY0MnCCEltXJUXLL9OL8z1TO4XEebrHbHI/JSfhd0J9EhoQzOAt5cG9W79cWLIDopXDqfvoCJ9CPTFYifsA+d+BYMEV7HJwnyogagmFIxFElaWffIGXBp+4eIffdqhzN05H0jF1reXLTRE77M6GK2dgjhKPCcylIY;20:P4t45n7y7gwBeRBF8gtK3s0iN/RwzWzYok2cMPATpNaA9XBrpSYOxPsxLn7brmjwONiDGQRooOR2ZbL6v/b6UfEigtZxAsKGDuxDNz37VbODXP1/6WNzUTe/iOb0IFSjMqgb0wvF+gowilYZq2FTKIpaYGjXh/1Ajqllv70dBQw= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 522cadaa-3468-4a85-0b62-08d59db044de x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0984; x-ms-traffictypediagnostic: DM5PR2101MB0984: 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)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0984;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0984; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(346002)(376002)(366004)(39860400002)(396003)(189003)(199004)(5250100002)(2501003)(110136005)(54906003)(6116002)(6436002)(11346002)(1076002)(486006)(25786009)(105586002)(2900100001)(102836004)(86612001)(3846002)(68736007)(107886003)(316002)(10290500003)(5660300001)(86362001)(2616005)(305945005)(4326008)(446003)(6486002)(22452003)(7736002)(476003)(8676002)(81156014)(81166006)(8936002)(6512007)(10090500001)(186003)(3280700002)(106356001)(76176011)(2906002)(99286004)(26005)(97736004)(59450400001)(14454004)(6666003)(478600001)(53936002)(6506007)(36756003)(72206003)(66066001)(3660700001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0984;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 48MQeHAySWmuEDE8ZEDU20JQ+IjRmEvlsg3td+nj0fmTnuaVytLTOJ9CUoi1+6KcxEX6oE+5cqWeqVlA6IbudNbL4bp9tghUNDomr5heAEKUxtCum/IrzqkV5ZPxoEtYae3uOKm3o4zq08xb/OgTOg8Q99B5IX+PXIEYxdVVpKpV8ETc/EDidJxzlbAD8IGbJnjjWtGjBfQfBDjZ3ejfdQvzbkdIxxhtz+GImfr5KuXv0nvSQQ420P5jd0CSSn74jnDiaQorEfLcCBosv1DoYlUGAZ4HKWm3xWs16tZqqBuy9Z39NCloIVbrpMVMOGJcn1YXvtVORyuN5JupLIHjXyhXMv6Qp806y2SicNmX9s77KAtEvsGAmfesAkDRpzqQSYJ7KmYoT/7jSIfCqJf0WdwUvBDt5xvNtdz1fIsDFRQ= 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: 522cadaa-3468-4a85-0b62-08d59db044de X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:21:03.5189 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0984 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 125fc1450b01..09f8773fd769 100644 --- a/net/ipv4/tcp_nv.c +++ b/net/ipv4/tcp_nv.c @@ -327,7 +327,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