History

Merge tag 'y2038-cleanups-5.5' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground

Pull y2038 cleanups from Arnd Bergmann: "y2038 syscall implementation cleanups This is a series of cleanups for the y2038 work, mostly intended for namespace cleaning: the kernel defines the traditional time_t, timeval and timespec types that often lead to y2038-unsafe code. Even though the unsafe usage is mostly gone from the kernel, having the types and associated functions around means that we can still grow new users, and that we may be missing conversions to safe types that actually matter. There are still a number of driver specific patches needed to get the last users of these types removed, those have been submitted to the respective maintainers" Link: https://lore.kernel.org/lkml/20191108210236.1296047-1-arnd@arndb.de/ * tag 'y2038-cleanups-5.5' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground: (26 commits) y2038: alarm: fix half-second cut-off y2038: ipc: fix x32 ABI breakage y2038: fix typo in powerpc vdso "LOPART" y2038: allow disabling time32 system calls y2038: itimer: change implementation to timespec64 y2038: move itimer reset into itimer.c y2038: use compat_{get,set}_itimer on alpha y2038: itimer: compat handling to itimer.c y2038: time: avoid timespec usage in settimeofday() y2038: timerfd: Use timespec64 internally y2038: elfcore: Use __kernel_old_timeval for process times y2038: make ns_to_compat_timeval use __kernel_old_timeval y2038: socket: use __kernel_old_timespec instead of timespec y2038: socket: remove timespec reference in timestamping y2038: syscalls: change remaining timeval to __kernel_old_timeval y2038: rusage: use __kernel_old_timeval y2038: uapi: change __kernel_time_t to __kernel_old_time_t y2038: stat: avoid 'time_t' in 'struct stat' y2038: ipc: remove __kernel_time_t reference from headers y2038: vdso: powerpc: avoid timespec references ...

Linus Torvalds committed 6 years ago

Commit ceb30742 parents 0da5221 b111df879 files · +472 −468Browse files

Showing the changes to include/uapi/linux (11 of 79 files). Show all

Unified · Split

11 files
  1. include/uapi/linux/cyclades.h +3 −3
  2. include/uapi/linux/elfcore.h +4 −4
  3. include/uapi/linux/errqueue.h +7 −0
  4. include/uapi/linux/msg.h +3 −3
  5. include/uapi/linux/ppp_defs.h +2 −2
  6. include/uapi/linux/resource.h +2 −2
  7. include/uapi/linux/sem.h +2 −2
  8. include/uapi/linux/shm.h +3 −3
  9. include/uapi/linux/time.h +3 −3
  10. include/uapi/linux/time_types.h +5 −0
  11. include/uapi/linux/utime.h +2 −2
include/uapi/linux/cyclades.h+3−3
@@ -83,9 +83,9 @@ struct cyclades_monitor { · 82 unmodified lines
83 * open)83 * open)
84 */84 */
85struct cyclades_idle_stats {85struct cyclades_idle_stats {
86 __kernel_time_t in_use; /* Time device has been in use (secs) */86 __kernel_old_time_t in_use; /* Time device has been in use (secs) */
87 __kernel_time_t recv_idle; /* Time since last char received (secs) */87 __kernel_old_time_t recv_idle; /* Time since last char received (secs) */
88 __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */88 __kernel_old_time_t xmit_idle; /* Time since last char transmitted (secs) */
89 unsigned long recv_bytes; /* Bytes received */89 unsigned long recv_bytes; /* Bytes received */
90 unsigned long xmit_bytes; /* Bytes transmitted */90 unsigned long xmit_bytes; /* Bytes transmitted */
91 unsigned long overruns; /* Input overruns */91 unsigned long overruns; /* Input overruns */
include/uapi/linux/elfcore.h+4−4
@@ -53,10 +53,10 @@ struct elf_prstatus · 52 unmodified lines
53 pid_t pr_ppid;53 pid_t pr_ppid;
54 pid_t pr_pgrp;54 pid_t pr_pgrp;
55 pid_t pr_sid;55 pid_t pr_sid;
56 struct timeval pr_utime; /* User time */56 struct __kernel_old_timeval pr_utime; /* User time */
57 struct timeval pr_stime; /* System time */57 struct __kernel_old_timeval pr_stime; /* System time */
58 struct timeval pr_cutime; /* Cumulative user time */58 struct __kernel_old_timeval pr_cutime; /* Cumulative user time */
59 struct timeval pr_cstime; /* Cumulative system time */59 struct __kernel_old_timeval pr_cstime; /* Cumulative system time */
60#if 060#if 0
61 long pr_instr; /* Current instruction */61 long pr_instr; /* Current instruction */
62#endif62#endif
include/uapi/linux/errqueue.h+7−0
@@ -37,9 +37,16 @@ struct sock_extended_err { · 36 unmodified lines
37 * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_*37 * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_*
38 * communicate network timestamps by passing this struct in a cmsg with38 * communicate network timestamps by passing this struct in a cmsg with
39 * recvmsg(). See Documentation/networking/timestamping.txt for details.39 * recvmsg(). See Documentation/networking/timestamping.txt for details.
40 * User space sees a timespec definition that matches either
41 * __kernel_timespec or __kernel_old_timespec, in the kernel we
42 * require two structure definitions to provide both.
40 */43 */
41struct scm_timestamping {44struct scm_timestamping {
45#ifdef __KERNEL__
46 struct __kernel_old_timespec ts[3];
47#else
42 struct timespec ts[3];48 struct timespec ts[3];
49#endif
43};50};
44 51
45struct scm_timestamping64 {52struct scm_timestamping64 {
include/uapi/linux/msg.h+3−3
@@ -19,9 +19,9 @@ struct msqid_ds { · 18 unmodified lines
19 struct ipc_perm msg_perm;19 struct ipc_perm msg_perm;
20 struct msg *msg_first; /* first message on queue,unused */20 struct msg *msg_first; /* first message on queue,unused */
21 struct msg *msg_last; /* last message in queue,unused */21 struct msg *msg_last; /* last message in queue,unused */
22 __kernel_time_t msg_stime; /* last msgsnd time */22 __kernel_old_time_t msg_stime; /* last msgsnd time */
23 __kernel_time_t msg_rtime; /* last msgrcv time */23 __kernel_old_time_t msg_rtime; /* last msgrcv time */
24 __kernel_time_t msg_ctime; /* last change time */24 __kernel_old_time_t msg_ctime; /* last change time */
25 unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */25 unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */
26 unsigned long msg_lqbytes; /* ditto */26 unsigned long msg_lqbytes; /* ditto */
27 unsigned short msg_cbytes; /* current number of bytes on queue */27 unsigned short msg_cbytes; /* current number of bytes on queue */
include/uapi/linux/ppp_defs.h+2−2
@@ -148,8 +148,8 @@ struct ppp_comp_stats { · 147 unmodified lines
148 * based on the libc time_t.148 * based on the libc time_t.
149 */149 */
150struct ppp_idle {150struct ppp_idle {
151 __kernel_time_t xmit_idle; /* time since last NP packet sent */151 __kernel_old_time_t xmit_idle; /* time since last NP packet sent */
152 __kernel_time_t recv_idle; /* time since last NP packet received */152 __kernel_old_time_t recv_idle; /* time since last NP packet received */
153};153};
154 154
155struct ppp_idle32 {155struct ppp_idle32 {
include/uapi/linux/resource.h+2−2
@@ -22,8 +22,8 @@ · 21 unmodified lines
22#define RUSAGE_THREAD 1 /* only the calling thread */22#define RUSAGE_THREAD 1 /* only the calling thread */
23 23
24struct rusage {24struct rusage {
25 struct timeval ru_utime; /* user time used */25 struct __kernel_old_timeval ru_utime; /* user time used */
26 struct timeval ru_stime; /* system time used */26 struct __kernel_old_timeval ru_stime; /* system time used */
27 __kernel_long_t ru_maxrss; /* maximum resident set size */27 __kernel_long_t ru_maxrss; /* maximum resident set size */
28 __kernel_long_t ru_ixrss; /* integral shared memory size */28 __kernel_long_t ru_ixrss; /* integral shared memory size */
29 __kernel_long_t ru_idrss; /* integral unshared data size */29 __kernel_long_t ru_idrss; /* integral unshared data size */
include/uapi/linux/sem.h+2−2
@@ -24,8 +24,8 @@ · 23 unmodified lines
24/* Obsolete, used only for backwards compatibility and libc5 compiles */24/* Obsolete, used only for backwards compatibility and libc5 compiles */
25struct semid_ds {25struct semid_ds {
26 struct ipc_perm sem_perm; /* permissions .. see ipc.h */26 struct ipc_perm sem_perm; /* permissions .. see ipc.h */
27 __kernel_time_t sem_otime; /* last semop time */27 __kernel_old_time_t sem_otime; /* last semop time */
28 __kernel_time_t sem_ctime; /* create/last semctl() time */28 __kernel_old_time_t sem_ctime; /* create/last semctl() time */
29 struct sem *sem_base; /* ptr to first semaphore in array */29 struct sem *sem_base; /* ptr to first semaphore in array */
30 struct sem_queue *sem_pending; /* pending operations to be processed */30 struct sem_queue *sem_pending; /* pending operations to be processed */
31 struct sem_queue **sem_pending_last; /* last pending operation */31 struct sem_queue **sem_pending_last; /* last pending operation */
include/uapi/linux/shm.h+3−3
@@ -28,9 +28,9 @@ · 27 unmodified lines
28struct shmid_ds {28struct shmid_ds {
29 struct ipc_perm shm_perm; /* operation perms */29 struct ipc_perm shm_perm; /* operation perms */
30 int shm_segsz; /* size of segment (bytes) */30 int shm_segsz; /* size of segment (bytes) */
31 __kernel_time_t shm_atime; /* last attach time */31 __kernel_old_time_t shm_atime; /* last attach time */
32 __kernel_time_t shm_dtime; /* last detach time */32 __kernel_old_time_t shm_dtime; /* last detach time */
33 __kernel_time_t shm_ctime; /* last change time */33 __kernel_old_time_t shm_ctime; /* last change time */
34 __kernel_ipc_pid_t shm_cpid; /* pid of creator */34 __kernel_ipc_pid_t shm_cpid; /* pid of creator */
35 __kernel_ipc_pid_t shm_lpid; /* pid of last operator */35 __kernel_ipc_pid_t shm_lpid; /* pid of last operator */
36 unsigned short shm_nattch; /* no. of current attaches */36 unsigned short shm_nattch; /* no. of current attaches */
include/uapi/linux/time.h+3−3
@@ -8,13 +8,13 @@ · 7 unmodified lines
8#ifndef _STRUCT_TIMESPEC8#ifndef _STRUCT_TIMESPEC
9#define _STRUCT_TIMESPEC9#define _STRUCT_TIMESPEC
10struct timespec {10struct timespec {
11 __kernel_time_t tv_sec; /* seconds */11 __kernel_old_time_t tv_sec; /* seconds */
12 long tv_nsec; /* nanoseconds */12 long tv_nsec; /* nanoseconds */
13};13};
14#endif14#endif
15 15
16struct timeval {16struct timeval {
17 __kernel_time_t tv_sec; /* seconds */17 __kernel_old_time_t tv_sec; /* seconds */
18 __kernel_suseconds_t tv_usec; /* microseconds */18 __kernel_suseconds_t tv_usec; /* microseconds */
19};19};
20 20
include/uapi/linux/time_types.h+5−0
@@ -28,6 +28,11 @@ struct __kernel_old_timeval { · 27 unmodified lines
28};28};
29#endif29#endif
30 30
31struct __kernel_old_timespec {
32 __kernel_old_time_t tv_sec; /* seconds */
33 long tv_nsec; /* nanoseconds */
34};
35
31struct __kernel_sock_timeval {36struct __kernel_sock_timeval {
32 __s64 tv_sec;37 __s64 tv_sec;
33 __s64 tv_usec;38 __s64 tv_usec;
include/uapi/linux/utime.h+2−2
@@ -5,8 +5,8 @@ · 4 unmodified lines
5#include <linux/types.h>5#include <linux/types.h>
6 6
7struct utimbuf {7struct utimbuf {
8 __kernel_time_t actime;8 __kernel_old_time_t actime;
9 __kernel_time_t modtime;9 __kernel_old_time_t modtime;
10};10};
11 11
12#endif12#endif