Skip to content

Commit d33c577

Browse files
committed
y2038: rename old time and utime syscalls
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 <arnd@arndb.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
1 parent c70a772 commit d33c577

File tree

22 files changed

+98
-77
lines changed

22 files changed

+98
-77
lines changed

arch/arm/include/asm/unistd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
#define __ARCH_WANT_SYS_SIGPROCMASK
2727
#define __ARCH_WANT_SYS_OLD_MMAP
2828
#define __ARCH_WANT_SYS_OLD_SELECT
29-
#define __ARCH_WANT_SYS_UTIME
29+
#define __ARCH_WANT_SYS_UTIME32
3030

3131
#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
32-
#define __ARCH_WANT_SYS_TIME
32+
#define __ARCH_WANT_SYS_TIME32
3333
#define __ARCH_WANT_SYS_IPC
3434
#define __ARCH_WANT_SYS_OLDUMOUNT
3535
#define __ARCH_WANT_SYS_ALARM

arch/arm/tools/syscall.tbl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
10 common unlink sys_unlink
2525
11 common execve sys_execve
2626
12 common chdir sys_chdir
27-
13 oabi time sys_time
27+
13 oabi time sys_time32
2828
14 common mknod sys_mknod
2929
15 common chmod sys_chmod
3030
16 common lchown sys_lchown16
@@ -36,12 +36,12 @@
3636
22 oabi umount sys_oldumount
3737
23 common setuid sys_setuid16
3838
24 common getuid sys_getuid16
39-
25 oabi stime sys_stime
39+
25 oabi stime sys_stime32
4040
26 common ptrace sys_ptrace
4141
27 oabi alarm sys_alarm
4242
# 28 was sys_fstat
4343
29 common pause sys_pause
44-
30 oabi utime sys_utime
44+
30 oabi utime sys_utime32
4545
# 31 was sys_stty
4646
# 32 was sys_gtty
4747
33 common access sys_access
@@ -283,7 +283,7 @@
283283
266 common statfs64 sys_statfs64_wrapper
284284
267 common fstatfs64 sys_fstatfs64_wrapper
285285
268 common tgkill sys_tgkill
286-
269 common utimes sys_utimes
286+
269 common utimes sys_utimes_time32
287287
270 common arm_fadvise64_64 sys_arm_fadvise64_64
288288
271 common pciconfig_iobase sys_pciconfig_iobase
289289
272 common pciconfig_read sys_pciconfig_read
@@ -340,7 +340,7 @@
340340
323 common mkdirat sys_mkdirat
341341
324 common mknodat sys_mknodat
342342
325 common fchownat sys_fchownat
343-
326 common futimesat sys_futimesat
343+
326 common futimesat sys_futimesat_time32
344344
327 common fstatat64 sys_fstatat64 sys_oabi_fstatat64
345345
328 common unlinkat sys_unlinkat
346346
329 common renameat sys_renameat

arch/m68k/include/asm/unistd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#define __ARCH_WANT_SYS_IPC
1616
#define __ARCH_WANT_SYS_PAUSE
1717
#define __ARCH_WANT_SYS_SIGNAL
18-
#define __ARCH_WANT_SYS_TIME
19-
#define __ARCH_WANT_SYS_UTIME
18+
#define __ARCH_WANT_SYS_TIME32
19+
#define __ARCH_WANT_SYS_UTIME32
2020
#define __ARCH_WANT_SYS_WAITPID
2121
#define __ARCH_WANT_SYS_SOCKETCALL
2222
#define __ARCH_WANT_SYS_FADVISE64

arch/m68k/kernel/syscalls/syscall.tbl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
10 common unlink sys_unlink
2121
11 common execve sys_execve
2222
12 common chdir sys_chdir
23-
13 common time sys_time
23+
13 common time sys_time32
2424
14 common mknod sys_mknod
2525
15 common chmod sys_chmod
2626
16 common chown sys_chown16
@@ -32,12 +32,12 @@
3232
22 common umount sys_oldumount
3333
23 common setuid sys_setuid16
3434
24 common getuid sys_getuid16
35-
25 common stime sys_stime
35+
25 common stime sys_stime32
3636
26 common ptrace sys_ptrace
3737
27 common alarm sys_alarm
3838
28 common oldfstat sys_fstat
3939
29 common pause sys_pause
40-
30 common utime sys_utime
40+
30 common utime sys_utime32
4141
# 31 was stty
4242
# 32 was gtty
4343
33 common access sys_access
@@ -273,7 +273,7 @@
273273
263 common statfs64 sys_statfs64
274274
264 common fstatfs64 sys_fstatfs64
275275
265 common tgkill sys_tgkill
276-
266 common utimes sys_utimes
276+
266 common utimes sys_utimes_time32
277277
267 common fadvise64_64 sys_fadvise64_64
278278
268 common mbind sys_mbind
279279
269 common get_mempolicy sys_get_mempolicy
@@ -299,7 +299,7 @@
299299
289 common mkdirat sys_mkdirat
300300
290 common mknodat sys_mknodat
301301
291 common fchownat sys_fchownat
302-
292 common futimesat sys_futimesat
302+
292 common futimesat sys_futimesat_time32
303303
293 common fstatat64 sys_fstatat64
304304
294 common unlinkat sys_unlinkat
305305
295 common renameat sys_renameat

arch/microblaze/include/asm/unistd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#define __ARCH_WANT_SYS_GETHOSTNAME
2222
#define __ARCH_WANT_SYS_PAUSE
2323
#define __ARCH_WANT_SYS_SIGNAL
24-
#define __ARCH_WANT_SYS_TIME
25-
#define __ARCH_WANT_SYS_UTIME
24+
#define __ARCH_WANT_SYS_TIME32
25+
#define __ARCH_WANT_SYS_UTIME32
2626
#define __ARCH_WANT_SYS_WAITPID
2727
#define __ARCH_WANT_SYS_SOCKETCALL
2828
#define __ARCH_WANT_SYS_FADVISE64

arch/microblaze/kernel/syscalls/syscall.tbl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
10 common unlink sys_unlink
2121
11 common execve sys_execve
2222
12 common chdir sys_chdir
23-
13 common time sys_time
23+
13 common time sys_time32
2424
14 common mknod sys_mknod
2525
15 common chmod sys_chmod
2626
16 common lchown sys_lchown
@@ -32,12 +32,12 @@
3232
22 common umount sys_oldumount
3333
23 common setuid sys_setuid
3434
24 common getuid sys_getuid
35-
25 common stime sys_stime
35+
25 common stime sys_stime32
3636
26 common ptrace sys_ptrace
3737
27 common alarm sys_alarm
3838
28 common oldfstat sys_ni_syscall
3939
29 common pause sys_pause
40-
30 common utime sys_utime
40+
30 common utime sys_utime32
4141
31 common stty sys_ni_syscall
4242
32 common gtty sys_ni_syscall
4343
33 common access sys_access
@@ -278,7 +278,7 @@
278278
268 common statfs64 sys_statfs64
279279
269 common fstatfs64 sys_fstatfs64
280280
270 common tgkill sys_tgkill
281-
271 common utimes sys_utimes
281+
271 common utimes sys_utimes_time32
282282
272 common fadvise64_64 sys_fadvise64_64
283283
273 common vserver sys_ni_syscall
284284
274 common mbind sys_mbind
@@ -306,7 +306,7 @@
306306
296 common mkdirat sys_mkdirat
307307
297 common mknodat sys_mknodat
308308
298 common fchownat sys_fchownat
309-
299 common futimesat sys_futimesat
309+
299 common futimesat sys_futimesat_time32
310310
300 common fstatat64 sys_fstatat64
311311
301 common unlinkat sys_unlinkat
312312
302 common renameat sys_renameat

arch/mips/include/asm/unistd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
#define __ARCH_WANT_SYS_SIGPROCMASK
4646
# ifdef CONFIG_32BIT
4747
# define __ARCH_WANT_STAT64
48-
# define __ARCH_WANT_SYS_TIME
48+
# define __ARCH_WANT_SYS_TIME32
4949
# endif
5050
# ifdef CONFIG_MIPS32_O32
51-
# define __ARCH_WANT_COMPAT_SYS_TIME
51+
# define __ARCH_WANT_SYS_TIME32
5252
# endif
5353
#define __ARCH_WANT_SYS_FORK
5454
#define __ARCH_WANT_SYS_CLONE

arch/mips/kernel/syscalls/syscall_o32.tbl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
10 o32 unlink sys_unlink
2121
11 o32 execve sys_execve compat_sys_execve
2222
12 o32 chdir sys_chdir
23-
13 o32 time sys_time sys_time32
23+
13 o32 time sys_time32
2424
14 o32 mknod sys_mknod
2525
15 o32 chmod sys_chmod
2626
16 o32 lchown sys_lchown
@@ -33,13 +33,13 @@
3333
22 o32 umount sys_oldumount
3434
23 o32 setuid sys_setuid
3535
24 o32 getuid sys_getuid
36-
25 o32 stime sys_stime sys_stime32
36+
25 o32 stime sys_stime32
3737
26 o32 ptrace sys_ptrace compat_sys_ptrace
3838
27 o32 alarm sys_alarm
3939
# 28 was sys_fstat
4040
28 o32 unused28 sys_ni_syscall
4141
29 o32 pause sys_pause
42-
30 o32 utime sys_utime sys_utime32
42+
30 o32 utime sys_utime32
4343
31 o32 stty sys_ni_syscall
4444
32 o32 gtty sys_ni_syscall
4545
33 o32 access sys_access
@@ -278,7 +278,7 @@
278278
264 o32 clock_getres sys_clock_getres_time32
279279
265 o32 clock_nanosleep sys_clock_nanosleep_time32
280280
266 o32 tgkill sys_tgkill
281-
267 o32 utimes sys_utimes sys_utimes_time32
281+
267 o32 utimes sys_utimes_time32
282282
268 o32 mbind sys_mbind compat_sys_mbind
283283
269 o32 get_mempolicy sys_get_mempolicy compat_sys_get_mempolicy
284284
270 o32 set_mempolicy sys_set_mempolicy compat_sys_set_mempolicy
@@ -303,7 +303,7 @@
303303
289 o32 mkdirat sys_mkdirat
304304
290 o32 mknodat sys_mknodat
305305
291 o32 fchownat sys_fchownat
306-
292 o32 futimesat sys_futimesat sys_futimesat_time32
306+
292 o32 futimesat sys_futimesat_time32
307307
293 o32 fstatat64 sys_fstatat64 sys_newfstatat
308308
294 o32 unlinkat sys_unlinkat
309309
295 o32 renameat sys_renameat

arch/parisc/include/asm/unistd.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
152152
#define __ARCH_WANT_SYS_GETHOSTNAME
153153
#define __ARCH_WANT_SYS_PAUSE
154154
#define __ARCH_WANT_SYS_SIGNAL
155-
#define __ARCH_WANT_SYS_TIME
156-
#define __ARCH_WANT_COMPAT_SYS_TIME
155+
#define __ARCH_WANT_SYS_TIME32
157156
#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
158-
#define __ARCH_WANT_SYS_UTIME
159157
#define __ARCH_WANT_SYS_UTIME32
160158
#define __ARCH_WANT_SYS_WAITPID
161159
#define __ARCH_WANT_SYS_SOCKETCALL
@@ -170,6 +168,11 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
170168
#define __ARCH_WANT_SYS_CLONE
171169
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
172170

171+
#ifdef CONFIG_64BIT
172+
#define __ARCH_WANT_SYS_TIME
173+
#define __ARCH_WANT_SYS_UTIME
174+
#endif
175+
173176
#endif /* __ASSEMBLY__ */
174177

175178
#undef STR

arch/parisc/kernel/syscalls/syscall.tbl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
10 common unlink sys_unlink
2121
11 common execve sys_execve compat_sys_execve
2222
12 common chdir sys_chdir
23-
13 common time sys_time sys_time32
23+
13 32 time sys_time32
24+
13 64 time sys_time
2425
14 common mknod sys_mknod
2526
15 common chmod sys_chmod
2627
16 common lchown sys_lchown
@@ -32,12 +33,14 @@
3233
22 common bind sys_bind
3334
23 common setuid sys_setuid
3435
24 common getuid sys_getuid
35-
25 common stime sys_stime sys_stime32
36+
25 32 stime sys_stime32
37+
25 64 stime sys_stime
3638
26 common ptrace sys_ptrace compat_sys_ptrace
3739
27 common alarm sys_alarm
3840
28 common fstat sys_newfstat compat_sys_newfstat
3941
29 common pause sys_pause
40-
30 common utime sys_utime sys_utime32
42+
30 32 utime sys_utime32
43+
30 64 utime sys_utime
4144
31 common connect sys_connect
4245
32 common listen sys_listen
4346
33 common access sys_access
@@ -310,7 +313,8 @@
310313
276 common mkdirat sys_mkdirat
311314
277 common mknodat sys_mknodat
312315
278 common fchownat sys_fchownat
313-
279 common futimesat sys_futimesat sys_futimesat_time32
316+
279 32 futimesat sys_futimesat_time32
317+
279 64 futimesat sys_futimesat
314318
280 common fstatat64 sys_fstatat64
315319
281 common unlinkat sys_unlinkat
316320
282 common renameat sys_renameat
@@ -374,7 +378,8 @@
374378
333 common finit_module sys_finit_module
375379
334 common sched_setattr sys_sched_setattr
376380
335 common sched_getattr sys_sched_getattr
377-
336 common utimes sys_utimes sys_utimes_time32
381+
336 32 utimes sys_utimes_time32
382+
336 64 utimes sys_utimes
378383
337 common renameat2 sys_renameat2
379384
338 common seccomp sys_seccomp
380385
339 common getrandom sys_getrandom

arch/powerpc/include/asm/unistd.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#define __ARCH_WANT_SYS_IPC
3030
#define __ARCH_WANT_SYS_PAUSE
3131
#define __ARCH_WANT_SYS_SIGNAL
32-
#define __ARCH_WANT_SYS_TIME
33-
#define __ARCH_WANT_SYS_UTIME
32+
#define __ARCH_WANT_SYS_TIME32
33+
#define __ARCH_WANT_SYS_UTIME32
3434
#define __ARCH_WANT_SYS_WAITPID
3535
#define __ARCH_WANT_SYS_SOCKETCALL
3636
#define __ARCH_WANT_SYS_FADVISE64
@@ -45,8 +45,8 @@
4545
#define __ARCH_WANT_OLD_STAT
4646
#endif
4747
#ifdef CONFIG_PPC64
48-
#define __ARCH_WANT_COMPAT_SYS_TIME
49-
#define __ARCH_WANT_SYS_UTIME32
48+
#define __ARCH_WANT_SYS_TIME
49+
#define __ARCH_WANT_SYS_UTIME
5050
#define __ARCH_WANT_SYS_NEWFSTATAT
5151
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
5252
#endif

arch/powerpc/kernel/syscalls/syscall.tbl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
10 common unlink sys_unlink
2121
11 nospu execve sys_execve compat_sys_execve
2222
12 common chdir sys_chdir
23-
13 common time sys_time sys_time32
23+
13 32 time sys_time32
24+
13 64 time sys_time
25+
13 spu time sys_time
2426
14 common mknod sys_mknod
2527
15 common chmod sys_chmod
2628
16 common lchown sys_lchown
@@ -36,14 +38,17 @@
3638
22 spu umount sys_ni_syscall
3739
23 common setuid sys_setuid
3840
24 common getuid sys_getuid
39-
25 common stime sys_stime sys_stime32
41+
25 32 stime sys_stime32
42+
25 64 stime sys_stime
43+
25 spu stime sys_stime
4044
26 nospu ptrace sys_ptrace compat_sys_ptrace
4145
27 common alarm sys_alarm
4246
28 32 oldfstat sys_fstat sys_ni_syscall
4347
28 64 oldfstat sys_ni_syscall
4448
28 spu oldfstat sys_ni_syscall
4549
29 nospu pause sys_pause
46-
30 nospu utime sys_utime sys_utime32
50+
30 32 utime sys_utime32
51+
30 64 utime sys_utime
4752
31 common stty sys_ni_syscall
4853
32 common gtty sys_ni_syscall
4954
33 common access sys_access
@@ -315,7 +320,9 @@
315320
249 64 swapcontext ppc64_swapcontext
316321
249 spu swapcontext sys_ni_syscall
317322
250 common tgkill sys_tgkill
318-
251 common utimes sys_utimes sys_utimes_time32
323+
251 32 utimes sys_utimes_time32
324+
251 64 utimes sys_utimes
325+
251 spu utimes sys_utimes
319326
252 common statfs64 sys_statfs64 compat_sys_statfs64
320327
253 common fstatfs64 sys_fstatfs64 compat_sys_fstatfs64
321328
254 32 fadvise64_64 ppc_fadvise64_64
@@ -361,7 +368,9 @@
361368
287 common mkdirat sys_mkdirat
362369
288 common mknodat sys_mknodat
363370
289 common fchownat sys_fchownat
364-
290 common futimesat sys_futimesat sys_futimesat_time32
371+
290 32 futimesat sys_futimesat_time32
372+
290 64 futimesat sys_futimesat
373+
290 spu utimesat sys_futimesat
365374
291 32 fstatat64 sys_fstatat64
366375
291 64 newfstatat sys_newfstatat
367376
291 spu newfstatat sys_newfstatat

arch/s390/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define __ARCH_WANT_SYS_SIGPENDING
2929
#define __ARCH_WANT_SYS_SIGPROCMASK
3030
# ifdef CONFIG_COMPAT
31-
# define __ARCH_WANT_COMPAT_SYS_TIME
31+
# define __ARCH_WANT_SYS_TIME32
3232
# define __ARCH_WANT_SYS_UTIME32
3333
# endif
3434
#define __ARCH_WANT_SYS_FORK

arch/sh/include/asm/unistd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# define __ARCH_WANT_SYS_IPC
1717
# define __ARCH_WANT_SYS_PAUSE
1818
# define __ARCH_WANT_SYS_SIGNAL
19-
# define __ARCH_WANT_SYS_TIME
20-
# define __ARCH_WANT_SYS_UTIME
19+
# define __ARCH_WANT_SYS_TIME32
20+
# define __ARCH_WANT_SYS_UTIME32
2121
# define __ARCH_WANT_SYS_WAITPID
2222
# define __ARCH_WANT_SYS_SOCKETCALL
2323
# define __ARCH_WANT_SYS_FADVISE64

0 commit comments

Comments
 (0)