This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v10] y2038: Provide conversion helpers for struct __timespec64
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Dmitry V. Levin" <ldv at altlinux dot org>
- Cc: <libc-alpha at sourceware dot org>, Lukasz Majewski <lukma at denx dot de>, Paul Eggert <eggert at cs dot ucla dot edu>, Alistair Francis <alistair23 at gmail dot com>, Arnd Bergmann <arnd at arndb dot de>, Alistair Francis <alistair dot francis at wdc dot com>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Carlos O'Donell <carlos at redhat dot com>, Stepan Golosunov <stepan at golosunov dot pp dot ru>, Florian Weimer <fw at deneb dot enyo dot de>, Zack Weinberg <zackw at panix dot com>
- Date: Wed, 4 Dec 2019 12:07:12 +0000
- Subject: Re: [PATCH v10] y2038: Provide conversion helpers for struct __timespec64
- Ironport-sdr: JG6hxWvHBb6IhegLcP43DH9CzCkBVRNmcAez+InO9Th0hxaB9OO0E2+IrvCKKgwP9hCGvC2rpQ rrMmAnXxvw0PZ2jip60QDwN+kPBdjaFQrW3zBq0auMb/rFASvCU0UGvQuvbOOSau8R2IeokoRi nL1q7cE3nOaWXr9chipGq72mGlOTIfTjhEX7Mvnrf/eLlYCz2OrRHXyP5F2stLYQneb1UN1pmj CbKoaThtVSW37iaPT2CjTDoOme3TRZltqeAacpU8NWSGl0mvYKKgWJCQ0gaIfTDcbHOj+GKz/b j24=
- Ironport-sdr: d6i2y4Gs7ay1jUA21w3Kzr+jVyPrPPusfR0gzOX30NoSDR62UbaKoMz2KZyuPkMR5LP3kgnPDp nr/ZZuBoiC7DDtYLQqj+7IB4eAsPBNBuadV9OTD+Z0/FjOe18yDuXe+L1Im/TelcBcyE4RNP3n gFRZ2YB9Kom4VAFcg/1RFC+RyF0hc5xeFUS3eFLKxl+sEbq3U0IRY35UQtEkth5yyj+XpXhO6H /qXGxWySeBx5RNQsTi2DqFfUmnFi3OvtYXRdyz28q+CN1Q0GEhlp3MLTEcMbpAARYkQwIuog0e zp4=
- References: <20190930133134.14771-1-lukma@denx.de> <20191204101906.GC22604@altlinux.org>
On Wed, 4 Dec 2019, Dmitry V. Levin wrote:
> Unfortunately, this didn't work out as intended because Linux kernel prior
> to commit 7b8474466ed97be458c825f34a85f2c2b84c3f95 (including released
> version v5.4) did not zero the upper 32-bits of tv_nsec on 32-bit
> architectures, which means that we have to do it in
> valid_timeval_to_timespec64 and valid_timespec_to_timespec64 instead.
"have to do it in valid_timeval_to_timespec64 and
valid_timespec_to_timespec64" can't be the answer.
Remember that all the functions using 64-bit time are intended in future
to be user-visible functions that will be called directly by user code
with _TIME_BITS=64. That is, it is those functions that have to handle
the padding being uninitialized. And so it is those functions, receiving
64-bit-time structures on input, that have to copy the structures (many
can legitimately be called with inputs in read-only memory, they can't
write to the inputs unless the definition of the function semantics says
they can) and zero the padding if supporting kernels that don't do so
themselves - not any callers that convert from 32-bit.
--
Joseph S. Myers
joseph@codesourcery.com