Skip to content

Commit

Permalink
y2038: rename old time and utime syscalls
Browse files Browse the repository at this point in the history
The time, stime, utime, utimes, and futimesat system calls are only
used on older architectures, and we do not provide y2038 safe variants
of them, as they are replaced by clock_gettime64, clock_settime64,
and utimensat_time64.

However, for consistency it seems better to have the 32-bit architectures
that still use them call the "time32" entry points (leaving the
traditional handlers for the 64-bit architectures), like we do for system
calls that now require two versions.

Note: We used to always define __ARCH_WANT_SYS_TIME and
__ARCH_WANT_SYS_UTIME and only set __ARCH_WANT_COMPAT_SYS_TIME and
__ARCH_WANT_SYS_UTIME32 for compat mode on 64-bit kernels. Now this is
reversed: only 64-bit architectures set __ARCH_WANT_SYS_TIME/UTIME, while
we need __ARCH_WANT_SYS_TIME32/UTIME32 for 32-bit architectures and compat
mode. The resulting asm/unistd.h changes look a bit counterintuitive.

This is only a cleanup patch and it should not change any behavior.

Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
Acked-by: Heiko Carstens <[email protected]>
  • Loading branch information
arndb committed Feb 6, 2019
1 parent c70a772 commit d33c577
Show file tree
Hide file tree
Showing 22 changed files with 98 additions and 77 deletions.
4 changes: 2 additions & 2 deletions arch/arm/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_OLD_MMAP
#define __ARCH_WANT_SYS_OLD_SELECT
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_UTIME32

#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_TIME32
#define __ARCH_WANT_SYS_IPC
#define __ARCH_WANT_SYS_OLDUMOUNT
#define __ARCH_WANT_SYS_ALARM
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/tools/syscall.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
10 common unlink sys_unlink
11 common execve sys_execve
12 common chdir sys_chdir
13 oabi time sys_time
13 oabi time sys_time32
14 common mknod sys_mknod
15 common chmod sys_chmod
16 common lchown sys_lchown16
Expand All @@ -36,12 +36,12 @@
22 oabi umount sys_oldumount
23 common setuid sys_setuid16
24 common getuid sys_getuid16
25 oabi stime sys_stime
25 oabi stime sys_stime32
26 common ptrace sys_ptrace
27 oabi alarm sys_alarm
# 28 was sys_fstat
29 common pause sys_pause
30 oabi utime sys_utime
30 oabi utime sys_utime32
# 31 was sys_stty
# 32 was sys_gtty
33 common access sys_access
Expand Down Expand Up @@ -283,7 +283,7 @@
266 common statfs64 sys_statfs64_wrapper
267 common fstatfs64 sys_fstatfs64_wrapper
268 common tgkill sys_tgkill
269 common utimes sys_utimes
269 common utimes sys_utimes_time32
270 common arm_fadvise64_64 sys_arm_fadvise64_64
271 common pciconfig_iobase sys_pciconfig_iobase
272 common pciconfig_read sys_pciconfig_read
Expand Down Expand Up @@ -340,7 +340,7 @@
323 common mkdirat sys_mkdirat
324 common mknodat sys_mknodat
325 common fchownat sys_fchownat
326 common futimesat sys_futimesat
326 common futimesat sys_futimesat_time32
327 common fstatat64 sys_fstatat64 sys_oabi_fstatat64
328 common unlinkat sys_unlinkat
329 common renameat sys_renameat
Expand Down
4 changes: 2 additions & 2 deletions arch/m68k/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#define __ARCH_WANT_SYS_IPC
#define __ARCH_WANT_SYS_PAUSE
#define __ARCH_WANT_SYS_SIGNAL
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_TIME32
#define __ARCH_WANT_SYS_UTIME32
#define __ARCH_WANT_SYS_WAITPID
#define __ARCH_WANT_SYS_SOCKETCALL
#define __ARCH_WANT_SYS_FADVISE64
Expand Down
10 changes: 5 additions & 5 deletions arch/m68k/kernel/syscalls/syscall.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
10 common unlink sys_unlink
11 common execve sys_execve
12 common chdir sys_chdir
13 common time sys_time
13 common time sys_time32
14 common mknod sys_mknod
15 common chmod sys_chmod
16 common chown sys_chown16
Expand All @@ -32,12 +32,12 @@
22 common umount sys_oldumount
23 common setuid sys_setuid16
24 common getuid sys_getuid16
25 common stime sys_stime
25 common stime sys_stime32
26 common ptrace sys_ptrace
27 common alarm sys_alarm
28 common oldfstat sys_fstat
29 common pause sys_pause
30 common utime sys_utime
30 common utime sys_utime32
# 31 was stty
# 32 was gtty
33 common access sys_access
Expand Down Expand Up @@ -273,7 +273,7 @@
263 common statfs64 sys_statfs64
264 common fstatfs64 sys_fstatfs64
265 common tgkill sys_tgkill
266 common utimes sys_utimes
266 common utimes sys_utimes_time32
267 common fadvise64_64 sys_fadvise64_64
268 common mbind sys_mbind
269 common get_mempolicy sys_get_mempolicy
Expand All @@ -299,7 +299,7 @@
289 common mkdirat sys_mkdirat
290 common mknodat sys_mknodat
291 common fchownat sys_fchownat
292 common futimesat sys_futimesat
292 common futimesat sys_futimesat_time32
293 common fstatat64 sys_fstatat64
294 common unlinkat sys_unlinkat
295 common renameat sys_renameat
Expand Down
4 changes: 2 additions & 2 deletions arch/microblaze/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#define __ARCH_WANT_SYS_GETHOSTNAME
#define __ARCH_WANT_SYS_PAUSE
#define __ARCH_WANT_SYS_SIGNAL
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_TIME32
#define __ARCH_WANT_SYS_UTIME32
#define __ARCH_WANT_SYS_WAITPID
#define __ARCH_WANT_SYS_SOCKETCALL
#define __ARCH_WANT_SYS_FADVISE64
Expand Down
10 changes: 5 additions & 5 deletions arch/microblaze/kernel/syscalls/syscall.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
10 common unlink sys_unlink
11 common execve sys_execve
12 common chdir sys_chdir
13 common time sys_time
13 common time sys_time32
14 common mknod sys_mknod
15 common chmod sys_chmod
16 common lchown sys_lchown
Expand All @@ -32,12 +32,12 @@
22 common umount sys_oldumount
23 common setuid sys_setuid
24 common getuid sys_getuid
25 common stime sys_stime
25 common stime sys_stime32
26 common ptrace sys_ptrace
27 common alarm sys_alarm
28 common oldfstat sys_ni_syscall
29 common pause sys_pause
30 common utime sys_utime
30 common utime sys_utime32
31 common stty sys_ni_syscall
32 common gtty sys_ni_syscall
33 common access sys_access
Expand Down Expand Up @@ -278,7 +278,7 @@
268 common statfs64 sys_statfs64
269 common fstatfs64 sys_fstatfs64
270 common tgkill sys_tgkill
271 common utimes sys_utimes
271 common utimes sys_utimes_time32
272 common fadvise64_64 sys_fadvise64_64
273 common vserver sys_ni_syscall
274 common mbind sys_mbind
Expand Down Expand Up @@ -306,7 +306,7 @@
296 common mkdirat sys_mkdirat
297 common mknodat sys_mknodat
298 common fchownat sys_fchownat
299 common futimesat sys_futimesat
299 common futimesat sys_futimesat_time32
300 common fstatat64 sys_fstatat64
301 common unlinkat sys_unlinkat
302 common renameat sys_renameat
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
#define __ARCH_WANT_SYS_SIGPROCMASK
# ifdef CONFIG_32BIT
# define __ARCH_WANT_STAT64
# define __ARCH_WANT_SYS_TIME
# define __ARCH_WANT_SYS_TIME32
# endif
# ifdef CONFIG_MIPS32_O32
# define __ARCH_WANT_COMPAT_SYS_TIME
# define __ARCH_WANT_SYS_TIME32
# endif
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_CLONE
Expand Down
10 changes: 5 additions & 5 deletions arch/mips/kernel/syscalls/syscall_o32.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
10 o32 unlink sys_unlink
11 o32 execve sys_execve compat_sys_execve
12 o32 chdir sys_chdir
13 o32 time sys_time sys_time32
13 o32 time sys_time32
14 o32 mknod sys_mknod
15 o32 chmod sys_chmod
16 o32 lchown sys_lchown
Expand All @@ -33,13 +33,13 @@
22 o32 umount sys_oldumount
23 o32 setuid sys_setuid
24 o32 getuid sys_getuid
25 o32 stime sys_stime sys_stime32
25 o32 stime sys_stime32
26 o32 ptrace sys_ptrace compat_sys_ptrace
27 o32 alarm sys_alarm
# 28 was sys_fstat
28 o32 unused28 sys_ni_syscall
29 o32 pause sys_pause
30 o32 utime sys_utime sys_utime32
30 o32 utime sys_utime32
31 o32 stty sys_ni_syscall
32 o32 gtty sys_ni_syscall
33 o32 access sys_access
Expand Down Expand Up @@ -278,7 +278,7 @@
264 o32 clock_getres sys_clock_getres_time32
265 o32 clock_nanosleep sys_clock_nanosleep_time32
266 o32 tgkill sys_tgkill
267 o32 utimes sys_utimes sys_utimes_time32
267 o32 utimes sys_utimes_time32
268 o32 mbind sys_mbind compat_sys_mbind
269 o32 get_mempolicy sys_get_mempolicy compat_sys_get_mempolicy
270 o32 set_mempolicy sys_set_mempolicy compat_sys_set_mempolicy
Expand All @@ -303,7 +303,7 @@
289 o32 mkdirat sys_mkdirat
290 o32 mknodat sys_mknodat
291 o32 fchownat sys_fchownat
292 o32 futimesat sys_futimesat sys_futimesat_time32
292 o32 futimesat sys_futimesat_time32
293 o32 fstatat64 sys_fstatat64 sys_newfstatat
294 o32 unlinkat sys_unlinkat
295 o32 renameat sys_renameat
Expand Down
9 changes: 6 additions & 3 deletions arch/parisc/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __ARCH_WANT_SYS_GETHOSTNAME
#define __ARCH_WANT_SYS_PAUSE
#define __ARCH_WANT_SYS_SIGNAL
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_COMPAT_SYS_TIME
#define __ARCH_WANT_SYS_TIME32
#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_UTIME32
#define __ARCH_WANT_SYS_WAITPID
#define __ARCH_WANT_SYS_SOCKETCALL
Expand All @@ -170,6 +168,11 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_COMPAT_SYS_SENDFILE

#ifdef CONFIG_64BIT
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_UTIME
#endif

#endif /* __ASSEMBLY__ */

#undef STR
Expand Down
15 changes: 10 additions & 5 deletions arch/parisc/kernel/syscalls/syscall.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
10 common unlink sys_unlink
11 common execve sys_execve compat_sys_execve
12 common chdir sys_chdir
13 common time sys_time sys_time32
13 32 time sys_time32
13 64 time sys_time
14 common mknod sys_mknod
15 common chmod sys_chmod
16 common lchown sys_lchown
Expand All @@ -32,12 +33,14 @@
22 common bind sys_bind
23 common setuid sys_setuid
24 common getuid sys_getuid
25 common stime sys_stime sys_stime32
25 32 stime sys_stime32
25 64 stime sys_stime
26 common ptrace sys_ptrace compat_sys_ptrace
27 common alarm sys_alarm
28 common fstat sys_newfstat compat_sys_newfstat
29 common pause sys_pause
30 common utime sys_utime sys_utime32
30 32 utime sys_utime32
30 64 utime sys_utime
31 common connect sys_connect
32 common listen sys_listen
33 common access sys_access
Expand Down Expand Up @@ -310,7 +313,8 @@
276 common mkdirat sys_mkdirat
277 common mknodat sys_mknodat
278 common fchownat sys_fchownat
279 common futimesat sys_futimesat sys_futimesat_time32
279 32 futimesat sys_futimesat_time32
279 64 futimesat sys_futimesat
280 common fstatat64 sys_fstatat64
281 common unlinkat sys_unlinkat
282 common renameat sys_renameat
Expand Down Expand Up @@ -374,7 +378,8 @@
333 common finit_module sys_finit_module
334 common sched_setattr sys_sched_setattr
335 common sched_getattr sys_sched_getattr
336 common utimes sys_utimes sys_utimes_time32
336 32 utimes sys_utimes_time32
336 64 utimes sys_utimes
337 common renameat2 sys_renameat2
338 common seccomp sys_seccomp
339 common getrandom sys_getrandom
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#define __ARCH_WANT_SYS_IPC
#define __ARCH_WANT_SYS_PAUSE
#define __ARCH_WANT_SYS_SIGNAL
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_TIME32
#define __ARCH_WANT_SYS_UTIME32
#define __ARCH_WANT_SYS_WAITPID
#define __ARCH_WANT_SYS_SOCKETCALL
#define __ARCH_WANT_SYS_FADVISE64
Expand All @@ -45,8 +45,8 @@
#define __ARCH_WANT_OLD_STAT
#endif
#ifdef CONFIG_PPC64
#define __ARCH_WANT_COMPAT_SYS_TIME
#define __ARCH_WANT_SYS_UTIME32
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_NEWFSTATAT
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
#endif
Expand Down
19 changes: 14 additions & 5 deletions arch/powerpc/kernel/syscalls/syscall.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
10 common unlink sys_unlink
11 nospu execve sys_execve compat_sys_execve
12 common chdir sys_chdir
13 common time sys_time sys_time32
13 32 time sys_time32
13 64 time sys_time
13 spu time sys_time
14 common mknod sys_mknod
15 common chmod sys_chmod
16 common lchown sys_lchown
Expand All @@ -36,14 +38,17 @@
22 spu umount sys_ni_syscall
23 common setuid sys_setuid
24 common getuid sys_getuid
25 common stime sys_stime sys_stime32
25 32 stime sys_stime32
25 64 stime sys_stime
25 spu stime sys_stime
26 nospu ptrace sys_ptrace compat_sys_ptrace
27 common alarm sys_alarm
28 32 oldfstat sys_fstat sys_ni_syscall
28 64 oldfstat sys_ni_syscall
28 spu oldfstat sys_ni_syscall
29 nospu pause sys_pause
30 nospu utime sys_utime sys_utime32
30 32 utime sys_utime32
30 64 utime sys_utime
31 common stty sys_ni_syscall
32 common gtty sys_ni_syscall
33 common access sys_access
Expand Down Expand Up @@ -315,7 +320,9 @@
249 64 swapcontext ppc64_swapcontext
249 spu swapcontext sys_ni_syscall
250 common tgkill sys_tgkill
251 common utimes sys_utimes sys_utimes_time32
251 32 utimes sys_utimes_time32
251 64 utimes sys_utimes
251 spu utimes sys_utimes
252 common statfs64 sys_statfs64 compat_sys_statfs64
253 common fstatfs64 sys_fstatfs64 compat_sys_fstatfs64
254 32 fadvise64_64 ppc_fadvise64_64
Expand Down Expand Up @@ -361,7 +368,9 @@
287 common mkdirat sys_mkdirat
288 common mknodat sys_mknodat
289 common fchownat sys_fchownat
290 common futimesat sys_futimesat sys_futimesat_time32
290 32 futimesat sys_futimesat_time32
290 64 futimesat sys_futimesat
290 spu utimesat sys_futimesat
291 32 fstatat64 sys_fstatat64
291 64 newfstatat sys_newfstatat
291 spu newfstatat sys_newfstatat
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define __ARCH_WANT_SYS_SIGPENDING
#define __ARCH_WANT_SYS_SIGPROCMASK
# ifdef CONFIG_COMPAT
# define __ARCH_WANT_COMPAT_SYS_TIME
# define __ARCH_WANT_SYS_TIME32
# define __ARCH_WANT_SYS_UTIME32
# endif
#define __ARCH_WANT_SYS_FORK
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# define __ARCH_WANT_SYS_IPC
# define __ARCH_WANT_SYS_PAUSE
# define __ARCH_WANT_SYS_SIGNAL
# define __ARCH_WANT_SYS_TIME
# define __ARCH_WANT_SYS_UTIME
# define __ARCH_WANT_SYS_TIME32
# define __ARCH_WANT_SYS_UTIME32
# define __ARCH_WANT_SYS_WAITPID
# define __ARCH_WANT_SYS_SOCKETCALL
# define __ARCH_WANT_SYS_FADVISE64
Expand Down
Loading

0 comments on commit d33c577

Please sign in to comment.