Messages in this thread | | | Date | Thu, 1 Sep 2016 10:02:55 +0200 | From | Richard Cochran <> | Subject | Re: [PATCH 4/6] time: Avoid undefined behaviour in timespec64_add_safe() |
| |
On Wed, Aug 31, 2016 at 02:50:20PM -0700, John Stultz wrote: > UBSAN: Undefined behaviour in kernel/time/time.c:783:2 > signed integer overflow: > 5273 + 9223372036854771711 cannot be represented in type 'long int'
...
> Line 783 is this: > > 783 set_normalized_timespec64(&res, lhs.tv_sec + rhs.tv_sec, > 784 lhs.tv_nsec + rhs.tv_nsec);
...
> Note that this is not currently a huge concern since the kernel should be > built with -fno-strict-overflow by default, but could be a problem in the > future, a problem with older compilers, or other compilers than gcc.
Is this really a concern at all? The value 9223372036854771711 is a huge number of seconds.
Thanks, Richard
| |