time: Fix get_timespec64() for y2038 safe compat interfaces
authorDeepa Dinamani <deepa.kernel@gmail.com>
Wed, 14 Mar 2018 04:03:31 +0000 (21:03 -0700)
committerArnd Bergmann <arnd@arndb.de>
Thu, 19 Apr 2018 11:31:39 +0000 (13:31 +0200)
commitea2ce8f3514e2074a1910d8d721842d7341d5c81
tree6cd2f49fc736fa05993aaec0f6827c31aba9a617
parentacf8870a62afd4f1b3c0b695aaa619df355c0851
time: Fix get_timespec64() for y2038 safe compat interfaces

get/put_timespec64() interfaces will eventually be used for
conversions between the new y2038 safe struct __kernel_timespec
and struct timespec64.

The new y2038 safe syscalls have a common entry for native
and compat interfaces.
On compat interfaces, the high order bits of nanoseconds
should be zeroed out. This is because the application code
or the libc do not guarantee zeroing of these. If used without
zeroing, kernel might be at risk of using timespec values
incorrectly.

Note that clearing of bits is dependent on CONFIG_64BIT_TIME
for now. This is until COMPAT_USE_64BIT_TIME has been handled
correctly. x86 will be the first architecture that will use the
CONFIG_64BIT_TIME.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
include/linux/time.h
kernel/time/time.c