History

Merge tag 'y2038-drivers-for-v5.6-signed' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground

Pull y2038 updates from Arnd Bergmann: "Core, driver and file system changes These are updates to device drivers and file systems that for some reason or another were not included in the kernel in the previous y2038 series. I've gone through all users of time_t again to make sure the kernel is in a long-term maintainable state, replacing all remaining references to time_t with safe alternatives. Some related parts of the series were picked up into the nfsd, xfs, alsa and v4l2 trees. A final set of patches in linux-mm removes the now unused time_t/timeval/timespec types and helper functions after all five branches are merged for linux-5.6, ensuring that no new users get merged. As a result, linux-5.6, or my backport of the patches to 5.4 [1], should be the first release that can serve as a base for a 32-bit system designed to run beyond year 2038, with a few remaining caveats: - All user space must be compiled with a 64-bit time_t, which will be supported in the coming musl-1.2 and glibc-2.32 releases, along with installed kernel headers from linux-5.6 or higher. - Applications that use the system call interfaces directly need to be ported to use the time64 syscalls added in linux-5.1 in place of the existing system calls. This impacts most users of futex() and seccomp() as well as programming languages that have their own runtime environment not based on libc. - Applications that use a private copy of kernel uapi header files or their contents may need to update to the linux-5.6 version, in particular for sound/asound.h, xfs/xfs_fs.h, linux/input.h, linux/elfcore.h, linux/sockios.h, linux/timex.h and linux/can/bcm.h. - A few remaining interfaces cannot be changed to pass a 64-bit time_t in a compatible way, so they must be configured to use CLOCK_MONOTONIC times or (with a y2106 problem) unsigned 32-bit timestamps. Most importantly this impacts all users of 'struct input_event'. - All y2038 problems that are present on 64-bit machines also apply to 32-bit machines. In particular this affects file systems with on-disk timestamps using signed 32-bit seconds: ext4 with ext3-style small inodes, ext2, xfs (to be fixed soon) and ufs" [1] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=y2038-endgame * tag 'y2038-drivers-for-v5.6-signed' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground: (21 commits) Revert "drm/etnaviv: reject timeouts with tv_nsec >= NSEC_PER_SEC" y2038: sh: remove timeval/timespec usage from headers y2038: sparc: remove use of struct timex y2038: rename itimerval to __kernel_old_itimerval y2038: remove obsolete jiffies conversion functions nfs: fscache: use timespec64 in inode auxdata nfs: fix timstamp debug prints nfs: use time64_t internally sunrpc: convert to time64_t for expiry drm/etnaviv: avoid deprecated timespec drm/etnaviv: reject timeouts with tv_nsec >= NSEC_PER_SEC drm/msm: avoid using 'timespec' hfs/hfsplus: use 64-bit inode timestamps hostfs: pass 64-bit timestamps to/from user space packet: clarify timestamp overflow tsacct: add 64-bit btime field acct: stop using get_seconds() um: ubd: use 64-bit time_t where possible xtensa: ISS: avoid struct timeval dlm: use SO_SNDTIMEO_NEW instead of SO_SNDTIMEO_OLD ...

Linus Torvalds committed 6 years ago

Commit 22b17db2 parents a4fe2b4 c4e712149 files · +283 −266Browse files

Showing the changes to include/uapi/linux (4 of 49 files). Show all

Unified · Split

4 files
  1. include/uapi/linux/acct.h +2 −0
  2. include/uapi/linux/taskstats.h +5 −1
  3. include/uapi/linux/time_types.h +5 −0
  4. include/uapi/linux/timex.h +2 −0
include/uapi/linux/acct.h+2−0
@@ -49,6 +49,7 @@ struct acct · 48 unmodified lines
4949 __u16 ac_uid16; /* LSB of Real User ID */
5050 __u16 ac_gid16; /* LSB of Real Group ID */
5151 __u16 ac_tty; /* Control Terminal */
52+ /* __u32 range means times from 1970 to 2106 */
5253 __u32 ac_btime; /* Process Creation Time */
5354 comp_t ac_utime; /* User Time */
5455 comp_t ac_stime; /* System Time */
@@ -81,6 +82,7 @@ struct acct_v3 · 26 unmodified lines
8182 __u32 ac_gid; /* Real Group ID */
8283 __u32 ac_pid; /* Process ID */
8384 __u32 ac_ppid; /* Parent Process ID */
85+ /* __u32 range means times from 1970 to 2106 */
8486 __u32 ac_btime; /* Process Creation Time */
8587 #ifdef __KERNEL__
8688 __u32 ac_etime; /* Elapsed Time */
include/uapi/linux/taskstats.h+5−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 */
3535
3636
37−#define TASKSTATS_VERSION 9
37+#define TASKSTATS_VERSION 10
3838 #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
3939 * in linux/sched.h */
4040
@@ -112,6 +112,7 @@ struct taskstats { · 71 unmodified lines
112112 __u32 ac_gid; /* Group ID */
113113 __u32 ac_pid; /* Process ID */
114114 __u32 ac_ppid; /* Parent process ID */
115+ /* __u32 range means times from 1970 to 2106 */
115116 __u32 ac_btime; /* Begin time [sec since 1970] */
116117 __u64 ac_etime __attribute__((aligned(8)));
117118 /* Elapsed time [usec] */
@@ -168,6 +169,9 @@ struct taskstats { · 50 unmodified lines
168169 /* Delay waiting for thrashing page */
169170 __u64 thrashing_count;
170171 __u64 thrashing_delay_total;
172+
173+ /* v10: 64-bit btime to avoid overflow */
174+ __u64 ac_btime64; /* 64-bit begin time */
171175 };
172176
173177
include/uapi/linux/time_types.h+5−0
@@ -33,6 +33,11 @@ struct __kernel_old_timespec { · 32 unmodified lines
3333 long tv_nsec; /* nanoseconds */
3434 };
3535
36+struct __kernel_old_itimerval {
37+ struct __kernel_old_timeval it_interval;/* timer interval */
38+ struct __kernel_old_timeval it_value; /* current value */
39+};
40+
3641 struct __kernel_sock_timeval {
3742 __s64 tv_sec;
3843 __s64 tv_usec;
include/uapi/linux/timex.h+2−0
@@ -57,6 +57,7 @@ · 56 unmodified lines
5757
5858 #define NTP_API 4 /* NTP API version */
5959
60+#ifndef __KERNEL__
6061 /*
6162 * syscall interface - used (mainly by NTP daemon)
6263 * to discipline kernel clock oscillator
@@ -91,6 +92,7 @@ struct timex { · 28 unmodified lines
9192 int :32; int :32; int :32; int :32;
9293 int :32; int :32; int :32;
9394 };
95+#endif
9496
9597 struct __kernel_timex_timeval {
9698 __kernel_time64_t tv_sec;