Received: by 10.223.176.5 with SMTP id f5csp2104716wra; Wed, 31 Jan 2018 17:08:38 -0800 (PST) X-Google-Smtp-Source: AH8x226tJlZsvLm0NSalxKyzEeNEwwUxTv/Ixv+hznR2quFZqo3X5Zgn+kMsmslPkOogZ9HX5yBR X-Received: by 10.101.76.193 with SMTP id n1mr26389465pgt.194.1517447318742; Wed, 31 Jan 2018 17:08:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517447318; cv=none; d=google.com; s=arc-20160816; b=Pp12eq7CczOe8P36w3KLIC9E99Bn3drt5/zmqGpMcTOMye2SPGGu+yne43Pre934+v S4N53B70aVGdCA929H9YnBa9x3ln6hNBDJyznjA7Ur9hmoV1/hRcfb6EvwhI435T62li H1QHEkeH6wCQhYlSkVygyQY+M1r7oOUrsfhvNm46nRG0rcpTVUsj6VI9pbcPKE3zVcX1 1Ll7VKZrxFiT3L3vzmG/g7jRCP23okoScfq8URrujxcY4r9PedQnKWi8ntcCnN5/PYp2 eiDkr9U2GM8ed6+kExuM6ZHiViB/njfRoWUKZU49aTZmqUiAXOQTs5S6YLggsZiritlA 2ExA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :user-agent:in-reply-to:references:subject:cc:to:from:message-id :date:arc-authentication-results; bh=vVcg4U9bwevJu86sCKi+fEYgpB8/CgZ7CSrxCVYzJPo=; b=HXor/gu7X7MuZFGjccyM3UflfMZnXoElqqwXI2Wvt5RenR1QusL7l4sn3+1Yq6FY5h HlvQ6UWr7jspjhDtDUTrHvMb6+LL8M8h7euJyZ7ZBA9bq26dyR6vap8BUfW7vbpoyHpG 9ankaDmLqFiRDPYhL96WwAmvMGyufP269k3f1YnQgCNlikckIYUyYlOlQdSoNH1HBFng bf6fHyOTra7gx8XYXhFUr56n7uX3TZflWHXzCsCJHNj4/DEqz2B2oKe0T3+lqZaogkrA lr/DgcmxrhjZClEOqqvVRCmEPv+xmvQ69x50lPZX1urdvjfIQ+wjqETy7tKl4U6Nlt81 YH1w== ARC-Authentication-Results: i=1; mx.google.com; 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 t191si11731pgd.435.2018.01.31.17.08.23; Wed, 31 Jan 2018 17:08:38 -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; 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 S932188AbeBABH5 (ORCPT + 99 others); Wed, 31 Jan 2018 20:07:57 -0500 Received: from gateway31.websitewelcome.com ([192.185.144.95]:38157 "EHLO gateway31.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755927AbeBABHx (ORCPT ); Wed, 31 Jan 2018 20:07:53 -0500 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 7F5261B39F for ; Wed, 31 Jan 2018 19:07:52 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id h3M0efDh9cGlph3M0eh6ow; Wed, 31 Jan 2018 19:07:52 -0600 Received: from gator4166.hostgator.com ([108.167.133.22]:41994) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1eh3Lx-001cqO-7p; Wed, 31 Jan 2018 19:07:49 -0600 Received: from 189.152.201.65 ([189.152.201.65]) by gator4166.hostgator.com (Horde Framework) with HTTPS; Wed, 31 Jan 2018 19:07:49 -0600 Date: Wed, 31 Jan 2018 19:07:49 -0600 Message-ID: <20180131190749.Horde.bsc7GhewsZwdnkmDtMlSwWO@gator4166.hostgator.com> From: "Gustavo A. R. Silva" To: Alan Cox Cc: "Gustavo A. R. Silva" , "Wong Hoi Sing, Edison" , "Hung Hing Lun, Mike" , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tcp_lp: use 64-bit arithmetic instead of 32-bit References: <20180201002407.GA1608@embeddedgus> <20180201003236.06143fd0@alans-desktop> In-Reply-To: <20180201003236.06143fd0@alans-desktop> User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 108.167.133.22 X-Source-L: Yes X-Exim-ID: 1eh3Lx-001cqO-7p X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: gator4166.hostgator.com [108.167.133.22]:41994 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 1 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alan, Quoting Alan Cox : > On Wed, 31 Jan 2018 18:24:07 -0600 > "Gustavo A. R. Silva" wrote: > >> Cast to s64 some variables and a macro in order to give the >> compiler complete information about the proper arithmetic to >> use. Notice that these elements are used in contexts that >> expect expressions of type s64 (64 bits, signed). >> >> Currently such expression are being evaluated using 32-bit >> arithmetic. > > The question you need to ask is 'can it overflow 32bit maths', otherwise > you are potentially making the system do extra work for no reason. > Yeah, I get your point and it seems that in this particular case there is no risk of a 32bit overflow, but in general and IMHO as the code evolves, the use of incorrect arithmetic may have security implications in the future, so I advocate for code correctness in this case. Thanks -- Gustavo