mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'Gustavo A. R. Silva'" <garsilva@embeddedor.com>,
	Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	"Wong Hoi Sing, Edison" <hswong3i@gmail.com>,
	"Hung Hing Lun, Mike" <hlhung3i@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] tcp_lp: use 64-bit arithmetic instead of 32-bit
Date: Thu, 1 Feb 2018 10:14:29 +0000	[thread overview]
Message-ID: <ef625a4f15144822a037ddabc33a4134@AcuMS.aculab.com> (raw)
In-Reply-To: <20180131190749.Horde.bsc7GhewsZwdnkmDtMlSwWO@gator4166.hostgator.com>

> > 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.

Even if the variable are 64bit you still need to worry (maybe less)
about arithmetic overflow.
The only real way to avoid overflow is to understand the domain
of the values being used.

	David

  parent reply	other threads:[~2018-02-01 10:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  0:24 Gustavo A. R. Silva
2018-02-01  0:32 ` Alan Cox
2018-02-01  1:07   ` Gustavo A. R. Silva
2018-02-01  1:51     ` Andrew Lunn
2018-02-02  2:32       ` Gustavo A. R. Silva
2018-02-01 10:14     ` David Laight [this message]
2018-02-02  2:33       ` Gustavo A. R. Silva
2018-02-01 14:45 ` David Miller
2018-02-02  2:38   ` Gustavo A. R. Silva
2018-02-02  9:32 ` kbuild test robot
2018-02-02 10:44 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef625a4f15144822a037ddabc33a4134@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=garsilva@embeddedor.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gustavo@embeddedor.com \
    --cc=hlhung3i@gmail.com \
    --cc=hswong3i@gmail.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome