Re: [PATCH] time64: Avoid undefined behaviour in timespec64_add()

2019-02-27 Thread Thomas Gleixner
On Mon, 25 Feb 2019, Yao HongBo wrote: > On 2/25/2019 12:53 PM, Deepa Dinamani wrote: > > On Sun, Feb 24, 2019 at 7:13 PM Hongbo Yao wrote: > >> I ran into this: > >> UBSAN: Undefined behaviour in ./include/linux/time64.h:70:2 > >> signed integer overflow: > >> 1551059291

Re: [PATCH] time64: Avoid undefined behaviour in timespec64_add()

2019-02-25 Thread Deepa Dinamani
On Mon, Feb 25, 2019 at 1:02 AM Arnd Bergmann wrote: > > On Mon, Feb 25, 2019 at 5:53 AM Deepa Dinamani wrote: > > > > On Sun, Feb 24, 2019 at 7:13 PM Hongbo Yao wrote: > > > > > > I ran into this: > > > > > > = > >

Re: [PATCH] time64: Avoid undefined behaviour in timespec64_add()

2019-02-25 Thread Arnd Bergmann
On Mon, Feb 25, 2019 at 10:07 AM Arnd Bergmann wrote: > On Mon, Feb 25, 2019 at 10:01 AM Arnd Bergmann wrote: > > On Mon, Feb 25, 2019 at 5:53 AM Deepa Dinamani > > wrote: > > > On Sun, Feb 24, 2019 at 7:13 PM Hongbo Yao wrote: > > diff --git a/drivers/net/ethernet/cadence/macb_ptp.c > b/driv

Re: [PATCH] time64: Avoid undefined behaviour in timespec64_add()

2019-02-25 Thread Yao HongBo
On 2/25/2019 12:53 PM, Deepa Dinamani wrote: > On Sun, Feb 24, 2019 at 7:13 PM Hongbo Yao wrote: >> >> I ran into this: >> >> = >> UBSAN: Undefined behaviour in ./include/linux/time64.h:70:2 >> sign

Re: [PATCH] time64: Avoid undefined behaviour in timespec64_add()

2019-02-25 Thread Arnd Bergmann
On Mon, Feb 25, 2019 at 10:01 AM Arnd Bergmann wrote: > On Mon, Feb 25, 2019 at 5:53 AM Deepa Dinamani wrote: > > On Sun, Feb 24, 2019 at 7:13 PM Hongbo Yao wrote: > arch/arm/xen/enlighten.c: *ts = timespec64_add(now, ts_monotonic); > arch/arm/xen/enlighten.c: system_time = timespec

Re: [PATCH] time64: Avoid undefined behaviour in timespec64_add()

2019-02-25 Thread Arnd Bergmann
On Mon, Feb 25, 2019 at 5:53 AM Deepa Dinamani wrote: > > On Sun, Feb 24, 2019 at 7:13 PM Hongbo Yao wrote: > > > > I ran into this: > > > > = > > UBSAN: Undefined behaviour in ./include/linux/time64.h:70:2 >

Re: [PATCH] time64: Avoid undefined behaviour in timespec64_add()

2019-02-24 Thread Deepa Dinamani
On Sun, Feb 24, 2019 at 7:13 PM Hongbo Yao wrote: > > I ran into this: > > = > UBSAN: Undefined behaviour in ./include/linux/time64.h:70:2 > signed integer overflow: > 1551059291 + 922337203685

[PATCH] time64: Avoid undefined behaviour in timespec64_add()

2019-02-24 Thread Hongbo Yao
I ran into this: = UBSAN: Undefined behaviour in ./include/linux/time64.h:70:2 signed integer overflow: 1551059291 + 9223372036854775807 cannot be represented in type 'long long int'