Re: [RFC PATCH] ntp: Avoid undefined behaviour in second_overflow()

2019-03-06 Thread Richard Cochran
On Wed, Mar 06, 2019 at 02:37:21PM +0100, Arnd Bergmann wrote: > > There is also y2070 (many RTCs), y2100 (some other RTCs, especially > those that assume it's a leap year), and y2106. That's okay, Arnd. When the time comes you can come out of retirement and cash in, doing Y2.07, Y2.1, and Y2.10

Re: [RFC PATCH] ntp: Avoid undefined behaviour in second_overflow()

2019-03-06 Thread Arnd Bergmann
On Wed, Mar 6, 2019 at 1:29 PM Thomas Gleixner wrote: > On Wed, 6 Mar 2019, Miroslav Lichvar wrote: > > On Tue, Mar 05, 2019 at 05:42:25PM -0800, John Stultz wrote: > So once Arnd is done with y2038, we'll ask him to look into y2262 :) There is also y2070 (many RTCs), y2100 (some other RTCs, esp

Re: [RFC PATCH] ntp: Avoid undefined behaviour in second_overflow()

2019-03-06 Thread Thomas Gleixner
On Wed, 6 Mar 2019, Miroslav Lichvar wrote: > On Tue, Mar 05, 2019 at 05:42:25PM -0800, John Stultz wrote: > > > --- a/kernel/time/ntp.c > > > +++ b/kernel/time/ntp.c > > > @@ -677,6 +677,8 @@ static inline void process_adjtimex_modes(const > > > struct timex *txc, s32 *time_tai > > > > > >

Re: [RFC PATCH] ntp: Avoid undefined behaviour in second_overflow()

2019-03-06 Thread Miroslav Lichvar
On Tue, Mar 05, 2019 at 05:42:25PM -0800, John Stultz wrote: > > --- a/kernel/time/ntp.c > > +++ b/kernel/time/ntp.c > > @@ -677,6 +677,8 @@ static inline void process_adjtimex_modes(const struct > > timex *txc, s32 *time_tai > > > > if (txc->modes & ADJ_MAXERROR) > > time_

Re: [RFC PATCH] ntp: Avoid undefined behaviour in second_overflow()

2019-03-05 Thread John Stultz
On Tue, Mar 5, 2019 at 5:29 PM Xiongfeng Wang wrote: > > When I ran Syzkaller testsuite, I got the following call trace. > > UBSAN: Undefined behaviour in kernel/time/ntp.c:457:16 > signed integer overflow: > 92233720