This makes CONFIG_COMPAT_TIME user selectable, with the default remaining enabled so we don't break existing user space.
The idea behind turning off this option is that users that want to build long-term supported kernels can disable all code that is known to stop working in 2038, so they can debug the problems in user space today instead of guessing what might happen.
WARNING: This patch must not be applied before all 32-bit architectures are converted to select CONFIG_ARCH_HAS_COMPAT_TIME and provide the new system call entry points.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/Kconfig | 3 ++- kernel/sys_ni.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/arch/Kconfig b/arch/Kconfig index 630d3d289569..510ec4ed5f6b 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -549,7 +549,8 @@ config ARCH_HAS_COMPAT_TIME def_bool COMPAT
config COMPAT_TIME - def_bool ARCH_HAS_COMPAT_TIME + bool "Provide backwards-compatibility with 32-bit time_t" + default ARCH_HAS_COMPAT_TIME help This should be selected by all architectures that need to support system calls with a 32-bit time_t. Traditionally, this has been diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index 7995ef5868d8..0b0549750fb1 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c @@ -243,3 +243,41 @@ cond_syscall(sys_bpf);
/* execveat */ cond_syscall(sys_execveat); + +/* compat time handling for 32-bit time_t */ +cond_syscall(compat_sys_getrusage); +cond_syscall(compat_sys_wait4); +cond_syscall(compat_sys_waitid); +cond_syscall(compat_sys_time); +cond_syscall(compat_sys_stime); +cond_syscall(compat_sys_gettimeofday); +cond_syscall(compat_sys_settimeofday); +cond_syscall(compat_sys_setitimer); +cond_syscall(compat_sys_getitimer); +cond_syscall(compat_sys_utime); +cond_syscall(compat_sys_utimes); +cond_syscall(compat_sys_futimesat); +cond_syscall(compat_sys_utimensat); +cond_syscall(compat_sys_newstat); +cond_syscall(compat_sys_newlstat); +cond_syscall(compat_sys_newfstat); +cond_syscall(sys_stat64); +cond_syscall(sys_lstat64); +cond_syscall(sys_fstat64); +cond_syscall(sys_fstatat64); +cond_syscall(compat_sys_adjtimex); +cond_syscall(compat_sys_old_select); +cond_syscall(compat_sys_select); +cond_syscall(compat_sys_pselect6); +cond_syscall(compat_sys_ppoll); +cond_syscall(compat_sys_sched_rr_get_interval); +cond_syscall(compat_sys_nanosleep); +cond_syscall(compat_sys_rt_sigtimedwait); +cond_syscall(compat_sys_io_getevents); +cond_syscall(compat_sys_timer_settime); +cond_syscall(compat_sys_timer_gettime); +cond_syscall(compat_sys_clock_settime); +cond_syscall(compat_sys_clock_gettime); +cond_syscall(compat_sys_clock_getres); +cond_syscall(compat_sys_clock_nanosleep); +cond_syscall(compat_sys_clock_adjtime);