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
8383 * open)
8484 */
8585 struct cyclades_idle_stats {
86− __kernel_time_t in_use; /* Time device has been in use (secs) */
87− __kernel_time_t recv_idle; /* Time since last char received (secs) */
88− __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
86+ __kernel_old_time_t in_use; /* Time device has been in use (secs) */
87+ __kernel_old_time_t recv_idle; /* Time since last char received (secs) */
88+ __kernel_old_time_t xmit_idle; /* Time since last char transmitted (secs) */
8989 unsigned long recv_bytes; /* Bytes received */
9090 unsigned long xmit_bytes; /* Bytes transmitted */
9191 unsigned long overruns; /* Input overruns */
include/uapi/linux/elfcore.h+4−4
@@ -53,10 +53,10 @@ struct elf_prstatus · 52 unmodified lines
5353 pid_t pr_ppid;
5454 pid_t pr_pgrp;
5555 pid_t pr_sid;
56− struct timeval pr_utime; /* User time */
57− struct timeval pr_stime; /* System time */
58− struct timeval pr_cutime; /* Cumulative user time */
59− struct timeval pr_cstime; /* Cumulative system time */
56+ struct __kernel_old_timeval pr_utime; /* User time */
57+ struct __kernel_old_timeval pr_stime; /* System time */
58+ struct __kernel_old_timeval pr_cutime; /* Cumulative user time */
59+ struct __kernel_old_timeval pr_cstime; /* Cumulative system time */
6060 #if 0
6161 long pr_instr; /* Current instruction */
6262 #endif
include/uapi/linux/errqueue.h+7−0
@@ -37,9 +37,16 @@ struct sock_extended_err { · 36 unmodified lines
3737 * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_*
3838 * communicate network timestamps by passing this struct in a cmsg with
3939 * 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.
4043 */
4144 struct scm_timestamping {
45+#ifdef __KERNEL__
46+ struct __kernel_old_timespec ts[3];
47+#else
4248 struct timespec ts[3];
49+#endif
4350 };
4451
4552 struct scm_timestamping64 {
include/uapi/linux/msg.h+3−3
@@ -19,9 +19,9 @@ struct msqid_ds { · 18 unmodified lines
1919 struct ipc_perm msg_perm;
2020 struct msg *msg_first; /* first message on queue,unused */
2121 struct msg *msg_last; /* last message in queue,unused */
22− __kernel_time_t msg_stime; /* last msgsnd time */
23− __kernel_time_t msg_rtime; /* last msgrcv time */
24− __kernel_time_t msg_ctime; /* last change time */
22+ __kernel_old_time_t msg_stime; /* last msgsnd time */
23+ __kernel_old_time_t msg_rtime; /* last msgrcv time */
24+ __kernel_old_time_t msg_ctime; /* last change time */
2525 unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */
2626 unsigned long msg_lqbytes; /* ditto */
2727 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
148148 * based on the libc time_t.
149149 */
150150 struct ppp_idle {
151− __kernel_time_t xmit_idle; /* time since last NP packet sent */
152− __kernel_time_t recv_idle; /* time since last NP packet received */
151+ __kernel_old_time_t xmit_idle; /* time since last NP packet sent */
152+ __kernel_old_time_t recv_idle; /* time since last NP packet received */
153153 };
154154
155155 struct ppp_idle32 {
include/uapi/linux/resource.h+2−2
@@ -22,8 +22,8 @@ · 21 unmodified lines
2222 #define RUSAGE_THREAD 1 /* only the calling thread */
2323
2424 struct rusage {
25− struct timeval ru_utime; /* user time used */
26− struct timeval ru_stime; /* system time used */
25+ struct __kernel_old_timeval ru_utime; /* user time used */
26+ struct __kernel_old_timeval ru_stime; /* system time used */
2727 __kernel_long_t ru_maxrss; /* maximum resident set size */
2828 __kernel_long_t ru_ixrss; /* integral shared memory size */
2929 __kernel_long_t ru_idrss; /* integral unshared data size */
include/uapi/linux/sem.h+2−2
@@ -24,8 +24,8 @@ · 23 unmodified lines
2424 /* Obsolete, used only for backwards compatibility and libc5 compiles */
2525 struct semid_ds {
2626 struct ipc_perm sem_perm; /* permissions .. see ipc.h */
27− __kernel_time_t sem_otime; /* last semop time */
28− __kernel_time_t sem_ctime; /* create/last semctl() time */
27+ __kernel_old_time_t sem_otime; /* last semop time */
28+ __kernel_old_time_t sem_ctime; /* create/last semctl() time */
2929 struct sem *sem_base; /* ptr to first semaphore in array */
3030 struct sem_queue *sem_pending; /* pending operations to be processed */
3131 struct sem_queue **sem_pending_last; /* last pending operation */
include/uapi/linux/shm.h+3−3
@@ -28,9 +28,9 @@ · 27 unmodified lines
2828 struct shmid_ds {
2929 struct ipc_perm shm_perm; /* operation perms */
3030 int shm_segsz; /* size of segment (bytes) */
31− __kernel_time_t shm_atime; /* last attach time */
32− __kernel_time_t shm_dtime; /* last detach time */
33− __kernel_time_t shm_ctime; /* last change time */
31+ __kernel_old_time_t shm_atime; /* last attach time */
32+ __kernel_old_time_t shm_dtime; /* last detach time */
33+ __kernel_old_time_t shm_ctime; /* last change time */
3434 __kernel_ipc_pid_t shm_cpid; /* pid of creator */
3535 __kernel_ipc_pid_t shm_lpid; /* pid of last operator */
3636 unsigned short shm_nattch; /* no. of current attaches */
include/uapi/linux/time.h+3−3
@@ -8,13 +8,13 @@ · 7 unmodified lines
88 #ifndef _STRUCT_TIMESPEC
99 #define _STRUCT_TIMESPEC
1010 struct timespec {
11− __kernel_time_t tv_sec; /* seconds */
12− long tv_nsec; /* nanoseconds */
11+ __kernel_old_time_t tv_sec; /* seconds */
12+ long tv_nsec; /* nanoseconds */
1313 };
1414 #endif
1515
1616 struct timeval {
17− __kernel_time_t tv_sec; /* seconds */
17+ __kernel_old_time_t tv_sec; /* seconds */
1818 __kernel_suseconds_t tv_usec; /* microseconds */
1919 };
2020
include/uapi/linux/time_types.h+5−0
@@ -28,6 +28,11 @@ struct __kernel_old_timeval { · 27 unmodified lines
2828 };
2929 #endif
3030
31+struct __kernel_old_timespec {
32+ __kernel_old_time_t tv_sec; /* seconds */
33+ long tv_nsec; /* nanoseconds */
34+};
35+
3136 struct __kernel_sock_timeval {
3237 __s64 tv_sec;
3338 __s64 tv_usec;
include/uapi/linux/utime.h+2−2
@@ -5,8 +5,8 @@ · 4 unmodified lines
55 #include <linux/types.h>
66
77 struct utimbuf {
8− __kernel_time_t actime;
9− __kernel_time_t modtime;
8+ __kernel_old_time_t actime;
9+ __kernel_old_time_t modtime;
1010 };
1111
1212 #endif