Re: [Y2038] [PATCH 6/8] lp: fix sparc64 LPSETTIMEOUT ioctl

2019-11-20 Thread Ben Hutchings
On Fri, 2019-11-08 at 21:34 +0100, Arnd Bergmann wrote: > The layout of struct timeval is different on sparc64 from > anything else, and the patch I did long ago failed to take > this into account. > > Change it now to handle sparc64 user space correctly again. > > Quite likely nobody cares

Re: [Y2038] [PATCH 3/8] powerpc: fix vdso32 for ppc64le

2019-11-20 Thread Arnd Bergmann
On Wed, Nov 20, 2019 at 8:13 PM Ben Hutchings wrote: > > On Fri, 2019-11-08 at 21:34 +0100, Arnd Bergmann wrote: > > On little-endian 32-bit application running on 64-bit kernels, > > the current vdso would read the wrong half of the xtime seconds > > field. Change it to return the lower half

Re: [Y2038] [PATCH 3/8] powerpc: fix vdso32 for ppc64le

2019-11-20 Thread Ben Hutchings
On Fri, 2019-11-08 at 21:34 +0100, Arnd Bergmann wrote: > On little-endian 32-bit application running on 64-bit kernels, > the current vdso would read the wrong half of the xtime seconds > field. Change it to return the lower half like it does on > big-endian. ppc64le doesn't have 32-bit compat

Re: [Y2038] [PATCH 7/8] ppdev: fix PPGETTIME/PPSETTIME ioctls

2019-11-20 Thread Ben Hutchings
On Fri, 2019-11-08 at 21:34 +0100, Arnd Bergmann wrote: > Going through the uses of timeval in the user space API, > I noticed two bugs in ppdev that were introduced in the y2038 > conversion: > > * The range check was accidentally moved from ppsettime to > ppgettime > > * On sparc64, the

Re: [Y2038] [PATCH 12/16] hostfs: pass 64-bit timestamps to/from user space

2019-11-20 Thread Ben Hutchings
On Fri, 2019-11-08 at 22:32 +0100, Arnd Bergmann wrote: > The use of 'struct timespec' is deprecated in the kernel, so we > want to avoid the conversions from/to the proper timespec64 > structure. > > On the user space side, we have a 'struct timespec' that is defined > by the C library and that

[Y2038] [PATCH] time: Zerofy padding in __kernel_timespec on 32-bit

2019-11-20 Thread Dmitry Safonov
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. Originally it was handled correctly, but lost

Re: [Y2038] [PATCH 3/8] powerpc: fix vdso32 for ppc64le

2019-11-20 Thread Ben Hutchings
On Wed, 2019-11-20 at 20:35 +0100, Arnd Bergmann wrote: > On Wed, Nov 20, 2019 at 8:13 PM Ben Hutchings > wrote: > > On Fri, 2019-11-08 at 21:34 +0100, Arnd Bergmann wrote: > > > On little-endian 32-bit application running on 64-bit kernels, > > > the current vdso would read the wrong half of the

Re: [Y2038] [PATCH 6/8] lp: fix sparc64 LPSETTIMEOUT ioctl

2019-11-20 Thread Ben Hutchings
On Wed, 2019-11-20 at 20:46 +0100, Arnd Bergmann wrote: > On Wed, Nov 20, 2019 at 8:27 PM Ben Hutchings > wrote: > > On Fri, 2019-11-08 at 21:34 +0100, Arnd Bergmann wrote: > > > The layout of struct timeval is different on sparc64 from > > > anything else, and the patch I did long ago failed to

Re: [Y2038] [PATCH 01/23] y2038: remove CONFIG_64BIT_TIME

2019-11-20 Thread Ben Hutchings
On Fri, 2019-11-08 at 22:07 +0100, Arnd Bergmann wrote: [...] > --- a/kernel/time/time.c > +++ b/kernel/time/time.c > @@ -267,7 +267,7 @@ COMPAT_SYSCALL_DEFINE2(settimeofday, struct old_timeval32 > __user *, tv, > } > #endif > > -#if !defined(CONFIG_64BIT_TIME) || defined(CONFIG_64BIT) >

Re: [Y2038] [PATCH 12/16] hostfs: pass 64-bit timestamps to/from user space

2019-11-20 Thread Ben Hutchings
On Wed, 2019-11-20 at 20:30 +, Ben Hutchings wrote: > On Fri, 2019-11-08 at 22:32 +0100, Arnd Bergmann wrote: > > The use of 'struct timespec' is deprecated in the kernel, so we > > want to avoid the conversions from/to the proper timespec64 > > structure. > > > > On the user space side, we

Re: [Y2038] [PATCH 02/23] y2038: add __kernel_old_timespec and __kernel_old_time_t

2019-11-20 Thread Ben Hutchings
On Fri, 2019-11-08 at 22:07 +0100, Arnd Bergmann wrote: > The 'struct timespec' definition can no longer be part of the uapi headers > because it conflicts with a a now incompatible libc definition. Also, > we really want to remove it in order to prevent new uses from creeping in. > > The same

Re: [Y2038] [PATCH 07/23] y2038: vdso: powerpc: avoid timespec references

2019-11-20 Thread Ben Hutchings
On Fri, 2019-11-08 at 22:07 +0100, Arnd Bergmann wrote: [...] > --- a/arch/powerpc/kernel/vdso32/gettimeofday.S > +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S > @@ -15,10 +15,8 @@ > /* Offset for the low 32-bit part of a field of long type */ > #if defined(CONFIG_PPC64) &&

Re: [Y2038] [PATCH 08/23] y2038: ipc: remove __kernel_time_t reference from headers

2019-11-20 Thread Ben Hutchings
On Fri, 2019-11-08 at 22:07 +0100, Arnd Bergmann wrote: [...] > --- a/arch/x86/include/uapi/asm/sembuf.h > +++ b/arch/x86/include/uapi/asm/sembuf.h > @@ -21,9 +21,9 @@ struct semid64_ds { > unsigned long sem_ctime; /* last change time */ > unsigned long sem_ctime_high; >

Re: [Y2038] [PATCH 01/23] y2038: remove CONFIG_64BIT_TIME

2019-11-20 Thread Dmitry Safonov
On 11/20/19 10:28 PM, Ben Hutchings wrote: > On Fri, 2019-11-08 at 22:07 +0100, Arnd Bergmann wrote: > [...] >> --- a/kernel/time/time.c >> +++ b/kernel/time/time.c >> @@ -267,7 +267,7 @@ COMPAT_SYSCALL_DEFINE2(settimeofday, struct >> old_timeval32 __user *, tv, >> } >> #endif >> >> -#if