Re: [PATCH 17/23] y2038: time: avoid timespec usage in settimeofday()

From: Arnd Bergmann
Date: Thu Nov 14 2019 - 09:35:57 EST


On Thu, Nov 14, 2019 at 3:04 PM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> On Thu, 14 Nov 2019, Arnd Bergmann wrote:
> > On Wed, Nov 13, 2019 at 10:53 PM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> >
> > My idea was to not duplicate the range check that is done
> > in do_sys_settimeofday64() and again in do_settimeofday64:
> >
> > if (!timespec64_valid_settod(ts))
> > return -EINVAL;
> >
> > The only check we should need in addition to this is to ensure
> > that passing an invalid tv_usec number doesn't become an
> > unexpectedly valid tv_nsec after the multiplication.
>
> Right, but please add a proper comment as you/we are going to scratch heads
> 4 weeks from now when staring at that check and wondering why it is
> incomplete.

Ok, done. I had just uploaded the branch with the fixup for
the __user pointer access in the same patch, but that version
had introduced another typo. I hope the version I uploaded
now has all known issues addressed for tomorrow's linux-next.

Arnd