Skip to content

Commit 942437c

Browse files
committed
y2038: allow disabling time32 system calls
At the moment, the compilation of the old time32 system calls depends purely on the architecture. As systems with new libc based on 64-bit time_t are getting deployed, even architectures that previously supported these (notably x86-32 and arm32 but also many others) no longer depend on them, and removing them from a kernel image results in a smaller kernel binary, the same way we can leave out many other optional system calls. More importantly, on an embedded system that needs to keep working beyond year 2038, any user space program calling these system calls is likely a bug, so removing them from the kernel image does provide an extra debugging help for finding broken applications. I've gone back and forth on hiding this option unless CONFIG_EXPERT is set. This version leaves it visible based on the logic that eventually it will be turned off indefinitely. Acked-by: Christian Brauner <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent bd40a17 commit 942437c

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

arch/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,8 @@ config COMPAT_OLD_SIGACTION
797797
bool
798798

799799
config COMPAT_32BIT_TIME
800-
def_bool !64BIT || COMPAT
800+
bool "Provide system calls for 32-bit time_t"
801+
default !64BIT || COMPAT
801802
help
802803
This enables 32 bit time_t support in addition to 64 bit time_t support.
803804
This is relevant on all 32-bit architectures, and 64-bit architectures

kernel/sys_ni.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,29 @@ COND_SYSCALL(send);
410410
COND_SYSCALL(bdflush);
411411
COND_SYSCALL(uselib);
412412

413+
/* optional: time32 */
414+
COND_SYSCALL(time32);
415+
COND_SYSCALL(stime32);
416+
COND_SYSCALL(utime32);
417+
COND_SYSCALL(adjtimex_time32);
418+
COND_SYSCALL(sched_rr_get_interval_time32);
419+
COND_SYSCALL(nanosleep_time32);
420+
COND_SYSCALL(rt_sigtimedwait_time32);
421+
COND_SYSCALL_COMPAT(rt_sigtimedwait_time32);
422+
COND_SYSCALL(timer_settime32);
423+
COND_SYSCALL(timer_gettime32);
424+
COND_SYSCALL(clock_settime32);
425+
COND_SYSCALL(clock_gettime32);
426+
COND_SYSCALL(clock_getres_time32);
427+
COND_SYSCALL(clock_nanosleep_time32);
428+
COND_SYSCALL(utimes_time32);
429+
COND_SYSCALL(futimesat_time32);
430+
COND_SYSCALL(pselect6_time32);
431+
COND_SYSCALL_COMPAT(pselect6_time32);
432+
COND_SYSCALL(ppoll_time32);
433+
COND_SYSCALL_COMPAT(ppoll_time32);
434+
COND_SYSCALL(utimensat_time32);
435+
COND_SYSCALL(clock_adjtime32);
413436

414437
/*
415438
* The syscalls below are not found in include/uapi/asm-generic/unistd.h

0 commit comments

Comments
 (0)