Re: adjfreq(2): limit adjustment to prevent overflow during tc_windup()

2020-07-06 Thread Nicholas Marriott
10^12 was the old definition of billion in the UK also, although in the last few decades it has become rare and 10^9 is now the norm. https://en.wikipedia.org/wiki/Long_and_short_scales has quite a bit about it. On Tue, 7 Jul 2020 at 00:27, Scott Cheloha wrote: > On Mon, Jul 06, 2020 at

Re: adjfreq(2): limit adjustment to prevent overflow during tc_windup()

2020-07-06 Thread Scott Cheloha
On Mon, Jul 06, 2020 at 11:57:32PM +0200, Mark Kettenis wrote: > > Date: Mon, 6 Jul 2020 16:40:35 -0500 > > From: Scott Cheloha > > > > On Fri, Jul 03, 2020 at 10:52:15AM +0200, Otto Moerbeek wrote: > > > On Thu, Jul 02, 2020 at 08:27:58PM -0500, Scott Cheloha wrote: > > > > > > > Hi, > > > >

Re: adjfreq(2): limit adjustment to prevent overflow during tc_windup()

2020-07-06 Thread Mark Kettenis
> Date: Mon, 6 Jul 2020 16:40:35 -0500 > From: Scott Cheloha > > On Fri, Jul 03, 2020 at 10:52:15AM +0200, Otto Moerbeek wrote: > > On Thu, Jul 02, 2020 at 08:27:58PM -0500, Scott Cheloha wrote: > > > > > Hi, > > > > > > When we recompute the scaling factor during tc_windup() there is an > > >

Re: adjfreq(2): limit adjustment to prevent overflow during tc_windup()

2020-07-06 Thread Scott Cheloha
On Fri, Jul 03, 2020 at 10:52:15AM +0200, Otto Moerbeek wrote: > On Thu, Jul 02, 2020 at 08:27:58PM -0500, Scott Cheloha wrote: > > > Hi, > > > > When we recompute the scaling factor during tc_windup() there is an > > opportunity for arithmetic overflow/underflow when we add the NTP > >

Re: adjfreq(2): limit adjustment to prevent overflow during tc_windup()

2020-07-03 Thread Otto Moerbeek
On Thu, Jul 02, 2020 at 08:27:58PM -0500, Scott Cheloha wrote: > Hi, > > When we recompute the scaling factor during tc_windup() there is an > opportunity for arithmetic overflow/underflow when we add the NTP > adjustment into the scale: > >649 scale = (u_int64_t)1 << 63; >650

adjfreq(2): limit adjustment to prevent overflow during tc_windup()

2020-07-02 Thread Scott Cheloha
Hi, When we recompute the scaling factor during tc_windup() there is an opportunity for arithmetic overflow/underflow when we add the NTP adjustment into the scale: 649 scale = (u_int64_t)1 << 63; 650 scale += \ 651 ((th->th_adjustment +