y2038: time: avoid timespec usage in settimeofday()
authorArnd Bergmann <arnd@arndb.de>
Wed, 15 Aug 2018 18:04:11 +0000 (20:04 +0200)
committerArnd Bergmann <arnd@arndb.de>
Fri, 15 Nov 2019 13:38:30 +0000 (14:38 +0100)
commit5e0fb1b57bea8d11fe77da2bc80f4c9a67e28318
treee4554cf02f33b450918dbe585d5834abe16a3305
parentbde9e963af2d0a9762781c4dccaef21696d5bb94
y2038: time: avoid timespec usage in settimeofday()

The compat_get_timeval() and timeval_valid() interfaces are deprecated
and getting removed along with the definition of struct timeval itself.

Change the two implementations of the settimeofday() system call to
open-code these helpers and completely avoid references to timeval.

The timeval_valid() call is not needed any more here, only a check to
avoid overflowing tv_nsec during the multiplication, as there is another
range check in do_sys_settimeofday64().

Tested-by: syzbot+dccce9b26ba09ca49966@syzkaller.appspotmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
include/linux/syscalls.h
kernel/time/time.c