This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug time/16346] mktime: potentially unsafe use of localtime_offset


https://sourceware.org/bugzilla/show_bug.cgi?id=16346

--- Comment #9 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, aaribaud/y2038 has been created
        at  08a9200df25107ad05c29a8e3c36d68179d3d702 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=08a9200df25107ad05c29a8e3c36d68179d3d702

commit 08a9200df25107ad05c29a8e3c36d68179d3d702
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Wed Sep 6 10:00:42 2017 +0200

    Y2038: add _TIME_BITS support

    This makes all previously defined Y2038-proof API types, functions and
    implementations the default when _TIME_BITS==64 and __WORDSIZE==32 (so
    that 64-bit architectures are unaffected).

    Note: it is assumed that the API is consistent, i.e. for each API type
    which is enabled here, all API functions which depend on this type are
    enabled and mapped to Y2038-proof implementations.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9ab40356eb1acc00712f1949d8c479713774c50e

commit 9ab40356eb1acc00712f1949d8c479713774c50e
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Thu Apr 12 20:50:21 2018 +0200

    Y2038: add function __pmap_rmtcall64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ba5ac5133c8ac8236bfb39fd700c589e310bcbc3

commit ba5ac5133c8ac8236bfb39fd700c589e310bcbc3
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Thu Apr 12 20:49:49 2018 +0200

    Y2038: add function __clntudp_bufcreate64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=89b90866f2c17b7c072b76b409003ee1d2953bb1

commit 89b90866f2c17b7c072b76b409003ee1d2953bb1
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Thu Apr 12 20:46:27 2018 +0200

    Y2038: add function __clntudp_create64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8fba0bc15f5662ec51c59d0c34b82eea0778e5a5

commit 8fba0bc15f5662ec51c59d0c34b82eea0778e5a5
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 19:49:07 2017 +0200

    Y2038: add function select64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9966f113bfd8c87bfd32311258862f9a6605488c

commit 9966f113bfd8c87bfd32311258862f9a6605488c
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:16 2017 +0200

    Y2038: add function pselect64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b8bbabfd0da1cdb1b2f62d9243457011efc3c430

commit b8bbabfd0da1cdb1b2f62d9243457011efc3c430
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:15 2017 +0200

    Y2038: add struct __timex64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eb8efa653928ac1f05837a3a9d91a36e3d1051a5

commit eb8efa653928ac1f05837a3a9d91a36e3d1051a5
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:14 2017 +0200

    Y2038: add function __ntp_gettimex64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5c33009ebdb6fd736f0ed50a19a402c80c5ac0e3

commit 5c33009ebdb6fd736f0ed50a19a402c80c5ac0e3
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:13 2017 +0200

    Y2038: add function __ntp_gettime64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=abe9af278d2dcedcf17ce105327de79e0f713d3e

commit abe9af278d2dcedcf17ce105327de79e0f713d3e
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:12 2017 +0200

    Y2038: add struct __ntp_timeval64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=355d3870d016962a2d0959f5aa687cb944bb2ea5

commit 355d3870d016962a2d0959f5aa687cb944bb2ea5
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:11 2017 +0200

    Y2038: add function __getrusage64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=37558f0cdaae9b774c80fb420ecc5d950680a49d

commit 37558f0cdaae9b774c80fb420ecc5d950680a49d
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:10 2017 +0200

    Y2038: add functions using futexes

    This creates 64-bit time versions of the following APIs:
    - pthread_rwlock_timedrdlock
    - pthread_rwlock_timedwrlock
    - pthread_mutex_timedlock
    - pthread_cond_timedwait
    - sem_timedwait
    - aio_suspend

    It also creates 64-bit time versions of the following
    functions or macros:
    - lll_timedlock_elision
    - lll_timedlock
    - __lll_timedlock_wait
    - futex_reltimed_wait_cancelable
    - lll_futex_timed_wait
    - __pthread_cond_wait_common
    - futex_abstimed_wait_cancelable
    - lll_futex_timed_wait_bitset
    - do_aio_misc_wait
    - AIO_MISC_WAIT
    - __new_sem_wait_slow
    - do_futex_wait
    - __pthread_rwlock_wrlock_full
    - __pthread_rwlock_rdlock_full
    - futex_abstimed_wait

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=36d6fc2769458b5bf655f535755ec9ae698c5b5a

commit 36d6fc2769458b5bf655f535755ec9ae698c5b5a
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:09 2017 +0200

    Y2038: add function __setitimer64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=58eb322b126246d17098c606e4312961dc04679a

commit 58eb322b126246d17098c606e4312961dc04679a
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:08 2017 +0200

    Y2038: add function __getitimer64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=de7f58bc51f2e86bd16f3aeaa9dca7a454706037

commit de7f58bc51f2e86bd16f3aeaa9dca7a454706037
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:07 2017 +0200

    Y2038: add struct __itimerval64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=790366c9e1f97bcd89d7a3d65816af4d1b307fad

commit 790366c9e1f97bcd89d7a3d65816af4d1b307fad
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:06 2017 +0200

    Y2038: add function __utime64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=28c746c62e20ff743a762713758f877b7bbc4767

commit 28c746c62e20ff743a762713758f877b7bbc4767
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:05 2017 +0200

    Y2038: add function __adjtime64, __adjtimex64 and __ntp_adjtime64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=aff59a7d1399e439c7da7626e5d76972e27185d6

commit aff59a7d1399e439c7da7626e5d76972e27185d6
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:04 2017 +0200

    Y2038: add function __nanosleep64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=daa35601510c8cc0a06d88c8efca18092792bbd0

commit daa35601510c8cc0a06d88c8efca18092792bbd0
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:03 2017 +0200

    Y2038: add function __sched_rr_get_interval64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ad55e4722bb54e2b9698892feecefabdfd195147

commit ad55e4722bb54e2b9698892feecefabdfd195147
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:02 2017 +0200

    Y2038: add function __msgctl64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=af968ea940fa67c68402b9142a6f05a0630fdaee

commit af968ea940fa67c68402b9142a6f05a0630fdaee
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:01 2017 +0200

    Y2038: add function __mq_timedsend_time64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3f4af35842056141f9e235dad50b56b3a22538ae

commit 3f4af35842056141f9e235dad50b56b3a22538ae
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:42:00 2017 +0200

    Y2038: add function __mq_timedreceiv_time64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=79c63b9951c162bf260d68b04fc3726b81451f64

commit 79c63b9951c162bf260d68b04fc3726b81451f64
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:57 2017 +0200

    Y2038: add function __utimes64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6ff44ea35400dc5a464d06f15cbc306b2c692191

commit 6ff44ea35400dc5a464d06f15cbc306b2c692191
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:56 2017 +0200

    Y2038: add function __stime64

    This implementation uses __settimeofday64.
    Therefore, on a system where current time-of-day is 32 bits, this
    implementation will fail for dates beyond Y2038.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d343c3981df35769cda910de3a2b2878a7263091

commit d343c3981df35769cda910de3a2b2878a7263091
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:55 2017 +0200

    Y2038: add function __time64

    This provides a generic Posix implementation based on calling
    __gettimeofday64().

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=32d5fb3bab5f28d9a3ee81e18cff88faa0ede402

commit 32d5fb3bab5f28d9a3ee81e18cff88faa0ede402
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:59 2017 +0200

    Y2038: add function __settimeofday64

    Implementing a 64-bit settimeofday requires adding a new
    file to build under time/ and we cannot name that new file
    'settimeofday.c' or it will break the 32-bit settimeofday
    file symbol, so we call it 'settimeofday64.c'.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=427dc6925bbcb3912bb25fd51eb5972dd73b1fa4

commit 427dc6925bbcb3912bb25fd51eb5972dd73b1fa4
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:58 2017 +0200

    Y2038: add function __gettimeofday64

    Implementing a 64-bit settimeofday requires adding a new
    file to build under time/ and we cannot name that new file
    'settimeofday.c' or it will break the 32-bit settimeofday
    symbol, so we call it 'settimeofday64.c'.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f539ec043fdeda7ded6f546a2647b606099619eb

commit f539ec043fdeda7ded6f546a2647b606099619eb
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:54 2017 +0200

    Y2038: add function __fstatat64_time64 (and __fxstatat_time64)

    These implementations just use the existing syscalls and convert from
    kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=59a4dbba83c3628447e29470f6cfc86f79f52797

commit 59a4dbba83c3628447e29470f6cfc86f79f52797
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:53 2017 +0200

    Y2038: add function __lstat64_time64 (and __lxstat64_time64)

    These implementations just use the existing syscalls and convert from
    kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c9fdb8914a3af7215c65c889ca656046d596655a

commit c9fdb8914a3af7215c65c889ca656046d596655a
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:52 2017 +0200

    Y2038: add function __stat64_time64 (and __xstat64_time64)

    These implementations just use the existing syscalls and convert from
    kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2d7b3a49700b6c101af6e9bbfcde6d3e9c60daa9

commit 2d7b3a49700b6c101af6e9bbfcde6d3e9c60daa9
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:51 2017 +0200

    Y2038: add function __fstat64_time64 (and __fxstat64_time64)

    These implementations just use the existing syscalls and convert from
    kernel 32-bit-time struct stat64 to GLIBC Y2038-ready struct __stat64_t64.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=725aa08c494e7108912411a1d96d289f1f602634

commit 725aa08c494e7108912411a1d96d289f1f602634
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:50 2017 +0200

    Y2038: add struct __stat64_t64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=19f2debd5894cb5d3d807a6f4130a012ba095455

commit 19f2debd5894cb5d3d807a6f4130a012ba095455
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:49 2017 +0200

    Y2038: add function __timerfd_settime64

    For Linux this uses the 32-bit time syscal, so it converts
    syscall input from 64-bit time into 32-bit time and syscall
    output from 32-bit time to 64-bit time.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=556ca0ec3c6f0da44b585b6f89e5fcc8b0c02b12

commit 556ca0ec3c6f0da44b585b6f89e5fcc8b0c02b12
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:48 2017 +0200

    Y2038: add function __timerfd_gettime64

    For Linux this uses the 32-bit time syscall so it converts the
    syscall output from 32-bit time to 64-bit time.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a275e5235cafff49ffa32cc5a4e143b6dcf562c2

commit a275e5235cafff49ffa32cc5a4e143b6dcf562c2
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:47 2017 +0200

    Y2038: add function __timer_settime64

    For Linux this uses a 32-bit syscall, so it converts the syscall
    input from 64-bit time into 32-bit time, and the syscall output
    from 32-bit time into 64-bit time.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=df6df297b708b6c3faf5b57ad7efc7f827eb9cf2

commit df6df297b708b6c3faf5b57ad7efc7f827eb9cf2
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:46 2017 +0200

    Y2038: add function __timer_gettime64

    For Linux this uses the 32-bit time syscall, so it
    converts the syscall output into 64-bit time.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=224b6638305ebe36f1916b28e490c63857f87bf1

commit 224b6638305ebe36f1916b28e490c63857f87bf1
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:45 2017 +0200

    Y2038: add struct __itimerspec64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=35ebe23a70319cf4664cc6d73f3050c77475d270

commit 35ebe23a70319cf4664cc6d73f3050c77475d270
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:44 2017 +0200

    Y2038: add function __lutimes64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a374c3f313ce79fb13de8ad19885323cd163313e

commit a374c3f313ce79fb13de8ad19885323cd163313e
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:43 2017 +0200

    Y2038: add function __futimes64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=60dd44180cb0a2b83d0ef29d690eab961716c4fd

commit 60dd44180cb0a2b83d0ef29d690eab961716c4fd
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:42 2017 +0200

    Y2038: add struct __timeval64

    Also, provide static inline functions and macros for checking
    and converting between 32-bit and 64-bit timevals.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1a27cdf7f21ce3c2f317f3ebfcf5fd99ce40b64a

commit 1a27cdf7f21ce3c2f317f3ebfcf5fd99ce40b64a
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:41 2017 +0200

    Y2038: add function __sigtimedwait_time64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cd6660343e4aa16dfd6411432be1a2abfddef8d4

commit cd6660343e4aa16dfd6411432be1a2abfddef8d4
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:39 2017 +0200

    Y2038: add function __futimens64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=522496c3addab5cb4b30b0ed9c262437f73b5c17

commit 522496c3addab5cb4b30b0ed9c262437f73b5c17
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:40 2017 +0200

    Y2038: add function __utimensat_time64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a875a2f5cc834714a9a2bacb55f167677a8b82c7

commit a875a2f5cc834714a9a2bacb55f167677a8b82c7
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:38 2017 +0200

    Y2038: add function __timespec_get64

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=85df550b1be0d01a18fbbd3f227b2ad39c503810

commit 85df550b1be0d01a18fbbd3f227b2ad39c503810
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:37 2017 +0200

    Y2038: add function __clock_nanosleep64

    Linux does not provide a 64-bit-time clock_nanosleep syscall,
    so __clock_nanosleep64 is a wrapper calling __clock_nanosleep,
    with one conversion before the call and possibly one after.

    Note:

    There is no point in implementing __clock_nanosleep64 directly
    around the 32-bit-time syscall and making __clock_nanosleep a
    wrapper around __clock_nanosleep64, because __clock_nanosleep64
    would still need one or two conversions, and __clock_nanosleep
    would now also need those, adding a cost of 2 to 4 conversions
    in the worst case.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5df9adf4d52ffd5d4e983788c94f0f2359d4d68e

commit 5df9adf4d52ffd5d4e983788c94f0f2359d4d68e
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:36 2017 +0200

    Y2038: add function __clock_getres_time64

    * include/time.h (__clock_getres_time64): Add.
    * sysdeps/posix/clock_getres.c (hp_timing_getres): Use
      struct __timespec64.
    * sysdeps/posix/clock_getres.c (realtime_getres): Likewise.
    * sysdeps/posix/clock_getres.c (__clock_getres_time64): Add.
    * sysdeps/posix/clock_getres.c Use SYSDEP_GETRES64.
    * sysdeps/posix/clock_getres.c Use SYSDEP_GETRES_CPU64.
    * sysdeps/posix/clock_getres.c (__clock_getres):
      Use __clock_getres_time64.
    * sysdeps/unix/sysv/linux/clock_getres.c (SYSCALL_GETRES32): Add.
    * sysdeps/unix/sysv/linux/clock_getres.c (SYSCALL_GETRES64): Likewise.
    * sysdeps/unix/sysv/linux/clock_getres.c (SYSDEP_GETRES64): Likewise.
    * sysdeps/unix/sysv/linux/clock_getres.c (SYSDEP_GETRES_CPU64): Likewise.

    The Unix implementation uses 32-bit calls and converts to
    64-bit time.

    The Linux implementation uses the 64-bit time syscall if
    available, otherwise it falls back to 32-bit syscall and
    conversion.

    This implementation depends on the clock_getres_time64
    syscall being provided by the kernel at build as well
    as run time.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f380b5e890f0cc2adfb38301b91880b4716b504f

commit f380b5e890f0cc2adfb38301b91880b4716b504f
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:35 2017 +0200

    Y2038: add function __clock_settime64

    * include/time.h (__clock_settime64): Add.
    * sysdeps/unix/clock_settime.c (__clock_settime64): Add.
    * sysdeps/unix/sysv/linux/clock_settime.c (DO_CLOCK_SETTIME_32): Add.
    * sysdeps/unix/sysv/linux/clock_settime.c (DO_CLOCK_SETTIME_64): Add.
    * sysdeps/unix/sysv/linux/clock_settime.c (SYSDEP_SETTIME64_CPUTIME): Add.
    * sysdeps/unix/sysv/linux/clock_settime.c (SYSDEP_SETTIME64): Add.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d460b6f1b4bda9a80454be24a82c31ee0116aadb

commit d460b6f1b4bda9a80454be24a82c31ee0116aadb
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Sun Apr 8 11:15:24 2018 +0200

    Y2038: add function __clock_gettime64

    * include/time.h: Declare __clock_gettime64().
    * ntpl/pthread_clock_gettime.c: Add __pthread_clock_gettime64().
    * ntpl/pthread_clock_gettime.c: Make __pthread_clock_gettime()
      a wrapper around __pthread_clock_gettime64().
    * sysdeps/unix/clock_gettime.c (hp_timing_gettime): Use struct
      __timespec64.
    * sysdeps/unix/clock_gettime.c (realtime_gettime): Likewise.
    * sysdeps/unix/clock_gettime.c: Add __clock_gettime64().
    * sysdeps/unix/clock_gettime.c: Make __clock_gettime() a
      wrapper around __clock_gettime64().
    * sysdeps/unix/sysv/linux/clock_gettime.c: Add 64-bit-time syscall
      support.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=158c8a3dbcae1ca80bdb708bb0bf8d1145d1b4aa

commit 158c8a3dbcae1ca80bdb708bb0bf8d1145d1b4aa
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Fri Sep 8 00:41:33 2017 +0200

    Y2038: add struct __timespec64

    * include/bits/types/struct_timespec64.h:
      Include time/bits/types/struct_timespec64.h
    * include/time.h (valid_timeval_to_timespec64): Add.
    * include/time.h (valid_timespec_to_timespec64): Likewise.
    * include/time.h (valid_timespec64_to_timespec): Likewise.
    * include/time.h (valid_timespec64_to_timeval): Likewise.
    * include/time.h (IS_VALID_NANOSECONDS): Likewise.
    * include/time.h (timespec_to_timespec64): Likewise.
    * include/time.h (timespec64_to_timespec): Likewise.
    * include/time.h (timespec64_to_timeval): Likewise.
    * io/fcntl.h: Include bits/types/struct_timespec64.h.
    * io/sys/poll.h: Likewise.
    * io/sys/stat.h: Likewise.
    * misc/sys/select.h: Likewise.
    * posix/sched.h: Likewise.
    * posix/netdb.h: Likewise.
    * rt/aio.h: Likewise.
    * rt/mqueue.h: Likewise.
    * signal/signal.h: Likewise.
    * sysdeps/nptl/pthread.h: Likewise.
    * sysdeps/pthread/semaphore.h: Likewise.
    * sysdeps/unix/sysv/linux/hppa/pthread.h: Likewise.
    * sysvipc/sys/sem.h: Likewise.
    * time/Makefile: Add bits/types/struct_timespec64.h
    * time/bits/types/struct_itimerspec.h:
      Include bits/types/struct_timespec64.h
    * time/bits/types/struct_itimerspec64.h: Add.
    * time/time.h: Include bits/types/struct_timespec64.h

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=33098a3d802138bc117ecc76d7e8920550d4f7fe

commit 33098a3d802138bc117ecc76d7e8920550d4f7fe
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Sun Jun 10 10:47:12 2018 +0200

    Y2038: provide kernel support indication

    * New function __y2038_get_kernel_support() returns:
      * 0 if the underlying kernel does not support Y2038 at all
      * > 0 if the underlying kernel has some support for Y2038
      * < 0 if the underlying kernel support for Y2038 is broken
    * New function __y2038_set_kernel_support() allows indicating
      a kernel's Y2038 support (or support failure)
    * Default implementation (covering non-Linux kernels) always
      returns 0 (no support).

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f03fd63f9b4dca5b9c70cc2518e3eeaa20529ec0

commit f03fd63f9b4dca5b9c70cc2518e3eeaa20529ec0
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Wed Mar 29 11:57:53 2017 +0200

    Y2038: add function __difftime64

    * __difftime: provide a 64-bit-time version (but do not assume
      __time64_t is a signed int so that Gnulib can reuse the code)
      and make the 32-bit version a wrapper of it.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=680ed897cdb1095aa035f30e08467f77ea1d3594

commit 680ed897cdb1095aa035f30e08467f77ea1d3594
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Fri Aug 31 23:45:31 2018 -0700

    Add support for __time64_t to mktime, timegm

    * include/time.h, time/mktime.c, time/timegm.c:
    Change externally-visible names to their __xxx64yyy version.
    * include/time.h (fits_in_time_t): New static function.
    * time/mktime.c (mktime) [_LIBC]: New wrapper function.
    * time/timegm.c (timegm) [_LIBC]: New wrapper function.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=32bc55ef9a4cff8c7a8c0825421fd332d570b198

commit 32bc55ef9a4cff8c7a8c0825421fd332d570b198
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Mon Jun 18 21:14:43 2018 +0200

    Y2038: make __tz_convert compatible with 64-bit-time

    * __tz_compute: Pass timer as a __time64_t rather than time_t.
    * __offtime: Pass __timer as a __time64_t value rather than
      a const time_t pointer.
    * __tz_convert: Likewise.
    * localtime: provide a 64-bit time version and make the 32-bit
      time version a wrapper of it.
    * localtime_r: Likewise.
    * ctime: Likewise.
    * ctime_r: Likewise.
    * gmtime: Likewise.
    * gmtime_r: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1575bcfed3b040afb0284b4c4254e0f506da4746

commit 1575bcfed3b040afb0284b4c4254e0f506da4746
Author: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Date:   Mon Jun 18 21:14:42 2018 +0200

    Y2038: Add 64-bit time for all architectures

    * Add macro __TIMESIZE equal to the bit size of time_t.
      It equals the architecture __WORDSIZE except for x32
      where it equals 64.
    * Add type __time64_t which is always 64-bit. On 64-bit
      architectures and on x32, it is #defined as time_t.
      On other architectures, it has its own definition.
    * Replace all occurrences of internal_time_t with
      __time64_t.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=63aaf075fff33777b3e3013a5bd90d140f073a8b

commit 63aaf075fff33777b3e3013a5bd90d140f073a8b
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Sun Sep 9 09:06:25 2018 -0700

    Fix mktime localtime offset confusion

    [BZ #23603]
    * include/time.h (__mktime_internal): The localtime offset is now
    of type long int instead of time_t.  This is the longstanding type
    in glibc, and it is more than enough to represent difference
    between localtime and gmtime even if it is 32 bits and time_t is
    64.  Changing it now will let us avoid an unnecessary change when
    time_t is widened to 64 bits on 32-bit platforms.
    * time/mktime-internal.h (mktime_offset_t): Now long int.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=519466d3616c5af128997c96d02c112b8b47b16b

commit 519466d3616c5af128997c96d02c112b8b47b16b
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Sun Sep 9 09:06:24 2018 -0700

    Merge mktime, timegm from upstream Gnulib

    [BZ #23603][BZ #16346]
    This fixes some obscure problems with integer overflow.
    Although it looks scary, it is almost all a byte-for-byte copy
    from Gnulib, and the Gnulib code has been tested reasonably well.
    * include/intprops.h: New file, copied from Gnulib.
    * include/verify.h, time/mktime-internal.h:
    New tiny files, simplified from Gnulib.
    * time/mktime.c: Copy from Gnulib.  This has the following changes:
    Do not include config.h if DEBUG_MKTIME is nonzero.
    Include stdbool.h, intprops.h, verify.h.
    Include string.h only if needed.
    Include stdlib.h on MS-Windows.
    Include mktime-internal.h.
    (DEBUG_MKTIME): Default to 0, and simplify later uses.
    (NEED_MKTIME_INTERNAL, NEED_MKTIME_WINDOWS)
    (NEED_MKTIME_WORKING): Give default values to pacify -Wundef,
    which glibc uses.  Default NEED_MKTIME_WORKING to DEBUG_MKTIME, to
    simplify later conditionals; default the others to zero.  Use
    these conditionals to express only the code needed on the current
    platform.  In uses of these conditionals, explicitly spell out how
    _LIBC affects things, so it’s easier to review from a glibc
    viewpoint.
    (WRAPV): Remove; no longer needed now that we have
    systematic overflow checking.
    (my_tzset, __tzset) [!_LIBC]: New function and macro, to better
    compartmentalize tzset issues.  Move system-dependent tzsettish
    code here from mktime.
    (verify): Remove; now done by verify.h.  All uses changed.
    (long_int): Use a more-conservative definition, to avoid
    integer overflow.
    (SHR): Remove, replacing with ...
    (shr): New function, which means we needn’t worry about side
    effects in args, and conversion analysis is simpler.
    (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT, TYPE_SIGNED, TYPE_MINIMUM)
    (TYPE_MAXIMUM, TIME_T_MIN, TIME_T_MAX, TIME_T_MIDPOINT)
    (time_t_avg, time_t_add_ok): Remove.
    (mktime_min, mktime_max): New constants.
    (leapyear, isdst_differ): Use bool for booleans.
    (ydhms_diff, guess_time_tm, ranged_convert, __mktime_internal):
    Use long_int, not time_t, for mktime differences.
    (long_int_avg): New function, replacing time_t_avg.
    INT_ADD_WRAPV replaces time_t_add_ok.
    (guess_time_tm): 6th arg is now long_int, not time_t const *.
    All uses changed.
    (convert_time): New function.
    (ranged_convert): Use it.
    (__mktime_internal): Last arg now points to mktime_offset_t, not
    time_t.  All uses changed.  This is a no-op on glibc, where
    mktime_offset_t is always time_t.  Use int, not time_t, for UTC
    offset guess.  Directly check for integer overflow instead of
    using a heuristic that works only 99.9...% of the time.
    Access *OFFSET only once, to avoid an unlikely race if the
    compiler delays a load and if this cascades into a signed integer
    overflow.
    (mktime): Move tzsettish code to my_tzset, and move
    localtime_offset to within mktime so that it doesn’t
    need a separate ifdef.
    (main) [DEBUG_MKTIME]: Speed up by using localtime_r
    instead of localtime.
    * time/timegm.c: Copy from Gnulib.  This has the following changes:
    Include mktime-internal.h.
    [!_LIBC]: Include config.h and time.h.  Do not include
    timegm.h or time_r.h.  Make __mktime_internal a macro,
    and include mktime-internal.h to get its declaration.
    (timegm): Temporary is now mktime_offset_t, not time_t.
    This affects only Gnulib.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]