This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 3/6] y2038: linux: Provide __clock_settime64 implementation
- From: Stepan Golosunov <stepan at golosunov dot pp dot ru>
- To: Lukasz Majewski <lukma at denx dot de>, Arnd Bergmann <arnd at arndb dot de>, Deepa Dinamani <deepa dot kernel at gmail dot com>
- Cc: libc-alpha at sourceware dot org, Paul Eggert <eggert at cs dot ucla dot edu>, Joseph Myers <joseph at codesourcery dot com>, John Stultz <john dot stultz at linaro dot org>, Thomas Gleixner <tglx at linutronix dot de>, linux-kernel at vger dot kernel dot org
- Date: Sat, 20 Apr 2019 04:20:10 +0400
- Subject: Re: [PATCH 3/6] y2038: linux: Provide __clock_settime64 implementation
- References: <20190414220841.20243-1-lukma@denx.de> <20190414220841.20243-4-lukma@denx.de>
15.04.2019 в 00:08:38 +0200 Lukasz Majewski написал:
> +# if defined __NR_clock_settime64
> + /* Make sure that passed __timespec64 struct pad is 0. */
> + struct __timespec64 ts = *tp;
> + ts.tv_pad = 0;
> + return INLINE_SYSCALL_CALL (clock_settime64, clock_id, &ts);
Isn't kernel supposed to zero out padding on its own?
At least comment in kernel's get_timespec64 says so:
/* Zero out the padding for 32 bit systems or in compat mode */
if (IS_ENABLED(CONFIG_64BIT_TIME) && in_compat_syscall())
kts.tv_nsec &= 0xFFFFFFFFUL;
The code looks buggy though. It fails to zero out the padding in
32-bit kernels. That part is probably broken since
98f76206b3350 ("compat: Cleanup in_compat_syscall() callers").
And, hmm, is CONFIG_64BIT_TIME enabled anywhere?