y2038: add time64 syscalls
Subsystems (26)
Arnd Bergmann
maintainerv2 cover y2038: add time64 syscalls
This is a minor update of the patches I posted last week, I would like to add this into linux-next now, but would still do changes if there are concerns about the contents. The first version did not see a lot of replies, which could mean that either everyone is happy with it, or that it was largely ignored.
See also the article at https://lwn.net/Articles/776435/.
Changes since v1:
- posting as a combined series for simplicity
- dropped one mips patch that was merged as a 5.0 fix
- reworked s390 compat syscall handling (posted separately) and rebased on top of that series
- minor fixes for arm64 and powerpc
- added alpha statfs64 interfaces
- added alpha get{eg,eu,g,p,u,pp}id()
Arnd
----
v1 description for cleanup:
The system call tables have diverged a bit over the years, and a number of the recent additions never made it into all architectures, for one reason or another.
This is an attempt to clean it up as far as we can without breaking compatibility, doing a number of steps:
- Add system calls that have not yet been integrated into all architectures but that we definitely want there.
- Add the separate ipc syscalls on all architectures that traditionally only had sys_ipc(). This version is done without support for IPC_OLD that is we have in sys_ipc. The new semtimedop_time64 syscall will only be added here, not in sys_ipc
- Add syscall numbers for a couple of syscalls that we probably don't need everywhere, in particular pkey_* and rseq, for the purpose of symmetry: if it's in asm-generic/unistd.h, it makes sense to have it everywhere.
- Prepare for having the same system call numbers for any future calls. In combination with the generated tables, this hopefully makes it easier to add new calls across all architectures together.
Most of the contents of this series are unrelated to the actual y2038 work, but for the moment, that second series is based on this one. If there are any concerns about changes here, I can drop or rewrite any individual patch in this series.
My plan is to merge any patches in this series that are found to be good together with the y2038 patches for linux-5.1, so please review and provide Acks for merging through my tree, or pick them up for 5.0 if they seem urgent enough.
v1 description for y2038 patches:
This series finally gets us to the point of having system calls with 64-bit time_t on all architectures, after a long time of incremental preparation patches.
There was actually one conversion that I missed during the summer, i.e. Deepa's timex series, which I now updated based the 5.0-rc1 changes and review comments.
I hope that the actual conversion should be uncontroversial by now, even if some of the patches are rather large.
The one area that may need a little discussion is for the system call numbers assigned in the final patch: Can we get consensus on whether the idea of using the same numbers on all architectures, as well as my choice of numbers makes sense here?
So far, I have done a lot of build testing across most architectures, which has found a number of bugs. I have also done an LTP run on arm32 with existing user space, but not on the other architectures. I did LTP tests with a modified musl libc[2] last summer on an older version of this series to make sure that the new 64-bit time_t interfaces work. The version there will need updates for testing with this new kernel patch series; I plan to do that next.
For testing, the series plus the preparatory patches is available at [3]. Once there is a general agreement on this series and I have done more tests for the new system calls, I plan to add this to linux-next through my asm-generic tree or Thomas' timers tree.
Please review and test!
Arnd
[1] https://lore.kernel.org/lkml/[email protected]/T/
[2] https://git.linaro.org/people/arnd/musl-y2038.git/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git y2038-5.0-rc1
Arnd Bergmann (26):
ia64: add __NR_umount2 definition
ia64: add statx and io_pgetevents syscalls
ia64: assign syscall numbers for perf and seccomp
alpha: wire up io_pgetevents system call
alpha: update syscall macro definitions
ARM: add migrate_pages() system call
ARM: add kexec_file_load system call number
m68k: assign syscall number for seccomp
sh: remove duplicate unistd_32.h file
sh: add statx system call
sparc64: fix sparc_ipc type conversion
ipc: rename old-style shmctl/semctl/msgctl syscalls
arch: add split IPC system calls where needed
arch: add pkey and rseq syscall numbers everywhere
alpha: add standard statfs64/fstatfs64 syscalls
alpha: add generic get{eg,eu,g,p,u,pp}id() syscalls
syscalls: remove obsolete __IGNORE_ macros
time: make adjtime compat handling available for 32 bit
time: fix sys_timer_settime prototype
sparc64: add custom adjtimex/clock_adjtime functions x86/x32: use time64 versions of sigtimedwait and recvmmsg
y2038: syscalls: rename y2038 compat syscalls
y2038: use time32 syscall names on 32-bit
y2038: remove struct definition redirects
y2038: rename old time and utime syscalls
y2038: add 64-bit time_t syscalls to all 32-bit architectures
Deepa Dinamani (3):
time: Add struct __kernel_timex
timex: use __kernel_timex internally
timex: change syscalls to use struct __kernel_timex
arch/Kconfig | 2 +- arch/alpha/include/asm/unistd.h | 21 - arch/alpha/include/uapi/asm/unistd.h | 10 + arch/alpha/kernel/osf_sys.c | 5 +- arch/alpha/kernel/syscalls/syscall.tbl | 22 +- arch/arm/include/asm/unistd.h | 5 +- arch/arm/kernel/sys_oabi-compat.c | 8 +- arch/arm/tools/syscall.tbl | 85 +++-- arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 99 +++-- arch/ia64/include/asm/unistd.h | 14 - arch/ia64/include/uapi/asm/unistd.h | 2 + arch/ia64/kernel/syscalls/syscall.tbl | 11 +- arch/m68k/include/asm/unistd.h | 4 +- arch/m68k/kernel/syscalls/syscall.tbl | 88 +++-- arch/microblaze/include/asm/unistd.h | 4 +- arch/microblaze/kernel/syscalls/syscall.tbl | 83 ++-- arch/mips/include/asm/unistd.h | 20 +- arch/mips/kernel/syscalls/syscall_n32.tbl | 77 ++-- arch/mips/kernel/syscalls/syscall_n64.tbl | 7 +- arch/mips/kernel/syscalls/syscall_o32.tbl | 85 +++-- arch/parisc/include/asm/unistd.h | 15 +- arch/parisc/kernel/syscalls/syscall.tbl | 109 ++++-- arch/powerpc/include/asm/unistd.h | 8 +- arch/powerpc/kernel/syscalls/syscall.tbl | 134 +++++-- arch/s390/include/asm/unistd.h | 7 +- arch/s390/kernel/syscalls/syscall.tbl | 87 +++-- arch/sh/include/asm/unistd.h | 4 +- arch/sh/include/uapi/asm/unistd_32.h | 403 -------------------- arch/sh/kernel/syscalls/syscall.tbl | 88 +++-- arch/sparc/include/asm/unistd.h | 13 +- arch/sparc/kernel/sys_sparc_64.c | 61 ++- arch/sparc/kernel/syscalls/syscall.tbl | 116 ++++-- arch/x86/entry/syscalls/syscall_32.tbl | 85 +++-- arch/x86/entry/syscalls/syscall_64.tbl | 4 +- arch/x86/include/asm/unistd.h | 8 +- arch/xtensa/include/asm/unistd.h | 14 +- arch/xtensa/kernel/syscalls/syscall.tbl | 78 ++-- drivers/ptp/ptp_clock.c | 2 +- fs/aio.c | 10 +- fs/select.c | 4 +- fs/timerfd.c | 4 +- fs/utimes.c | 10 +- include/linux/compat.h | 104 +---- include/linux/posix-clock.h | 2 +- include/linux/syscalls.h | 68 +++- include/linux/time32.h | 32 +- include/linux/time64.h | 8 - include/linux/timex.h | 4 +- include/uapi/asm-generic/unistd.h | 103 +++-- include/uapi/linux/time.h | 4 - include/uapi/linux/timex.h | 39 ++ ipc/mqueue.c | 16 +- ipc/msg.c | 39 +- ipc/sem.c | 41 +- ipc/shm.c | 40 +- ipc/syscall.c | 12 +- ipc/util.h | 21 +- kernel/compat.c | 64 ---- kernel/futex.c | 2 +- kernel/sched/core.c | 5 +- kernel/signal.c | 2 +- kernel/sys_ni.c | 21 +- kernel/time/hrtimer.c | 2 +- kernel/time/ntp.c | 18 +- kernel/time/ntp_internal.h | 2 +- kernel/time/posix-clock.c | 2 +- kernel/time/posix-stubs.c | 25 +- kernel/time/posix-timers.c | 72 ++-- kernel/time/posix-timers.h | 2 +- kernel/time/time.c | 92 ++++- kernel/time/timekeeping.c | 4 +- net/compat.c | 2 +- scripts/checksyscalls.sh | 40 ++ 74 files changed, 1544 insertions(+), 1262 deletions(-) delete mode 100644 arch/sh/include/uapi/asm/unistd_32.h
Signature · 43 lines
2.20.0 Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
Arnd Bergmann
maintainerPATCH v2 1/29 ia64: add __NR_umount2 definition
Other architectures commonly use __NR_umount2 for sys_umount, only ia64 and alpha use __NR_umount here. In order to synchronize the generated tables, use umount2 like everyone else, and add back the old name from asm/unistd.h for compatibility.
The __IGNORE_* lines are now all obsolete and can be removed as a side-effect.
--- arch/ia64/include/asm/unistd.h | 14 -------------- arch/ia64/include/uapi/asm/unistd.h | 2 ++ arch/ia64/kernel/syscalls/syscall.tbl | 2 +- 3 files changed, 3 insertions(+), 15 deletions(-)
arch/ia64/include/asm/unistd.h +0 -14
@@ -12,20 +12,6 @@#define NR_syscalls __NR_syscalls/* length of syscall table */ -/* -* The following defines stop scripts/checksyscalls.sh from complaining about -* unimplemented system calls. Glibc provides for each of these by using -* more modern equivalent system calls. -*/ -#define __IGNORE_fork/* clone() */ -#define __IGNORE_time/* gettimeofday() */ -#define __IGNORE_alarm/* setitimer(ITIMER_REAL, ... */ -#define __IGNORE_pause/* rt_sigprocmask(), rt_sigsuspend() */ -#define __IGNORE_utime/* utimes() */ -#define __IGNORE_getpgrp/* getpgid() */ -#define __IGNORE_vfork/* clone() */ -#define __IGNORE_umount2/* umount() */ -#define __ARCH_WANT_NEW_STAT#define __ARCH_WANT_SYS_UTIME
arch/ia64/include/uapi/asm/unistd.h +2 -0
@@ -15,6 +15,8 @@#define __NR_Linux 1024 +#define __NR_umount __NR_umount2 +#include <asm/unistd_64.h> #endif /* _UAPI_ASM_IA64_UNISTD_H */
arch/ia64/kernel/syscalls/syscall.tbl +1 -1
@@ -29,7 +29,7 @@ 17 common getpid sys_getpid 18 common getppid sys_getppid 19 common mount sys_mount -20 common umount sys_umount +20 common umount2 sys_umount 21 common setuid sys_setuid 22 common getuid sys_getuid 23 common geteuid sys_geteuid
Signature · 6 lines
2.20.0 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
Arnd Bergmann
maintainerPATCH v2 2/29 ia64: add statx and io_pgetevents syscalls
In reply to Arnd BergmannAll architectures should implement these two, so assign numbers and hook them up on ia64.
--- arch/ia64/kernel/syscalls/syscall.tbl | 2 ++ 1 file changed, 2 insertions(+)
arch/ia64/kernel/syscalls/syscall.tbl +2 -0
@@ -335,3 +335,5 @@ 323 common copy_file_range sys_copy_file_range 324 common preadv2 sys_preadv2 325 common pwritev2 sys_pwritev2 +326 common statx sys_statx +327 common io_pgetevents sys_io_pgetevents
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 3/29 ia64: assign syscall numbers for perf and seccomp
In reply to Arnd BergmannMost architectures have assigned numbers for both seccomp and perf_event_open, even when they do not implement either.
ia64 is an exception here, so for consistency lets add numbers for both of them. Unless CONFIG_PERF_EVENTS and CONFIG_SECCOMP are implemented, the system calls just return -ENOSYS.
--- arch/ia64/kernel/syscalls/syscall.tbl | 2 ++ 1 file changed, 2 insertions(+)
arch/ia64/kernel/syscalls/syscall.tbl +2 -0
@@ -337,3 +337,5 @@ 325 common pwritev2 sys_pwritev2 326 common statx sys_statx 327 common io_pgetevents sys_io_pgetevents +328 common perf_event_open sys_perf_event_open +329 common seccomp sys_seccomp
Signature · 6 lines
2.20.0 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
Arnd Bergmann
maintainerPATCH v2 4/29 alpha: wire up io_pgetevents system call
In reply to Arnd BergmannThe io_pgetevents system call was added in linux-4.18 but has no entry for alpha:
warning: #warning syscall io_pgetevents not implemented [-Wcpp]
Assign a the next system call number here.
--- arch/alpha/kernel/syscalls/syscall.tbl | 1 + 1 file changed, 1 insertion(+)
arch/alpha/kernel/syscalls/syscall.tbl +1 -0
@@ -451,3 +451,4 @@ 520 common preadv2 sys_preadv2 521 common pwritev2 sys_pwritev2 522 common statx sys_statx +523 common io_pgetevents sys_io_pgetevents
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 5/29 alpha: update syscall macro definitions
In reply to Arnd BergmannOther architectures commonly use __NR_umount2 for sys_umount, only ia64 and alpha use __NR_umount here. In order to synchronize the generated tables, use umount2 like everyone else, and add back the old name from asm/unistd.h for compatibility.
For shmat, alpha uses the osf_shmat name, we can do the same thing here, which means we don't have to add an entry in the __IGNORE list now that shmat is mandatory everywhere
alarm, creat, pause, time, and utime are optional everywhere these days, no need to list them here any more.
I considered also adding the regular versions of the get*id system calls that have different names and calling conventions on alpha, which would further help unify the syscall ABI, but for now I decided against that.
--- arch/alpha/include/asm/unistd.h | 6 ------ arch/alpha/include/uapi/asm/unistd.h | 5 +++++ arch/alpha/kernel/syscalls/syscall.tbl | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-)
arch/alpha/include/asm/unistd.h +0 -6
@@ -22,18 +22,12 @@/* * Ignore legacy syscalls that we don't use. */ -#define __IGNORE_alarm -#define __IGNORE_creat#define __IGNORE_getegid#define __IGNORE_geteuid#define __IGNORE_getgid#define __IGNORE_getpid#define __IGNORE_getppid#define __IGNORE_getuid -#define __IGNORE_pause -#define __IGNORE_time -#define __IGNORE_utime -#define __IGNORE_umount2/* Alpha doesn't have protection keys. */ #define __IGNORE_pkey_mprotect
arch/alpha/include/uapi/asm/unistd.h +5 -0
@@ -2,6 +2,11 @@#ifndef _UAPI_ALPHA_UNISTD_H#define _UAPI_ALPHA_UNISTD_H +/* These are traditionally the names linux-alpha uses for +* the two otherwise generic system calls */ +#define __NR_umount __NR_umount2 +#define __NR_osf_shmat __NR_shmat +#include <asm/unistd_32.h> #endif /* _UAPI_ALPHA_UNISTD_H */
arch/alpha/kernel/syscalls/syscall.tbl +2 -2
@@ -29,7 +29,7 @@ 19 common lseek sys_lseek 20 common getxpid sys_getxpid 21 common osf_mount sys_osf_mount -22 common umount sys_umount +22 common umount2 sys_umount 23 common setuid sys_setuid 24 common getxuid sys_getxuid 25 common exec_with_loader sys_ni_syscall
@@ -183,7 +183,7 @@ 206 common semop sys_semop 207 common osf_utsname sys_osf_utsname 208 common lchown sys_lchown -209 common osf_shmat sys_shmat +209 common shmat sys_shmat 210 common shmctl sys_shmctl 211 common shmdt sys_shmdt 212 common shmget sys_shmget
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 6/29 ARM: add migrate_pages() system call
In reply to Arnd BergmannThe migrate_pages system call has an assigned number on all architectures except ARM. When it got added initially in commit d80ade7b3231 ("ARM:
Fix warning: #warning syscall migrate_pages not implemented"), it was intentionally left out based on the observation that there are no 32-bit ARM NUMA systems.
However, there are now arm64 NUMA machines that can in theory run 32-bit kernels (actually enabling NUMA there would require additional work) as well as 32-bit user space on 64-bit kernels, so that argument is no longer very strong.
Assigning the number lets us use the system call on 64-bit kernels as well as providing a more consistent set of syscalls across architectures.
--- arch/arm/include/asm/unistd.h | 1 - arch/arm/tools/syscall.tbl | 1 + arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 2 ++ 4 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/include/asm/unistd.h +0 -1
@@ -45,7 +45,6 @@* Unimplemented (or alternatively implemented) syscalls */ #define __IGNORE_fadvise64_64 -#define __IGNORE_migrate_pages#ifdef __ARM_EABI__/*
arch/arm/tools/syscall.tbl +1 -0
@@ -414,3 +414,4 @@ 397 common statx sys_statx 398 common rseq sys_rseq 399 common io_pgetevents sys_io_pgetevents +400 common migrate_pages sys_migrate_pages
arch/arm64/include/asm/unistd.h +1 -1
@@ -44,7 +44,7 @@#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) -#define __NR_compat_syscalls 400 +#define __NR_compat_syscalls 401#endif #define __ARCH_WANT_SYS_CLONE
arch/arm64/include/asm/unistd32.h +2 -0
@@ -821,6 +821,8 @@ __SYSCALL(__NR_statx, sys_statx) __SYSCALL(__NR_rseq, sys_rseq)#define __NR_io_pgetevents 399 __SYSCALL(__NR_io_pgetevents, compat_sys_io_pgetevents) +#define __NR_migrate_pages 400 +__SYSCALL (__NR_migrate_pages, compat_sys_migrate_pages)/* * Please add new compat syscalls above this comment and update
Signature · 1 line
2.20.0
Re: [PATCH v2 06/29] ARM: add migrate_pages() system call
Quoted 11 lines · Arnd Bergmann
The
migrate_pagessystem call has an assigned number on all architectures except ARM. When it got added initially in commitd80ade7b3231("ARM:
Fix warning: #warning syscallmigrate_pagesnot implemented"), it was intentionally left out based on the observation that there are no 32-bit ARM NUMA systems.However, there are now arm64 NUMA machines that can in theory run 32-bit kernels (actually enabling NUMA there would require additional work) as well as 32-bit user space on 64-bit kernels, so that argument is no longer very strong.
Quoted 4 lines
Assigning the number lets us use the system call on 64-bit kernels as well as providing a more consistent set of syscalls across architectures.
Signed-off-by Arnd Bergmann <[email protected]>
For the arm64 part:
Arnd Bergmann
maintainerPATCH v2 7/29 ARM: add kexec_file_load system call number
In reply to Arnd BergmannA couple of architectures including arm64 already implement the kexec_file_load system call, on many others we have assigned a system call number for it, but not implemented it yet.
Adding the number in arch/arm/ lets us use the system call on arm64 systems in compat mode, and also reduces the number of differences between architectures. If we want to implement kexec_file_load on ARM in the future, the number assignment means that kexec tools can already be built with the now current set of kernel headers.
--- arch/arm/tools/syscall.tbl | 1 + arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/tools/syscall.tbl +1 -0
@@ -415,3 +415,4 @@ 398 common rseq sys_rseq 399 common io_pgetevents sys_io_pgetevents 400 common migrate_pages sys_migrate_pages +401 common kexec_file_load sys_kexec_file_load
arch/arm64/include/asm/unistd.h +1 -1
@@ -44,7 +44,7 @@#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) -#define __NR_compat_syscalls 401 +#define __NR_compat_syscalls 402#endif #define __ARCH_WANT_SYS_CLONE
arch/arm64/include/asm/unistd32.h +2 -0
@@ -823,6 +823,8 @@ __SYSCALL(__NR_rseq, sys_rseq) __SYSCALL(__NR_io_pgetevents, compat_sys_io_pgetevents)#define __NR_migrate_pages 400 __SYSCALL(__NR_migrate_pages, compat_sys_migrate_pages) +#define __NR_kexec_file_load 401 +__SYSCALL (__NR_kexec_file_load, sys_kexec_file_load)/* * Please add new compat syscalls above this comment and update
Signature · 6 lines
2.20.0 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
Re: [PATCH v2 07/29] ARM: add kexec_file_load system call number
arch/arm/tools/syscall.tbl line 418
Quoted 9 lines · Arnd Bergmann
arch/arm/tools/syscall.tbl +1
-0@@ -415,3 +415,4 @@ 398 common rseq sys_rseq 399 common io_pgetevents sys_io_pgetevents 400 common migrate_pages sys_migrate_pages +401 common kexec_file_load sys_kexec_file_load
I presume on arm32 this would still return -ENOSYS.
Quoted 18 lines
arch/arm64/include/asm/unistd.h +1
-1@@ -44,7 +44,7 @@#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) -#define __NR_compat_syscalls 401 +#define __NR_compat_syscalls 402#endif #define __ARCH_WANT_SYS_CLONEarch/arm64/include/asm/unistd32.h +0
-0
arch/arm64/include/asm/unistd32.h __SYSCALL(__NR_rseq, sys_rseq) · line 827
Quoted 5 lines
arch/arm64/include/asm/unistd32.h +2
-0@@ -823,6 +823,8 @@ __SYSCALL(__NR_rseq, sys_rseq) __SYSCALL(__NR_io_pgetevents, compat_sys_io_pgetevents)#define __NR_migrate_pages 400 __SYSCALL(__NR_migrate_pages, compat_sys_migrate_pages) +#define __NR_kexec_file_load 401 +__SYSCALL (__NR_kexec_file_load, sys_kexec_file_load)
For arm64:
Russell King - ARM Linux admin
maintainerRe: [PATCH v2 07/29] ARM: add kexec_file_load system call number
Quoted 12 lines · Catalin Marinas
arch/arm/tools/syscall.tbl line 418
Quoted 9 lines · Arnd Bergmann
arch/arm/tools/syscall.tbl +1
-0@@ -415,3 +415,4 @@ 398 common rseq sys_rseq 399 common io_pgetevents sys_io_pgetevents 400 common migrate_pages sys_migrate_pages +401 common kexec_file_load sys_kexec_file_loadI presume on arm32 this would still return
-ENOSYS.
Yes, I already checked. If CONFIG_KEXEC_FILE is not set, then kernel/kexec_file.c is not built, and we fall back to the stub in kernel/sys_ni.c.
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up
Arnd Bergmann
maintainerPATCH v2 8/29 m68k: assign syscall number for seccomp
In reply to Arnd BergmannMost architectures have assigned a numbers for the seccomp syscall even when they do not implement it.
m68k is an exception here, so for consistency lets add the number. Unless CONFIG_SECCOMP is implemented, the system call just returns -ENOSYS.
--- arch/m68k/kernel/syscalls/syscall.tbl | 1 + 1 file changed, 1 insertion(+)
arch/m68k/kernel/syscalls/syscall.tbl +1 -0
@@ -387,3 +387,4 @@ 377 common preadv2 sys_preadv2 378 common pwritev2 sys_pwritev2 379 common statx sys_statx +380 common seccomp sys_seccomp
Signature · 1 line
2.20.0
Re: [PATCH v2 08/29] m68k: assign syscall number for seccomp
Quoted 8 lines · Arnd Bergmann
Most architectures have assigned a numbers for the seccomp syscall even when they do not implement it.
m68k is an exception here, so for consistency lets add the number. Unless
CONFIG_SECCOMPis implemented, the system call just returns-ENOSYS.Signed-off-by Arnd Bergmann <[email protected]>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Arnd Bergmann
maintainerPATCH v2 9/29 sh: remove duplicate unistd_32.h file
In reply to Arnd BergmannWhen I merged this patch, the file was accidentally left intact instead of being removed, which means any changes to syscall.tbl have no effect.
--- arch/sh/include/uapi/asm/unistd_32.h | 403 --------------------------- 1 file changed, 403 deletions(-) delete mode 100644 arch/sh/include/uapi/asm/unistd_32.h
arch/sh/include/uapi/asm/unistd_32.h deleted +0 -403
@@ -1,403 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef __ASM_SH_UNISTD_32_H -#define __ASM_SH_UNISTD_32_H - -/* -* Copyright (C) 1999 Niibe Yutaka -*/ - -/* -* This file contains the system call numbers. -*/ - -#define __NR_restart_syscall 0 -#define __NR_exit 1 -#define __NR_fork 2 -#define __NR_read 3 -#define __NR_write 4 -#define __NR_open 5 -#define __NR_close 6 -#define __NR_waitpid 7 -#define __NR_creat 8 -#define __NR_link 9 -#define __NR_unlink 10 -#define __NR_execve 11 -#define __NR_chdir 12 -#define __NR_time 13 -#define __NR_mknod 14 -#define __NR_chmod 15 -#define __NR_lchown 16 -/* 17 was sys_break */ -#define __NR_oldstat 18 -#define __NR_lseek 19 -#define __NR_getpid 20 -#define __NR_mount 21 -#define __NR_umount 22 -#define __NR_setuid 23 -#define __NR_getuid 24 -#define __NR_stime 25 -#define __NR_ptrace 26 -#define __NR_alarm 27 -#define __NR_oldfstat 28 -#define __NR_pause 29 -#define __NR_utime 30 -/* 31 was sys_stty */ -/* 32 was sys_gtty */ -#define __NR_access 33 -#define __NR_nice 34 -/* 35 was sys_ftime */ -#define __NR_sync 36 -#define __NR_kill 37 -#define __NR_rename 38 -#define __NR_mkdir 39 -#define __NR_rmdir 40 -#define __NR_dup 41 -#define __NR_pipe 42 -#define __NR_times 43 -/* 44 was sys_prof */ -#define __NR_brk 45 -#define __NR_setgid 46 -#define __NR_getgid 47 -#define __NR_signal 48 -#define __NR_geteuid 49 -#define __NR_getegid 50 -#define __NR_acct 51 -#define __NR_umount2 52 -/* 53 was sys_lock */ -#define __NR_ioctl 54 -#define __NR_fcntl 55 -/* 56 was sys_mpx */ -#define __NR_setpgid 57 -/* 58 was sys_ulimit */ -/* 59 was sys_olduname */ -#define __NR_umask 60 -#define __NR_chroot 61 -#define __NR_ustat 62 -#define __NR_dup2 63 -#define __NR_getppid 64 -#define __NR_getpgrp 65 -#define __NR_setsid 66 -#define __NR_sigaction 67 -#define __NR_sgetmask 68 -#define __NR_ssetmask 69 -#define __NR_setreuid 70 -#define __NR_setregid 71 -#define __NR_sigsuspend 72 -#define __NR_sigpending 73 -#define __NR_sethostname 74 -#define __NR_setrlimit 75 -#define __NR_getrlimit 76/* Back compatible 2Gig limited rlimit */ -#define __NR_getrusage 77 -#define __NR_gettimeofday 78 -#define __NR_settimeofday 79 -#define __NR_getgroups 80 -#define __NR_setgroups 81 -/* 82 was sys_oldselect */ -#define __NR_symlink 83 -#define __NR_oldlstat 84 -#define __NR_readlink 85 -#define __NR_uselib 86 -#define __NR_swapon 87 -#define __NR_reboot 88 -#define __NR_readdir 89 -#define __NR_mmap 90 -#define __NR_munmap 91 -#define __NR_truncate 92 -#define __NR_ftruncate 93 -#define __NR_fchmod 94 -#define __NR_fchown 95 -#define __NR_getpriority 96 -#define __NR_setpriority 97 -/* 98 was sys_profil */ -#define __NR_statfs 99 -#define __NR_fstatfs 100 -/* 101 was sys_ioperm */ -#define __NR_socketcall 102 -#define __NR_syslog 103 -#define __NR_setitimer 104 -#define __NR_getitimer 105 -#define __NR_stat 106 -#define __NR_lstat 107 -#define __NR_fstat 108 -#define __NR_olduname 109 -/* 110 was sys_iopl */ -#define __NR_vhangup 111 -/* 112 was sys_idle */ -/* 113 was sys_vm86old */ -#define __NR_wait4 114 -#define __NR_swapoff 115 -#define __NR_sysinfo 116 -#define __NR_ipc 117 -#define __NR_fsync 118 -#define __NR_sigreturn 119 -#define __NR_clone 120 -#define __NR_setdomainname 121 -#define __NR_uname 122 -#define __NR_cacheflush 123 -#define __NR_adjtimex 124 -#define __NR_mprotect 125 -#define __NR_sigprocmask 126 -/* 127 was sys_create_module */ -#define __NR_init_module 128 -#define __NR_delete_module 129 -/* 130 was sys_get_kernel_syms */ -#define __NR_quotactl 131 -#define __NR_getpgid 132 -#define __NR_fchdir 133 -#define __NR_bdflush 134 -#define __NR_sysfs 135 -#define __NR_personality 136 -/* 137 was sys_afs_syscall */ -#define __NR_setfsuid 138 -#define __NR_setfsgid 139 -#define __NR__llseek 140 -#define __NR_getdents 141 -#define __NR__newselect 142 -#define __NR_flock 143 -#define __NR_msync 144 -#define __NR_readv 145 -#define __NR_writev 146 -#define __NR_getsid 147 -#define __NR_fdatasync 148 -#define __NR__sysctl 149 -#define __NR_mlock 150 -#define __NR_munlock 151 -#define __NR_mlockall 152 -#define __NR_munlockall 153 -#define __NR_sched_setparam 154 -#define __NR_sched_getparam 155 -#define __NR_sched_setscheduler 156 -#define __NR_sched_getscheduler 157 -#define __NR_sched_yield 158 -#define __NR_sched_get_priority_max 159 -#define __NR_sched_get_priority_min 160 -#define __NR_sched_rr_get_interval 161 -#define __NR_nanosleep 162 -#define __NR_mremap 163 -#define __NR_setresuid 164 -#define __NR_getresuid 165 -/* 166 was sys_vm86 */ -/* 167 was sys_query_module */ -#define __NR_poll 168 -#define __NR_nfsservctl 169 -#define __NR_setresgid 170 -#define __NR_getresgid 171 -#define __NR_prctl 172 -#define __NR_rt_sigreturn 173 -#define __NR_rt_sigaction 174 -#define __NR_rt_sigprocmask 175 -#define __NR_rt_sigpending 176 -#define __NR_rt_sigtimedwait 177 -#define __NR_rt_sigqueueinfo 178 -#define __NR_rt_sigsuspend 179 -#define __NR_pread64 180 -#define __NR_pwrite64 181 -#define __NR_chown 182 -#define __NR_getcwd 183 -#define __NR_capget 184 -#define __NR_capset 185 -#define __NR_sigaltstack 186 -#define __NR_sendfile 187 -/* 188 reserved for sys_getpmsg */ -/* 189 reserved for sys_putpmsg */ -#define __NR_vfork 190 -#define __NR_ugetrlimit 191/* SuS compliant getrlimit */ -#define __NR_mmap2 192 -#define __NR_truncate64 193 -#define __NR_ftruncate64 194 -#define __NR_stat64 195 -#define __NR_lstat64 196 -#define __NR_fstat64 197 -#define __NR_lchown32 198 -#define __NR_getuid32 199 -#define __NR_getgid32 200 -#define __NR_geteuid32 201 -#define __NR_getegid32 202 -#define __NR_setreuid32 203 -#define __NR_setregid32 204 -#define __NR_getgroups32 205 -#define __NR_setgroups32 206 -#define __NR_fchown32 207 -#define __NR_setresuid32 208 -#define __NR_getresuid32 209 -#define __NR_setresgid32 210 -#define __NR_getresgid32 211 -#define __NR_chown32 212 -#define __NR_setuid32 213 -#define __NR_setgid32 214 -#define __NR_setfsuid32 215 -#define __NR_setfsgid32 216 -#define __NR_pivot_root 217 -#define __NR_mincore 218 -#define __NR_madvise 219 -#define __NR_getdents64 220 -#define __NR_fcntl64 221 -/* 222 is reserved for tux */ -/* 223 is unused */ -#define __NR_gettid 224 -#define __NR_readahead 225 -#define __NR_setxattr 226 -#define __NR_lsetxattr 227 -#define __NR_fsetxattr 228 -#define __NR_getxattr 229 -#define __NR_lgetxattr 230 -#define __NR_fgetxattr 231 -#define __NR_listxattr 232 -#define __NR_llistxattr 233 -#define __NR_flistxattr 234 -#define __NR_removexattr 235 -#define __NR_lremovexattr 236 -#define __NR_fremovexattr 237 -#define __NR_tkill 238 -#define __NR_sendfile64 239 -#define __NR_futex 240 -#define __NR_sched_setaffinity 241 -#define __NR_sched_getaffinity 242 -/* 243 is reserved for set_thread_area */ -/* 244 is reserved for get_thread_area */ -#define __NR_io_setup 245 -#define __NR_io_destroy 246 -#define __NR_io_getevents 247 -#define __NR_io_submit 248 -#define __NR_io_cancel 249 -#define __NR_fadvise64 250 -/* 251 is unused */ -#define __NR_exit_group 252 -#define __NR_lookup_dcookie 253 -#define __NR_epoll_create 254 -#define __NR_epoll_ctl 255 -#define __NR_epoll_wait 256 -#define __NR_remap_file_pages 257 -#define __NR_set_tid_address 258 -#define __NR_timer_create 259 -#define __NR_timer_settime (__NR_timer_create+1) -#define __NR_timer_gettime (__NR_timer_create+2) -#define __NR_timer_getoverrun (__NR_timer_create+3) -#define __NR_timer_delete (__NR_timer_create+4) -#define __NR_clock_settime (__NR_timer_create+5) -#define __NR_clock_gettime (__NR_timer_create+6) -#define __NR_clock_getres (__NR_timer_create+7) -#define __NR_clock_nanosleep (__NR_timer_create+8) -#define __NR_statfs64 268 -#define __NR_fstatfs64 269 -#define __NR_tgkill 270 -#define __NR_utimes 271 -#define __NR_fadvise64_64 272 -/* 273 is reserved for vserver */ -#define __NR_mbind 274 -#define __NR_get_mempolicy 275 -#define __NR_set_mempolicy 276 -#define __NR_mq_open 277 -#define __NR_mq_unlink (__NR_mq_open+1) -#define __NR_mq_timedsend (__NR_mq_open+2) -#define __NR_mq_timedreceive (__NR_mq_open+3) -#define __NR_mq_notify (__NR_mq_open+4) -#define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_kexec_load 283 -#define __NR_waitid 284 -#define __NR_add_key 285 -#define __NR_request_key 286 -#define __NR_keyctl 287 -#define __NR_ioprio_set 288 -#define __NR_ioprio_get 289 -#define __NR_inotify_init 290 -#define __NR_inotify_add_watch 291 -#define __NR_inotify_rm_watch 292 -/* 293 is unused */ -#define __NR_migrate_pages 294 -#define __NR_openat 295 -#define __NR_mkdirat 296 -#define __NR_mknodat 297 -#define __NR_fchownat 298 -#define __NR_futimesat 299 -#define __NR_fstatat64 300 -#define __NR_unlinkat 301 -#define __NR_renameat 302 -#define __NR_linkat 303 -#define __NR_symlinkat 304 -#define __NR_readlinkat 305 -#define __NR_fchmodat 306 -#define __NR_faccessat 307 -#define __NR_pselect6 308 -#define __NR_ppoll 309 -#define __NR_unshare 310 -#define __NR_set_robust_list 311 -#define __NR_get_robust_list 312 -#define __NR_splice 313 -#define __NR_sync_file_range 314 -#define __NR_tee 315 -#define __NR_vmsplice 316 -#define __NR_move_pages 317 -#define __NR_getcpu 318 -#define __NR_epoll_pwait 319 -#define __NR_utimensat 320 -#define __NR_signalfd 321 -#define __NR_timerfd_create 322 -#define __NR_eventfd 323 -#define __NR_fallocate 324 -#define __NR_timerfd_settime 325 -#define __NR_timerfd_gettime 326 -#define __NR_signalfd4 327 -#define __NR_eventfd2 328 -#define __NR_epoll_create1 329 -#define __NR_dup3 330 -#define __NR_pipe2 331 -#define __NR_inotify_init1 332 -#define __NR_preadv 333 -#define __NR_pwritev 334 -#define __NR_rt_tgsigqueueinfo 335 -#define __NR_perf_event_open 336 -#define __NR_fanotify_init 337 -#define __NR_fanotify_mark 338 -#define __NR_prlimit64 339 - -/* Non-multiplexed socket family */ -#define __NR_socket 340 -#define __NR_bind 341 -#define __NR_connect 342 -#define __NR_listen 343 -#define __NR_accept 344 -#define __NR_getsockname 345 -#define __NR_getpeername 346 -#define __NR_socketpair 347 -#define __NR_send 348 -#define __NR_sendto 349 -#define __NR_recv 350 -#define __NR_recvfrom 351 -#define __NR_shutdown 352 -#define __NR_setsockopt 353 -#define __NR_getsockopt 354 -#define __NR_sendmsg 355 -#define __NR_recvmsg 356 -#define __NR_recvmmsg 357 -#define __NR_accept4 358 -#define __NR_name_to_handle_at 359 -#define __NR_open_by_handle_at 360 -#define __NR_clock_adjtime 361 -#define __NR_syncfs 362 -#define __NR_sendmmsg 363 -#define __NR_setns 364 -#define __NR_process_vm_readv 365 -#define __NR_process_vm_writev 366 -#define __NR_kcmp 367 -#define __NR_finit_module 368 -#define __NR_sched_getattr 369 -#define __NR_sched_setattr 370 -#define __NR_renameat2 371 -#define __NR_seccomp 372 -#define __NR_getrandom 373 -#define __NR_memfd_create 374 -#define __NR_bpf 375 -#define __NR_execveat 376 -#define __NR_userfaultfd 377 -#define __NR_membarrier 378 -#define __NR_mlock2 379 -#define __NR_copy_file_range 380 -#define __NR_preadv2 381 -#define __NR_pwritev2 382 - -#ifdef __KERNEL__ -#define __NR_syscalls 383 -#endif - -#endif /* __ASM_SH_UNISTD_32_H */
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 10/29 sh: add statx system call
In reply to Arnd Bergmannstatx is available on almost all other architectures but got missed on sh, so add it now.
--- arch/sh/kernel/syscalls/syscall.tbl | 1 + 1 file changed, 1 insertion(+)
arch/sh/kernel/syscalls/syscall.tbl +1 -0
@@ -390,3 +390,4 @@ 380 common copy_file_range sys_copy_file_range 381 common preadv2 sys_preadv2 382 common pwritev2 sys_pwritev2 +383 common statx sys_statx
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 11/29 sparc64: fix sparc_ipc type conversion
In reply to Arnd Bergmann__kernel_timespec and timespec are currently the same type, but once they are different, the type cast has to be changed here.
--- arch/sparc/kernel/sys_sparc_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/kernel/sys_sparc_64.c +1 -1
@@ -344,7 +344,7 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second goto out;case SEMTIMEDOP : err =sys_semtimedop (first, ptr, (unsigned int )second, - (const struct timespec __user *) + (const struct __kernel_timespec __user *) (unsigned long ) fifth); goto out;case SEMGET :
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 12/29 ipc: rename old-style shmctl/semctl/msgctl syscalls
In reply to Arnd BergmannThe behavior of these system calls is slightly different between architectures, as determined by the CONFIG_ARCH_WANT_IPC_PARSE_VERSION symbol. Most architectures that implement the split IPC syscalls don't set that symbol and only get the modern version, but alpha, arm, microblaze, mips-n32, mips-n64 and xtensa expect the caller to pass the IPC_64 flag.
For the architectures that so far only implement sys_ipc(), i.e. m68k, mips-o32, powerpc, s390, sh, sparc, and x86-32, we want the new behavior when adding the split syscalls, so we need to distinguish between the two groups of architectures.
The method I picked for this distinction is to have a separate system call entry point: sys_old_*ctl() now uses ipc_parse_version, while sys_*ctl() does not. The system call tables of the five architectures are changed accordingly.
As an additional benefit, we no longer need the configuration specific definition for ipc_parse_version(), it always does the same thing now, but simply won't get called on architectures with the modern interface.
A small downside is that on architectures that do set ARCH_WANT_IPC_PARSE_VERSION, we now have an extra set of entry points that are never called. They only add a few bytes of bloat, so it seems better to keep them compared to adding yet another Kconfig symbol. I considered adding new syscall numbers for the IPC_64 variants for consistency, but decided against that for now.
--- arch/alpha/kernel/syscalls/syscall.tbl | 6 ++-- arch/arm/tools/syscall.tbl | 6 ++-- arch/arm64/include/asm/unistd32.h | 6 ++-- arch/microblaze/kernel/syscalls/syscall.tbl | 6 ++-- arch/mips/kernel/syscalls/syscall_n32.tbl | 6 ++-- arch/mips/kernel/syscalls/syscall_n64.tbl | 6 ++-- arch/xtensa/kernel/syscalls/syscall.tbl | 6 ++-- include/linux/syscalls.h | 3 ++ ipc/msg.c | 39 ++++++++++++++++---- ipc/sem.c | 39 ++++++++++++++++---- ipc/shm.c | 40 +++++++++++++++++---- ipc/syscall.c | 12 +++---- ipc/util.h | 21 ++++------- kernel/sys_ni.c | 3 ++ 14 files changed, 137 insertions(+), 62 deletions(-)
arch/alpha/kernel/syscalls/syscall.tbl +3 -3
@@ -174,17 +174,17 @@ 187 common osf_alt_sigpending sys_ni_syscall 188 common osf_alt_setsid sys_ni_syscall 199 common osf_swapon sys_swapon -200 common msgctl sys_msgctl +200 common msgctl sys_old_msgctl 201 common msgget sys_msgget 202 common msgrcv sys_msgrcv 203 common msgsnd sys_msgsnd -204 common semctl sys_semctl +204 common semctl sys_old_semctl 205 common semget sys_semget 206 common semop sys_semop 207 common osf_utsname sys_osf_utsname 208 common lchown sys_lchown 209 common shmat sys_shmat -210 common shmctl sys_shmctl +210 common shmctl sys_old_shmctl 211 common shmdt sys_shmdt 212 common shmget sys_shmget 213 common osf_mvalid sys_ni_syscall
arch/arm/tools/syscall.tbl +3 -3
@@ -314,15 +314,15 @@ 297 common recvmsg sys_recvmsg 298 common semop sys_semop sys_oabi_semop 299 common semget sys_semget -300 common semctl sys_semctl +300 common semctl sys_old_semctl 301 common msgsnd sys_msgsnd 302 common msgrcv sys_msgrcv 303 common msgget sys_msgget -304 common msgctl sys_msgctl +304 common msgctl sys_old_msgctl 305 common shmat sys_shmat 306 common shmdt sys_shmdt 307 common shmget sys_shmget -308 common shmctl sys_shmctl +308 common shmctl sys_old_shmctl 309 common add_key sys_add_key 310 common request_key sys_request_key 311 common keyctl sys_keyctl
arch/arm64/include/asm/unistd32.h +3 -3
@@ -622,7 +622,7 @@ __SYSCALL(__NR_semop, sys_semop)#define __NR_semget 299 __SYSCALL(__NR_semget, sys_semget)#define __NR_semctl 300 -__SYSCALL(__NR_semctl, compat_sys_semctl) +__SYSCALL(__NR_semctl, compat_sys_old_semctl)#define __NR_msgsnd 301 __SYSCALL(__NR_msgsnd, compat_sys_msgsnd)#define __NR_msgrcv 302
@@ -630,7 +630,7 @@ __SYSCALL(__NR_msgrcv, compat_sys_msgrcv)#define __NR_msgget 303 __SYSCALL(__NR_msgget, sys_msgget)#define __NR_msgctl 304 -__SYSCALL(__NR_msgctl, compat_sys_msgctl) +__SYSCALL(__NR_msgctl, compat_sys_old_msgctl)#define __NR_shmat 305 __SYSCALL(__NR_shmat, compat_sys_shmat)#define __NR_shmdt 306
@@ -638,7 +638,7 @@ __SYSCALL(__NR_shmdt, sys_shmdt)#define __NR_shmget 307 __SYSCALL(__NR_shmget, sys_shmget)#define __NR_shmctl 308 -__SYSCALL(__NR_shmctl, compat_sys_shmctl) +__SYSCALL(__NR_shmctl, compat_sys_old_shmctl)#define __NR_add_key 309 __SYSCALL(__NR_add_key, sys_add_key)#define __NR_request_key 310
arch/microblaze/kernel/syscalls/syscall.tbl +3 -3
@@ -335,15 +335,15 @@ 325 common semtimedop sys_semtimedop 326 common timerfd_settime sys_timerfd_settime 327 common timerfd_gettime sys_timerfd_gettime -328 common semctl sys_semctl +328 common semctl sys_old_semctl 329 common semget sys_semget 330 common semop sys_semop -331 common msgctl sys_msgctl +331 common msgctl sys_old_msgctl 332 common msgget sys_msgget 333 common msgrcv sys_msgrcv 334 common msgsnd sys_msgsnd 335 common shmat sys_shmat -336 common shmctl sys_shmctl +336 common shmctl sys_old_shmctl 337 common shmdt sys_shmdt 338 common shmget sys_shmget 339 common signalfd4 sys_signalfd4
arch/mips/kernel/syscalls/syscall_n32.tbl +3 -3
@@ -37,7 +37,7 @@ 27 n32 madvise sys_madvise 28 n32 shmget sys_shmget 29 n32 shmat sys_shmat -30 n32 shmctl compat_sys_shmctl +30 n32 shmctl compat_sys_old_shmctl 31 n32 dup sys_dup 32 n32 dup2 sys_dup2 33 n32 pause sys_pause
@@ -71,12 +71,12 @@ 61 n32 uname sys_newuname 62 n32 semget sys_semget 63 n32 semop sys_semop -64 n32 semctl compat_sys_semctl +64 n32 semctl compat_sys_old_semctl 65 n32 shmdt sys_shmdt 66 n32 msgget sys_msgget 67 n32 msgsnd compat_sys_msgsnd 68 n32 msgrcv compat_sys_msgrcv -69 n32 msgctl compat_sys_msgctl +69 n32 msgctl compat_sys_old_msgctl 70 n32 fcntl compat_sys_fcntl 71 n32 flock sys_flock 72 n32 fsync sys_fsync
arch/mips/kernel/syscalls/syscall_n64.tbl +3 -3
@@ -37,7 +37,7 @@ 27 n64 madvise sys_madvise 28 n64 shmget sys_shmget 29 n64 shmat sys_shmat -30 n64 shmctl sys_shmctl +30 n64 shmctl sys_old_shmctl 31 n64 dup sys_dup 32 n64 dup2 sys_dup2 33 n64 pause sys_pause
@@ -71,12 +71,12 @@ 61 n64 uname sys_newuname 62 n64 semget sys_semget 63 n64 semop sys_semop -64 n64 semctl sys_semctl +64 n64 semctl sys_old_semctl 65 n64 shmdt sys_shmdt 66 n64 msgget sys_msgget 67 n64 msgsnd sys_msgsnd 68 n64 msgrcv sys_msgrcv -69 n64 msgctl sys_msgctl +69 n64 msgctl sys_old_msgctl 70 n64 fcntl sys_fcntl 71 n64 flock sys_flock 72 n64 fsync sys_fsync
arch/xtensa/kernel/syscalls/syscall.tbl +3 -3
@@ -103,7 +103,7 @@ 91 common madvise sys_madvise 92 common shmget sys_shmget 93 common shmat xtensa_shmat -94 common shmctl sys_shmctl +94 common shmctl sys_old_shmctl 95 common shmdt sys_shmdt # Socket Operations 96 common socket sys_socket
@@ -177,12 +177,12 @@ 161 common semtimedop sys_semtimedop 162 common semget sys_semget 163 common semop sys_semop -164 common semctl sys_semctl +164 common semctl sys_old_semctl 165 common available165 sys_ni_syscall 166 common msgget sys_msgget 167 common msgsnd sys_msgsnd 168 common msgrcv sys_msgrcv -169 common msgctl sys_msgctl +169 common msgctl sys_old_msgctl 170 common available170 sys_ni_syscall # File System 171 common umount2 sys_umount
include/linux/syscalls.h +3 -0
@@ -717,6 +717,7 @@ asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqst/* ipc/msg.c */ asmlinkage long sys_msgget (key_t key,int msgflg); +asmlinkage long sys_old_msgctl (int msqid,int cmd,struct msqid_ds __user *buf);asmlinkage long sys_msgctl (int msqid,int cmd,struct msqid_ds __user *buf);asmlinkage long sys_msgrcv (int msqid,struct msgbuf __user *msgp,size_t msgsz,long msgtyp,int msgflg);
@@ -726,6 +727,7 @@ asmlinkage long sys_msgsnd(int msqid, struct msgbuf __user *msgp,/* ipc/sem.c */ asmlinkage long sys_semget (key_t key,int nsems,int semflg);asmlinkage long sys_semctl (int semid,int semnum,int cmd,unsigned long arg); +asmlinkage long sys_old_semctl (int semid,int semnum,int cmd,unsigned long arg);asmlinkage long sys_semtimedop (int semid,struct sembuf __user *sops,unsigned nsops,const struct __kernel_timespec __user *timeout);
@@ -734,6 +736,7 @@ asmlinkage long sys_semop(int semid, struct sembuf __user *sops,/* ipc/shm.c */ asmlinkage long sys_shmget (key_t key,size_t size,int flag); +asmlinkage long sys_old_shmctl (int shmid,int cmd,struct shmid_ds __user *buf);asmlinkage long sys_shmctl (int shmid,int cmd,struct shmid_ds __user *buf);asmlinkage long sys_shmat (int shmid,char __user *shmaddr,int shmflg);asmlinkage long sys_shmdt (char __user *shmaddr);
ipc/msg.c +32 -7
@@ -567,9 +567,8 @@ static int msgctl_stat(struct ipc_namespace *ns, int msqid,return err; } -long ksys_msgctl (int msqid,int cmd,struct msqid_ds __user *buf) +static long ksys_msgctl (int msqid,int cmd,struct msqid_ds __user *buf,int version) { -int version;struct ipc_namespace *ns;struct msqid64_ds msqid64;int err;
@@ -577,7 +576,6 @@ long ksys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf)if (msqid <0 || cmd <0 )return -EINVAL ; - version =ipc_parse_version (&cmd); ns = current->nsproxy->ipc_ns;switch (cmd) {
@@ -613,9 +611,23 @@ long ksys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf) SYSCALL_DEFINE3(msgctl, int, msqid, int, cmd, struct msqid_ds __user *, buf) { -return ksys_msgctl (msqid, cmd, buf); +return ksys_msgctl (msqid, cmd, buf,IPC_64 ); } +#ifdef CONFIG_ARCH_WANT_IPC_PARSE_VERSION +long ksys_old_msgctl (int msqid,int cmd,struct msqid_ds __user *buf) +{ +int version =ipc_parse_version (&cmd); + +return ksys_msgctl (msqid, cmd, buf, version); +} + +SYSCALL_DEFINE3(old_msgctl, int, msqid, int, cmd, struct msqid_ds __user *, buf) +{ +return ksys_old_msgctl (msqid, cmd, buf); +} +#endif +#ifdef CONFIG_COMPAT struct compat_msqid_ds {
@@ -689,12 +701,11 @@ static int copy_compat_msqid_to_user(void __user *buf, struct msqid64_ds *in, } } -long compat_ksys_msgctl (int msqid,int cmd,void __user *uptr) +static long compat_ksys_msgctl (int msqid,int cmd,void __user *uptr,int version) {struct ipc_namespace *ns;int err;struct msqid64_ds msqid64; -int version =compat_ipc_parse_version (&cmd); ns = current->nsproxy->ipc_ns;
@@ -734,8 +745,22 @@ long compat_ksys_msgctl(int msqid, int cmd, void __user *uptr) COMPAT_SYSCALL_DEFINE3(msgctl, int, msqid, int, cmd, void __user *, uptr) { -return compat_ksys_msgctl (msqid, cmd, uptr); +return compat_ksys_msgctl (msqid, cmd, uptr,IPC_64 ); } + +#ifdef CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION +long compat_ksys_old_msgctl (int msqid,int cmd,void __user *uptr) +{ +int version =compat_ipc_parse_version (&cmd); + +return compat_ksys_msgctl (msqid, cmd, uptr, version); +} + +COMPAT_SYSCALL_DEFINE3(old_msgctl, int, msqid, int, cmd, void __user *, uptr) +{ +return compat_ksys_old_msgctl (msqid, cmd, uptr); +} +#endif #endif static int testmsg (struct msg_msg *msg,long type,int mode)
ipc/sem.c +32 -7
@@ -1634,9 +1634,8 @@ static int semctl_down(struct ipc_namespace *ns, int semid,return err; } -long ksys_semctl (int semid,int semnum,int cmd,unsigned long arg) +static long ksys_semctl (int semid,int semnum,int cmd,unsigned long arg,int version) { -int version;struct ipc_namespace *ns;void __user *p = (void __user *)arg;struct semid64_ds semid64;
@@ -1645,7 +1644,6 @@ long ksys_semctl(int semid, int semnum, int cmd, unsigned long arg)if (semid <0 )return -EINVAL ; - version =ipc_parse_version (&cmd); ns = current->nsproxy->ipc_ns;switch (cmd) {
@@ -1691,9 +1689,23 @@ long ksys_semctl(int semid, int semnum, int cmd, unsigned long arg) SYSCALL_DEFINE4(semctl, int, semid, int, semnum, int, cmd, unsigned long, arg) { -return ksys_semctl (semid, semnum, cmd, arg); +return ksys_semctl (semid, semnum, cmd, arg,IPC_64 ); } +#ifdef CONFIG_ARCH_WANT_IPC_PARSE_VERSION +long ksys_old_semctl (int semid,int semnum,int cmd,unsigned long arg) +{ +int version =ipc_parse_version (&cmd); + +return ksys_semctl (semid, semnum, cmd, arg, version); +} + +SYSCALL_DEFINE4(old_semctl, int, semid, int, semnum, int, cmd, unsigned long, arg) +{ +return ksys_old_semctl (semid, semnum, cmd, arg); +} +#endif +#ifdef CONFIG_COMPAT struct compat_semid_ds {
@@ -1744,12 +1756,11 @@ static int copy_compat_semid_to_user(void __user *buf, struct semid64_ds *in, } } -long compat_ksys_semctl (int semid,int semnum,int cmd,int arg) +static long compat_ksys_semctl (int semid,int semnum,int cmd,int arg,int version) {void __user *p =compat_ptr (arg);struct ipc_namespace *ns;struct semid64_ds semid64; -int version =compat_ipc_parse_version (&cmd);int err; ns = current->nsproxy->ipc_ns;
@@ -1792,8 +1803,22 @@ long compat_ksys_semctl(int semid, int semnum, int cmd, int arg) COMPAT_SYSCALL_DEFINE4(semctl, int, semid, int, semnum, int, cmd, int, arg) { -return compat_ksys_semctl (semid, semnum, cmd, arg); +return compat_ksys_semctl (semid, semnum, cmd, arg,IPC_64 ); } + +#ifdef CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION +long compat_ksys_old_semctl (int semid,int semnum,int cmd,int arg) +{ +int version =compat_ipc_parse_version (&cmd); + +return compat_ksys_semctl (semid, semnum, cmd, arg, version); +} + +COMPAT_SYSCALL_DEFINE4(old_semctl, int, semid, int, semnum, int, cmd, int, arg) +{ +return compat_ksys_old_semctl (semid, semnum, cmd, arg); +} +#endif #endif /* If the task doesn't already have a undo_list, then allocate one
ipc/shm.c +33 -7
@@ -1137,16 +1137,15 @@ static int shmctl_do_lock(struct ipc_namespace *ns, int shmid, int cmd)return err; } -long ksys_shmctl (int shmid,int cmd,struct shmid_ds __user *buf) +static long ksys_shmctl (int shmid,int cmd,struct shmid_ds __user *buf,int version) { -int err, version; +int err;struct ipc_namespace *ns;struct shmid64_ds sem64;if (cmd <0 || shmid <0 )return -EINVAL ; - version =ipc_parse_version (&cmd); ns = current->nsproxy->ipc_ns;switch (cmd) {
@@ -1194,8 +1193,22 @@ long ksys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf) SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) { -return ksys_shmctl (shmid, cmd, buf); +return ksys_shmctl (shmid, cmd, buf,IPC_64 ); +} + +#ifdef CONFIG_ARCH_WANT_IPC_PARSE_VERSION +long ksys_old_shmctl (int shmid,int cmd,struct shmid_ds __user *buf) +{ +int version =ipc_parse_version (&cmd); + +return ksys_shmctl (shmid, cmd, buf, version); +} + +SYSCALL_DEFINE3(old_shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) +{ +return ksys_old_shmctl (shmid, cmd, buf); } +#endif #ifdef CONFIG_COMPAT
@@ -1319,11 +1332,10 @@ static int copy_compat_shmid_from_user(struct shmid64_ds *out, void __user *buf, } } -long compat_ksys_shmctl (int shmid,int cmd,void __user *uptr) +long compat_ksys_shmctl (int shmid,int cmd,void __user *uptr,int version) {struct ipc_namespace *ns;struct shmid64_ds sem64; -int version =compat_ipc_parse_version (&cmd);int err; ns = current->nsproxy->ipc_ns;
@@ -1378,8 +1390,22 @@ long compat_ksys_shmctl(int shmid, int cmd, void __user *uptr) COMPAT_SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, void __user *, uptr) { -return compat_ksys_shmctl (shmid, cmd, uptr); +return compat_ksys_shmctl (shmid, cmd, uptr,IPC_64 ); } + +#ifdef CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION +long compat_ksys_old_shmctl (int shmid,int cmd,void __user *uptr) +{ +int version =compat_ipc_parse_version (&cmd); + +return compat_ksys_shmctl (shmid, cmd, uptr, version); +} + +COMPAT_SYSCALL_DEFINE3(old_shmctl, int, shmid, int, cmd, void __user *, uptr) +{ +return compat_ksys_old_shmctl (shmid, cmd, uptr); +} +#endif #endif /*
ipc/syscall.c +6 -6
@@ -47,7 +47,7 @@ int ksys_ipc(unsigned int call, int first, unsigned long second,return -EINVAL ;if (get_user (arg, (unsigned long __user *) ptr))return -EFAULT ; -return ksys_semctl (first, second, third, arg); +return ksys_old_semctl (first, second, third, arg); }case MSGSND :
@@ -75,7 +75,7 @@ int ksys_ipc(unsigned int call, int first, unsigned long second,case MSGGET :return ksys_msgget ((key_t ) first, second);case MSGCTL : -return ksys_msgctl (first, second, +return ksys_old_msgctl (first, second, (struct msqid_ds __user *)ptr);case SHMAT :
@@ -100,7 +100,7 @@ int ksys_ipc(unsigned int call, int first, unsigned long second,case SHMGET :return ksys_shmget (first, second, third);case SHMCTL : -return ksys_shmctl (first, second, +return ksys_old_shmctl (first, second, (struct shmid_ds __user *) ptr);default :return -ENOSYS ;
@@ -152,7 +152,7 @@ int compat_ksys_ipc(u32 call, int first, int second,return -EINVAL ;if (get_user (pad, (u32 __user *)compat_ptr (ptr)))return -EFAULT ; -return compat_ksys_semctl (first, second, third, pad); +return compat_ksys_old_semctl (first, second, third, pad);case MSGSND :return compat_ksys_msgsnd (first, ptr, second, third);
@@ -177,7 +177,7 @@ int compat_ksys_ipc(u32 call, int first, int second,case MSGGET :return ksys_msgget (first, second);case MSGCTL : -return compat_ksys_msgctl (first, second,compat_ptr (ptr)); +return compat_ksys_old_msgctl (first, second,compat_ptr (ptr));case SHMAT : {int err;
@@ -196,7 +196,7 @@ int compat_ksys_ipc(u32 call, int first, int second,case SHMGET :return ksys_shmget (first, (unsigned int )second, third);case SHMCTL : -return compat_ksys_shmctl (first, second,compat_ptr (ptr)); +return compat_ksys_old_shmctl (first, second,compat_ptr (ptr)); }return -ENOSYS ;
ipc/util.h +7 -14
@@ -160,10 +160,7 @@ static inline void ipc_update_pid(struct pid **pos, struct pid *pid) } } -#ifndef CONFIG_ARCH_WANT_IPC_PARSE_VERSION -/* On IA-64, we always use the "64-bit version" of the IPC structures. */ -# define ipc_parse_version (cmd) IPC_64 -#else +#ifdef CONFIG_ARCH_WANT_IPC_PARSE_VERSION int ipc_parse_version (int *cmd);#endif
@@ -246,13 +243,9 @@ int get_compat_ipc64_perm(struct ipc64_perm *,static inline int compat_ipc_parse_version (int *cmd) { -#ifdef CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION int version = *cmd &IPC_64 ; *cmd &= ~IPC_64 ;return version; -#else -return IPC_64 ; -#endif }#endif
@@ -261,29 +254,29 @@ long ksys_semtimedop(int semid, struct sembuf __user *tsops,unsigned int nsops, const struct __kernel_timespec __user *timeout);long ksys_semget (key_t key,int nsems,int semflg); -long ksys_semctl (int semid,int semnum,int cmd,unsigned long arg); +long ksys_old_semctl (int semid,int semnum,int cmd,unsigned long arg);long ksys_msgget (key_t key,int msgflg); -long ksys_msgctl (int msqid,int cmd,struct msqid_ds __user *buf); +long ksys_old_msgctl (int msqid,int cmd,struct msqid_ds __user *buf);long ksys_msgrcv (int msqid,struct msgbuf __user *msgp,size_t msgsz,long msgtyp,int msgflg);long ksys_msgsnd (int msqid,struct msgbuf __user *msgp,size_t msgsz,int msgflg);long ksys_shmget (key_t key,size_t size,int shmflg);long ksys_shmdt (char __user *shmaddr); -long ksys_shmctl (int shmid,int cmd,struct shmid_ds __user *buf); +long ksys_old_shmctl (int shmid,int cmd,struct shmid_ds __user *buf);/* for CONFIG_ARCH_WANT_OLD_COMPAT_IPC */ long compat_ksys_semtimedop (int semid,struct sembuf __user *tsems,unsigned int nsops,const struct old_timespec32 __user *timeout);#ifdef CONFIG_COMPAT -long compat_ksys_semctl (int semid,int semnum,int cmd,int arg); -long compat_ksys_msgctl (int msqid,int cmd,void __user *uptr); +long compat_ksys_old_semctl (int semid,int semnum,int cmd,int arg); +long compat_ksys_old_msgctl (int msqid,int cmd,void __user *uptr);long compat_ksys_msgrcv (int msqid,compat_uptr_t msgp,compat_ssize_t msgsz,compat_long_t msgtyp,int msgflg);long compat_ksys_msgsnd (int msqid,compat_uptr_t msgp,compat_ssize_t msgsz,int msgflg); -long compat_ksys_shmctl (int shmid,int cmd,void __user *uptr); +long compat_ksys_old_shmctl (int shmid,int cmd,void __user *uptr);#endif /* CONFIG_COMPAT */ #endif
kernel/sys_ni.c +3 -0
@@ -197,6 +197,7 @@ COND_SYSCALL_COMPAT(mq_getsetattr);/* ipc/msg.c */ COND_SYSCALL (msgget); +COND_SYSCALL (old_msgctl);COND_SYSCALL (msgctl);COND_SYSCALL_COMPAT (msgctl);COND_SYSCALL (msgrcv);
@@ -206,6 +207,7 @@ COND_SYSCALL_COMPAT(msgsnd);/* ipc/sem.c */ COND_SYSCALL (semget); +COND_SYSCALL (old_semctl);COND_SYSCALL (semctl);COND_SYSCALL_COMPAT (semctl);COND_SYSCALL (semtimedop);
@@ -214,6 +216,7 @@ COND_SYSCALL(semop);/* ipc/shm.c */ COND_SYSCALL (shmget); +COND_SYSCALL (old_shmctl);COND_SYSCALL (shmctl);COND_SYSCALL_COMPAT (shmctl);COND_SYSCALL (shmat);
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 13/29 arch: add split IPC system calls where needed
In reply to Arnd BergmannThe IPC system call handling is highly inconsistent across architectures, some use sys_ipc, some use separate calls, and some use both. We also have some architectures that require passing IPC_64 in the flags, and others that set it implicitly.
For the additon of a y2083 safe semtimedop() system call, I chose to only support the separate entry points, but that requires first supporting the regular ones with their own syscall numbers.
The IPC_64 is now implied by the new semctl/shmctl/msgctl system calls even on the architectures that require passing it with the ipc() multiplexer.
I'm not adding the new semtimedop() or semop() on 32-bit architectures, those will get implemented using the new semtimedop_time64() version that gets added along with the other time64 calls.
Three 64-bit architectures (powerpc, s390 and sparc) get semtimedop().
---
One aspect here that might be a bit controversial is the use of the same system call numbers across all architectures, synchronizing all of them with the x86-32 numbers. With the new syscall.tbl files, I hope we can just keep doing that in the future, and no longer require the architecture maintainers to assign a number.
This is mainly useful for implementers of the C libraries: if we can add future system calls everywhere at the same time, using a particular version of the kernel headers also guarantees that the system call number macro is visible.
--- arch/m68k/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/mips/kernel/syscalls/syscall_o32.tbl | 11 +++++++++++ arch/powerpc/kernel/syscalls/syscall.tbl | 13 +++++++++++++ arch/s390/kernel/syscalls/syscall.tbl | 12 ++++++++++++ arch/sh/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/sparc/kernel/syscalls/syscall.tbl | 12 ++++++++++++ arch/x86/entry/syscalls/syscall_32.tbl | 11 +++++++++++ 7 files changed, 81 insertions(+)
arch/m68k/kernel/syscalls/syscall.tbl +11 -0
@@ -388,3 +388,14 @@ 378 common pwritev2 sys_pwritev2 379 common statx sys_statx 380 common seccomp sys_seccomp +# room for arch specific calls +393 common semget sys_semget +394 common semctl sys_semctl +395 common shmget sys_shmget +396 common shmctl sys_shmctl +397 common shmat sys_shmat +398 common shmdt sys_shmdt +399 common msgget sys_msgget +400 common msgsnd sys_msgsnd +401 common msgrcv sys_msgrcv +402 common msgctl sys_msgctl
arch/mips/kernel/syscalls/syscall_o32.tbl +11 -0
@@ -380,3 +380,14 @@ 366 o32 statx sys_statx 367 o32 rseq sys_rseq 368 o32 io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents +# room for arch specific calls +393 o32 semget sys_semget +394 o32 semctl sys_semctl compat_sys_semctl +395 o32 shmget sys_shmget +396 o32 shmctl sys_shmctl compat_sys_shmctl +397 o32 shmat sys_shmat compat_sys_shmat +398 o32 shmdt sys_shmdt +399 o32 msgget sys_msgget +400 o32 msgsnd sys_msgsnd compat_sys_msgsnd +401 o32 msgrcv sys_msgrcv compat_sys_msgrcv +402 o32 msgctl sys_msgctl compat_sys_msgctl
arch/powerpc/kernel/syscalls/syscall.tbl +13 -0
@@ -414,6 +414,7 @@ 363 spu switch_endian sys_ni_syscall 364 common userfaultfd sys_userfaultfd 365 common membarrier sys_membarrier +# 366-377 originally left for IPC, now unused 378 nospu mlock2 sys_mlock2 379 nospu copy_file_range sys_copy_file_range 380 common preadv2 sys_preadv2 compat_sys_preadv2
@@ -425,3 +426,15 @@ 386 nospu pkey_mprotect sys_pkey_mprotect 387 nospu rseq sys_rseq 388 nospu io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents +# room for arch specific syscalls +392 64 semtimedop sys_semtimedop +393 common semget sys_semget +394 common semctl sys_semctl compat_sys_semctl +395 common shmget sys_shmget +396 common shmctl sys_shmctl compat_sys_shmctl +397 common shmat sys_shmat compat_sys_shmat +398 common shmdt sys_shmdt +399 common msgget sys_msgget +400 common msgsnd sys_msgsnd compat_sys_msgsnd +401 common msgrcv sys_msgrcv compat_sys_msgrcv +402 common msgctl sys_msgctl compat_sys_msgctl
arch/s390/kernel/syscalls/syscall.tbl +12 -0
@@ -391,3 +391,15 @@ 381 common kexec_file_load sys_kexec_file_load sys_kexec_file_load 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 383 common rseq sys_rseq sys_rseq +# room for arch specific syscalls +392 64 semtimedop sys_semtimedop - +393 common semget sys_semget sys_semget +394 common semctl sys_semctl compat_sys_semctl +395 common shmget sys_shmget sys_shmget +396 common shmctl sys_shmctl compat_sys_shmctl +397 common shmat sys_shmat compat_sys_shmat +398 common shmdt sys_shmdt sys_shmdt +399 common msgget sys_msgget sys_msgget +400 common msgsnd sys_msgsnd compat_sys_msgsnd +401 common msgrcv sys_msgrcv compat_sys_msgrcv +402 common msgctl sys_msgctl compat_sys_msgctl
arch/sh/kernel/syscalls/syscall.tbl +11 -0
@@ -391,3 +391,14 @@ 381 common preadv2 sys_preadv2 382 common pwritev2 sys_pwritev2 383 common statx sys_statx +# room for arch specific syscalls +393 common semget sys_semget +394 common semctl sys_semctl +395 common shmget sys_shmget +396 common shmctl sys_shmctl +397 common shmat sys_shmat +398 common shmdt sys_shmdt +399 common msgget sys_msgget +400 common msgsnd sys_msgsnd +401 common msgrcv sys_msgrcv +402 common msgctl sys_msgctl
arch/sparc/kernel/syscalls/syscall.tbl +12 -0
@@ -407,3 +407,15 @@ 359 common pwritev2 sys_pwritev2 compat_sys_pwritev2 360 common statx sys_statx 361 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents +# room for arch specific syscalls +392 64 semtimedop sys_semtimedop +393 common semget sys_semget +394 common semctl sys_semctl compat_sys_semctl +395 common shmget sys_shmget +396 common shmctl sys_shmctl compat_sys_shmctl +397 common shmat sys_shmat compat_sys_shmat +398 common shmdt sys_shmdt +399 common msgget sys_msgget +400 common msgsnd sys_msgsnd compat_sys_msgsnd +401 common msgrcv sys_msgrcv compat_sys_msgrcv +402 common msgctl sys_msgctl compat_sys_msgctl
arch/x86/entry/syscalls/syscall_32.tbl +11 -0
@@ -398,3 +398,14 @@ 384 i386 arch_prctl sys_arch_prctl __ia32_compat_sys_arch_prctl 385 i386 io_pgetevents sys_io_pgetevents __ia32_compat_sys_io_pgetevents 386 i386 rseq sys_rseq __ia32_sys_rseq +# room for arch specific syscalls +393 i386 semget sys_semget __ia32_sys_semget +394 i386 semctl sys_semctl __ia32_compat_sys_semctl +395 i386 shmget sys_shmget __ia32_sys_shmget +396 i386 shmctl sys_shmctl __ia32_compat_sys_shmctl +397 i386 shmat sys_shmat __ia32_compat_sys_shmat +398 i386 shmdt sys_shmdt __ia32_sys_shmdt +399 i386 msgget sys_msgget __ia32_sys_msgget +400 i386 msgsnd sys_msgsnd __ia32_compat_sys_msgsnd +401 i386 msgrcv sys_msgrcv __ia32_compat_sys_msgrcv +402 i386 msgctl sys_msgctl __ia32_compat_sys_msgctl
Signature · 1 line
2.20.0
Re: [PATCH v2 13/29] arch: add split IPC system calls where needed
Quoted 6 lines · Arnd Bergmann
The IPC system call handling is highly inconsistent across architectures, some use
sys_ipc, some use separate calls, and some use both. We also have some architectures that require passingIPC_64in the flags, and others that set it implicitly.For the additon of a y2083 safe
semtimedop()system call, I chose to only
It's not critical, but there are two typos in that line:
additon -> addition
2083 -> 2038
Gabriel
Quoted 13 lines
support the separate entry points, but that requires first supporting the regular ones with their own syscall numbers.
The
IPC_64is now implied by the new semctl/shmctl/msgctl system calls even on the architectures that require passing it with theipc()multiplexer.I'm not adding the new
semtimedop()orsemop()on 32-bit architectures, those will get implemented using the newsemtimedop_time64()version that gets added along with the other time64 calls.
Three 64-bit architectures (powerpc, s390 and sparc) getsemtimedop().Signed-off-by Arnd Bergmann <[email protected]>
Arnd Bergmann
maintainerRe: [PATCH v2 13/29] arch: add split IPC system calls where needed
Quoted 7 lines · Gabriel Paubert
Quoted 5 lines · Arnd Bergmann
The IPC system call handling is highly inconsistent across architectures, some use
sys_ipc, some use separate calls, and some use both. We also have some architectures that require passingIPC_64in the flags, and others that set it implicitly.
Quoted 5 lines
Quoted 1 line
For the additon of a y2083 safe
semtimedop()system call, I chose to onlyIt's not critical, but there are two typos in that line:
additon -> addition
2083 -> 2038
Fixed both, thanks!
Arnd
Re: [PATCH v2 13/29] arch: add split IPC system calls where needed
In reply to Arnd BergmannQuoted 13 lines · Arnd Bergmann
The IPC system call handling is highly inconsistent across architectures, some use
sys_ipc, some use separate calls, and some use both. We also have some architectures that require passingIPC_64in the flags, and others that set it implicitly.For the additon of a y2083 safe
semtimedop()system call, I chose to only support the separate entry points, but that requires first supporting the regular ones with their own syscall numbers.The
IPC_64is now implied by the new semctl/shmctl/msgctl system calls even on the architectures that require passing it with theipc()multiplexer.
Quoted 8 lines
I'm not adding the new
semtimedop()orsemop()on 32-bit architectures, those will get implemented using the newsemtimedop_time64()version that gets added along with the other time64 calls.
Three 64-bit architectures (powerpc, s390 and sparc) getsemtimedop().Signed-off-by Arnd Bergmann <[email protected]>arch/m68k/kernel/syscalls/syscall.tbl | 11 +++++++++++
For m68k:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH v2 13/29] arch: add split IPC system calls where needed
In reply to Arnd BergmannQuoted 30 lines · Arnd Bergmann
The IPC system call handling is highly inconsistent across architectures, some use
sys_ipc, some use separate calls, and some use both. We also have some architectures that require passingIPC_64in the flags, and others that set it implicitly.For the additon of a y2083 safe
semtimedop()system call, I chose to only support the separate entry points, but that requires first supporting the regular ones with their own syscall numbers.The
IPC_64is now implied by the new semctl/shmctl/msgctl system calls even on the architectures that require passing it with theipc()multiplexer.I'm not adding the new
semtimedop()orsemop()on 32-bit architectures, those will get implemented using the newsemtimedop_time64()version that gets added along with the other time64 calls.
Three 64-bit architectures (powerpc, s390 and sparc) getsemtimedop().Signed-off-by Arnd Bergmann <[email protected]>---
One aspect here that might be a bit controversial is the use of the same system call numbers across all architectures, synchronizing all of them with the x86-32 numbers. With the new syscall.tbl files, I hope we can just keep doing that in the future, and no longer require the architecture maintainers to assign a number.This is mainly useful for implementers of the C libraries: if we can add future system calls everywhere at the same time, using a particular version of the kernel headers also guarantees that the system call number macro is visible.
Quoted 9 lines
--- arch/m68k/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/mips/kernel/syscalls/syscall_o32.tbl | 11 +++++++++++ arch/powerpc/kernel/syscalls/syscall.tbl | 13 +++++++++++++ arch/s390/kernel/syscalls/syscall.tbl | 12 ++++++++++++ arch/sh/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/sparc/kernel/syscalls/syscall.tbl | 12 ++++++++++++ arch/x86/entry/syscalls/syscall_32.tbl | 11 +++++++++++ 7 files changed, 81 insertions(+)
For the s390 bits:
Arnd Bergmann
maintainerPATCH v2 14/29 arch: add pkey and rseq syscall numbers everywhere
In reply to Arnd BergmannMost architectures define system call numbers for the rseq and pkey system calls, even when they don't support the features, and perhaps never will.
Only a few architectures are missing these, so just define them anyway for consistency. If we decide to add them later to one of these, the system call numbers won't get out of sync then.
--- arch/alpha/include/asm/unistd.h | 4 ---- arch/alpha/kernel/syscalls/syscall.tbl | 4 ++++ arch/ia64/kernel/syscalls/syscall.tbl | 4 ++++ arch/m68k/kernel/syscalls/syscall.tbl | 4 ++++ arch/parisc/include/asm/unistd.h | 3 --- arch/parisc/kernel/syscalls/syscall.tbl | 4 ++++ arch/s390/include/asm/unistd.h | 3 --- arch/s390/kernel/syscalls/syscall.tbl | 3 +++ arch/sh/kernel/syscalls/syscall.tbl | 4 ++++ arch/sparc/include/asm/unistd.h | 5 ----- arch/sparc/kernel/syscalls/syscall.tbl | 4 ++++ arch/xtensa/kernel/syscalls/syscall.tbl | 1 + 12 files changed, 28 insertions(+), 15 deletions(-)
arch/alpha/include/asm/unistd.h +0 -4
@@ -29,9 +29,5 @@#define __IGNORE_getppid#define __IGNORE_getuid -/* Alpha doesn't have protection keys. */ -#define __IGNORE_pkey_mprotect -#define __IGNORE_pkey_alloc -#define __IGNORE_pkey_free#endif /* _ALPHA_UNISTD_H */
arch/alpha/kernel/syscalls/syscall.tbl +4 -0
@@ -452,3 +452,7 @@ 521 common pwritev2 sys_pwritev2 522 common statx sys_statx 523 common io_pgetevents sys_io_pgetevents +524 common pkey_alloc sys_pkey_alloc +525 common pkey_free sys_pkey_free +526 common pkey_mprotect sys_pkey_mprotect +527 common rseq sys_rseq
arch/ia64/kernel/syscalls/syscall.tbl +4 -0
@@ -339,3 +339,7 @@ 327 common io_pgetevents sys_io_pgetevents 328 common perf_event_open sys_perf_event_open 329 common seccomp sys_seccomp +330 common pkey_alloc sys_pkey_alloc +331 common pkey_free sys_pkey_free +332 common pkey_mprotect sys_pkey_mprotect +333 common rseq sys_rseq
arch/m68k/kernel/syscalls/syscall.tbl +4 -0
@@ -388,6 +388,10 @@ 378 common pwritev2 sys_pwritev2 379 common statx sys_statx 380 common seccomp sys_seccomp +381 common pkey_alloc sys_pkey_alloc +382 common pkey_free sys_pkey_free +383 common pkey_mprotect sys_pkey_mprotect +384 common rseq sys_rseq # room for arch specific calls 393 common semget sys_semget 394 common semctl sys_semctl
arch/parisc/include/asm/unistd.h +0 -3
@@ -12,9 +12,6 @@#define __IGNORE_select/* newselect */ #define __IGNORE_fadvise64/* fadvise64_64 */ -#define __IGNORE_pkey_mprotect -#define __IGNORE_pkey_alloc -#define __IGNORE_pkey_free#ifndef ASM_LINE_SEP # define ASM_LINE_SEP ;
arch/parisc/kernel/syscalls/syscall.tbl +4 -0
@@ -367,3 +367,7 @@ 348 common pwritev2 sys_pwritev2 compat_sys_pwritev2 349 common statx sys_statx 350 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents +351 common pkey_alloc sys_pkey_alloc +352 common pkey_free sys_pkey_free +353 common pkey_mprotect sys_pkey_mprotect +354 common rseq sys_rseq
arch/s390/include/asm/unistd.h +0 -3
@@ -11,9 +11,6 @@#include <asm/unistd_nr.h> #define __IGNORE_time -#define __IGNORE_pkey_mprotect -#define __IGNORE_pkey_alloc -#define __IGNORE_pkey_free#define __ARCH_WANT_NEW_STAT#define __ARCH_WANT_OLD_READDIR
arch/s390/kernel/syscalls/syscall.tbl +3 -0
@@ -391,6 +391,9 @@ 381 common kexec_file_load sys_kexec_file_load sys_kexec_file_load 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 383 common rseq sys_rseq sys_rseq +384 common pkey_alloc sys_pkey_alloc sys_pkey_alloc +385 common pkey_free sys_pkey_free sys_pkey_free +386 common pkey_mprotect sys_pkey_mprotect sys_pkey_mprotect # room for arch specific syscalls 392 64 semtimedop sys_semtimedop - 393 common semget sys_semget sys_semget
arch/sh/kernel/syscalls/syscall.tbl +4 -0
@@ -391,6 +391,10 @@ 381 common preadv2 sys_preadv2 382 common pwritev2 sys_pwritev2 383 common statx sys_statx +384 common pkey_alloc sys_pkey_alloc +385 common pkey_free sys_pkey_free +386 common pkey_mprotect sys_pkey_mprotect +387 common rseq sys_rseq # room for arch specific syscalls 393 common semget sys_semget 394 common semctl sys_semctl
arch/sparc/include/asm/unistd.h +0 -5
@@ -59,9 +59,4 @@#define __IGNORE_getresgid#endif -/* Sparc doesn't have protection keys. */ -#define __IGNORE_pkey_mprotect -#define __IGNORE_pkey_alloc -#define __IGNORE_pkey_free -#endif /* _SPARC_UNISTD_H */
arch/sparc/kernel/syscalls/syscall.tbl +4 -0
@@ -407,6 +407,10 @@ 359 common pwritev2 sys_pwritev2 compat_sys_pwritev2 360 common statx sys_statx 361 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents +362 common pkey_alloc sys_pkey_alloc +363 common pkey_free sys_pkey_free +364 common pkey_mprotect sys_pkey_mprotect +365 common rseq sys_rseq # room for arch specific syscalls 392 64 semtimedop sys_semtimedop 393 common semget sys_semget
arch/xtensa/kernel/syscalls/syscall.tbl +1 -0
@@ -372,3 +372,4 @@ 349 common pkey_alloc sys_pkey_alloc 350 common pkey_free sys_pkey_free 351 common statx sys_statx +352 common rseq sys_rseq
Signature · 6 lines
2.20.0 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
Re: [PATCH v2 14/29] arch: add pkey and rseq syscall numbers everywhere
Quoted 14 lines · Arnd Bergmann
Most architectures define system call numbers for the rseq and pkey system calls, even when they don't support the features, and perhaps never will.
Only a few architectures are missing these, so just define them anyway for consistency. If we decide to add them later to one of these, the system call numbers won't get out of sync then.
Signed-off-by Arnd Bergmann <[email protected]>arch/m68k/kernel/syscalls/syscall.tbl | 4 ++++
arch/m68k/kernel/syscalls/syscall.tbl line 394
Quoted 7 lines
arch/m68k/kernel/syscalls/syscall.tbl +4
-0@@ -388,6 +388,10 @@ 378 common pwritev2 sys_pwritev2 379 common statx sys_statx 380 common seccomp sys_seccomp +381 common pkey_alloc sys_pkey_alloc +382 common pkey_free sys_pkey_free +383 common pkey_mprotect sys_pkey_mprotect +384 common rseq sys_rseq
Note that all architectures that already define pkey syscalls, list pkey_mprotect
first.
Regardless, for m68k:
arch/m68k/kernel/syscalls/syscall.tbl line 397
Quoted 3 lines
arch/m68k/kernel/syscalls/syscall.tbl +0
-0# room for arch specific calls 393 common semget sys_semget 394 common semctl sys_semctl
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Arnd Bergmann
maintainerRe: [PATCH v2 14/29] arch: add pkey and rseq syscall numbers everywhere
Quoted 3 lines · Geert Uytterhoeven
Note that all architectures that already define pkey syscalls, list
pkey_mprotectfirst.
It's easy enough to change, so I've reordered them for consistency now.
Quoted 2 lines
Regardless, for m68k:
Thanks,
Arnd
Re: [PATCH v2 14/29] arch: add pkey and rseq syscall numbers everywhere
In reply to Arnd BergmannQuoted 8 lines · Arnd Bergmann
Most architectures define system call numbers for the rseq and pkey system calls, even when they don't support the features, and perhaps never will.
Only a few architectures are missing these, so just define them anyway for consistency. If we decide to add them later to one of these, the system call numbers won't get out of sync then.
Signed-off-by Arnd Bergmann <[email protected]>
Quoted 14 lines
--- arch/alpha/include/asm/unistd.h | 4 ---- arch/alpha/kernel/syscalls/syscall.tbl | 4 ++++ arch/ia64/kernel/syscalls/syscall.tbl | 4 ++++ arch/m68k/kernel/syscalls/syscall.tbl | 4 ++++ arch/parisc/include/asm/unistd.h | 3 --- arch/parisc/kernel/syscalls/syscall.tbl | 4 ++++ arch/s390/include/asm/unistd.h | 3 --- arch/s390/kernel/syscalls/syscall.tbl | 3 +++ arch/sh/kernel/syscalls/syscall.tbl | 4 ++++ arch/sparc/include/asm/unistd.h | 5 ----- arch/sparc/kernel/syscalls/syscall.tbl | 4 ++++ arch/xtensa/kernel/syscalls/syscall.tbl | 1 + 12 files changed, 28 insertions(+), 15 deletions(-)
For the s390 bits:
Arnd Bergmann
maintainerPATCH v2 15/29 alpha: add standard statfs64/fstatfs64 syscalls
In reply to Arnd BergmannAs Joseph Myers points out, alpha has never had a standard statfs64 interface and instead returns only 32-bit numbers here.
While there is an old osf_statfs64 system call that returns additional data, this has some other quirks and does not get used in glibc.
I considered making the stat64 structure layout compatible with with the one used by the kernel on most other 64 bit architecture that implement it (ia64, parisc, powerpc, and sparc), but in the end decided to stay with the one that was traditionally defined in the alpha headers but not used, since this is also what glibc exposes to user space.
--- arch/alpha/kernel/syscalls/syscall.tbl | 2 ++ 1 file changed, 2 insertions(+)
arch/alpha/kernel/syscalls/syscall.tbl +2 -0
@@ -456,3 +456,5 @@ 525 common pkey_free sys_pkey_free 526 common pkey_mprotect sys_pkey_mprotect 527 common rseq sys_rseq +528 common statfs64 sys_statfs64 +529 common fstatfs64 sys_fstatfs64
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 16/29 alpha: add generic get{eg,eu,g,p,u,pp}id() syscalls
In reply to Arnd BergmannAlpha has traditionally followed the OSF1 calling conventions here, with its getxpid, getxuid, getxgid system calls returning two different values in separate registers.
Following what glibc has done here, we can define getpid, getuid and getgid to be aliases for getxpid, getxuid and getxgid respectively, and add new system call numbers for getppid, geteuid and getegid.
--- arch/alpha/include/asm/unistd.h | 11 ----------- arch/alpha/include/uapi/asm/unistd.h | 5 +++++ arch/alpha/kernel/syscalls/syscall.tbl | 3 +++ 3 files changed, 8 insertions(+), 11 deletions(-)
arch/alpha/include/asm/unistd.h +0 -11
@@ -19,15 +19,4 @@#define __ARCH_WANT_SYS_VFORK#define __ARCH_WANT_SYS_CLONE -/* -* Ignore legacy syscalls that we don't use. -*/ -#define __IGNORE_getegid -#define __IGNORE_geteuid -#define __IGNORE_getgid -#define __IGNORE_getpid -#define __IGNORE_getppid -#define __IGNORE_getuid - -#endif /* _ALPHA_UNISTD_H */
arch/alpha/include/uapi/asm/unistd.h +5 -0
@@ -7,6 +7,11 @@#define __NR_umount __NR_umount2#define __NR_osf_shmat __NR_shmat +/* These return an extra value but can be used as aliases */ +#define __NR_getpid __NR_getxpid +#define __NR_getuid __NR_getxuid +#define __NR_getgid __NR_getxgid +#include <asm/unistd_32.h> #endif /* _UAPI_ALPHA_UNISTD_H */
arch/alpha/kernel/syscalls/syscall.tbl +3 -0
@@ -458,3 +458,6 @@ 527 common rseq sys_rseq 528 common statfs64 sys_statfs64 529 common fstatfs64 sys_fstatfs64 +530 common getegid sys_getegid +531 common geteuid sys_geteuid +532 common getppid sys_getppid
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 17/29 syscalls: remove obsolete __IGNORE_ macros
In reply to Arnd BergmannThese are all for ignoring the lack of obsolete system calls, which have been marked the same way in scripts/checksyscall.sh, so these can be removed.
--- arch/mips/include/asm/unistd.h | 16 ---------------- arch/parisc/include/asm/unistd.h | 3 --- arch/s390/include/asm/unistd.h | 2 -- arch/xtensa/include/asm/unistd.h | 12 ------------ 4 files changed, 33 deletions(-)
arch/mips/include/asm/unistd.h +0 -16
@@ -53,22 +53,6 @@#define __ARCH_WANT_SYS_FORK#define __ARCH_WANT_SYS_CLONE -/* whitelists for checksyscalls */ -#define __IGNORE_select -#define __IGNORE_vfork -#define __IGNORE_time -#define __IGNORE_uselib -#define __IGNORE_fadvise64_64 -#define __IGNORE_getdents64 -#if _MIPS_SIM == _MIPS_SIM_NABI32 -#define __IGNORE_truncate64 -#define __IGNORE_ftruncate64 -#define __IGNORE_stat64 -#define __IGNORE_lstat64 -#define __IGNORE_fstat64 -#define __IGNORE_fstatat64 -#endif -#endif /* !__ASSEMBLY__ */ #endif /* _ASM_UNISTD_H */
arch/parisc/include/asm/unistd.h +0 -3
@@ -10,9 +10,6 @@#define SYS_ify (syscall_name) __NR_##syscall_name -#define __IGNORE_select/* newselect */ -#define __IGNORE_fadvise64/* fadvise64_64 */ -#ifndef ASM_LINE_SEP # define ASM_LINE_SEP ;#endif
arch/s390/include/asm/unistd.h +0 -2
@@ -10,8 +10,6 @@#include <uapi/asm/unistd.h> #include <asm/unistd_nr.h> -#define __IGNORE_time -#define __ARCH_WANT_NEW_STAT#define __ARCH_WANT_OLD_READDIR#define __ARCH_WANT_SYS_ALARM
arch/xtensa/include/asm/unistd.h +0 -12
@@ -10,18 +10,6 @@#define __ARCH_WANT_SYS_UTIME#define __ARCH_WANT_SYS_GETPGRP -/* -* Ignore legacy system calls in the checksyscalls.sh script -*/ - -#define __IGNORE_fork/* use clone */ -#define __IGNORE_time -#define __IGNORE_alarm/* use setitimer */ -#define __IGNORE_pause -#define __IGNORE_mmap/* use mmap2 */ -#define __IGNORE_vfork/* use clone */ -#define __IGNORE_fadvise64/* use fadvise64_64 */ -#define NR_syscalls __NR_syscalls#endif /* _XTENSA_UNISTD_H */
Signature · 1 line
2.20.0
Re: [PATCH v2 17/29] syscalls: remove obsolete __IGNORE_ macros
Quoted 11 lines · Arnd Bergmann
These are all for ignoring the lack of obsolete system calls, which have been marked the same way in
scripts/checksyscall.sh, so these can be removed.Signed-off-by Arnd Bergmann <[email protected]>--- arch/mips/include/asm/unistd.h | 16 ---------------- arch/parisc/include/asm/unistd.h | 3 --- arch/s390/include/asm/unistd.h | 2 -- arch/xtensa/include/asm/unistd.h | 12 ------------ 4 files changed, 33 deletions(-)
For the s390 bits:
Arnd Bergmann
maintainerPATCH v2 18/29 time: make adjtime compat handling available for 32 bit
In reply to Arnd BergmannWe want to reuse the compat_timex handling on 32-bit architectures the same way we are using the compat handling for timespec when moving to 64-bit time_t.
Move all definitions related to compat_timex out of the compat code into the normal timekeeping code, along with a rename to old_timex32, corresponding to the timespec/timeval structures, and make it controlled by CONFIG_COMPAT_32BIT_TIME, which 32-bit architectures will then select.
--- include/linux/compat.h | 35 ++----------------- include/linux/time32.h | 32 ++++++++++++++++- kernel/compat.c | 64 ---------------------------------- kernel/time/posix-timers.c | 14 ++------ kernel/time/time.c | 70 +++++++++++++++++++++++++++++++++++--- 5 files changed, 102 insertions(+), 113 deletions(-)
include/linux/compat.h +2 -33
@@ -132,37 +132,6 @@ struct compat_tms {compat_clock_t tms_cstime; }; -struct compat_timex { -compat_uint_t modes; -compat_long_t offset; -compat_long_t freq; -compat_long_t maxerror; -compat_long_t esterror; -compat_int_t status; -compat_long_t constant; -compat_long_t precision; -compat_long_t tolerance; -struct old_timeval32 time; -compat_long_t tick; -compat_long_t ppsfreq; -compat_long_t jitter; -compat_int_t shift; -compat_long_t stabil; -compat_long_t jitcnt; -compat_long_t calcnt; -compat_long_t errcnt; -compat_long_t stbcnt; -compat_int_t tai; - - compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32; - compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32; - compat_int_t:32; compat_int_t:32; compat_int_t:32; -}; - -struct timex ; -int compat_get_timex (struct timex *,const struct compat_timex __user *); -int compat_put_timex (struct compat_timex __user *,const struct timex *); -#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) typedef struct {
@@ -808,7 +777,7 @@ asmlinkage long compat_sys_gettimeofday(struct old_timeval32 __user *tv, struct timezone __user *tz);asmlinkage long compat_sys_settimeofday (struct old_timeval32 __user *tv,struct timezone __user *tz); -asmlinkage long compat_sys_adjtimex (struct compat_timex __user *utp); +asmlinkage long compat_sys_adjtimex (struct old_timex32 __user *utp);/* kernel/timer.c */ asmlinkage long compat_sys_sysinfo (struct compat_sysinfo __user *info);
@@ -911,7 +880,7 @@ asmlinkage long compat_sys_open_by_handle_at(int mountdirfd,struct file_handle __user *handle, int flags);asmlinkage long compat_sys_clock_adjtime (clockid_t which_clock, -struct compat_timex __user *tp); +struct old_timex32 __user *tp);asmlinkage long compat_sys_sendmmsg (int fd,struct compat_mmsghdr __user *mmsg,unsigned vlen,unsigned int flags); asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid,
include/linux/time32.h +31 -1
@@ -10,6 +10,7 @@*/ #include <linux/time64.h> +#include <linux/timex.h> #define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)
@@ -35,13 +36,42 @@ struct old_utimbuf32 {old_time32_t modtime; }; +struct old_timex32 { +u32 modes; +s32 offset; +s32 freq; +s32 maxerror; +s32 esterror; +s32 status; +s32 constant; +s32 precision; +s32 tolerance; +struct old_timeval32 time; +s32 tick; +s32 ppsfreq; +s32 jitter; +s32 shift; +s32 stabil; +s32 jitcnt; +s32 calcnt; +s32 errcnt; +s32 stbcnt; +s32 tai; + + s32:32; s32:32; s32:32; s32:32; + s32:32; s32:32; s32:32; s32:32; + s32:32; s32:32; s32:32; +}; +extern int get_old_timespec32 (struct timespec64 *,const void __user *);extern int put_old_timespec32 (const struct timespec64 *,void __user *);extern int get_old_itimerspec32 (struct itimerspec64 *its,const struct old_itimerspec32 __user *uits);extern int put_old_itimerspec32 (const struct itimerspec64 *its,struct old_itimerspec32 __user *uits); - +struct timex ; +int get_old_timex32 (struct timex *,const struct old_timex32 __user *); +int put_old_timex32 (struct old_timex32 __user *,const struct timex *);#if __BITS_PER_LONG ==64
kernel/compat.c +0 -64
76 lines not on this page · raw message
kernel/time/posix-timers.c +3 -11
@@ -1123,12 +1123,8 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,return err; } -#endif - -#ifdef CONFIG_COMPAT -COMPAT_SYSCALL_DEFINE2 (clock_adjtime, clockid_t, which_clock, - struct compat_timex __user *, utp) + struct old_timex32 __user *, utp) {const struct k_clock *kc =clockid_to_kclock (which_clock);struct timex ktx;
@@ -1139,22 +1135,18 @@ COMPAT_SYSCALL_DEFINE2(clock_adjtime, clockid_t, which_clock,if (!kc->clock_adj)return -EOPNOTSUPP ; - err =compat_get_timex (&ktx, utp); + err =get_old_timex32 (&ktx, utp);if (err)return err; err = kc->clock_adj (which_clock, &ktx);if (err >=0 ) - err =compat_put_timex (utp, &ktx); + err =put_old_timex32 (utp, &ktx);return err; } -#endif - -#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE2 (clock_getres, clockid_t, which_clock, struct old_timespec32 __user *, tp) {
kernel/time/time.c +66 -4
86 lines not on this page · raw message
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 19/29 time: Add struct __kernel_timex
In reply to Arnd BergmannFrom: Deepa Dinamani <[email protected]>
struct timex uses struct timeval internally. struct timeval is not y2038 safe.
Introduce a new UAPI type struct __kernel_timex that is y2038 safe.
struct __kernel_timex uses a timeval type that is similar to struct __kernel_timespec which preserves the same structure size across 32 bit and 64 bit ABIs. struct __kernel_timex also restructures other members of the structure to make the structure the same on 64 bit and 32 bit architectures.
Note that struct __kernel_timex is the same as struct timex on a 64 bit architecture.
The above solution is similar to other new y2038 syscalls that are being introduced: both 32 bit and 64 bit ABIs have a common entry, and the compat entry supports the old 32 bit syscall interface.
Alternatives considered were:
1. Add new time type to struct timex that makes use of padded bits. This time type could be based on the struct __kernel_timespec. modes will use a flag to notify which time structure should be used internally.
This needs some application level changes on both 64 bit and 32 bit architectures. Although 64 bit machines could continue to use the older timeval structure without any changes.
2. Add a new u8 type to struct timex that makes use of padded bits. This can be used to save higher order tv_sec bits. modes will use a flag to notify presence of such a type.
This will need some application level changes on 32 bit architectures.
3. Add a new compat_timex structure that differs in only the size of the time type; keep rest of struct timex the same.
This requires extra syscalls to manage all 3 cases on 64 bit architectures. This will not need any application level changes but will add more complexity from kernel side.
--- include/linux/timex.h | 7 +++++++ include/uapi/linux/timex.h | 41 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+)
include/linux/timex.h +7 -0
@@ -53,6 +53,13 @@#ifndef _LINUX_TIMEX_H#define _LINUX_TIMEX_H +/* CONFIG_64BIT_TIME enables new 64 bit time_t syscalls in the compat path +* and 32-bit emulation. +*/ +#ifndef CONFIG_64BIT_TIME +#define __kernel_timex timex +#endif +#include <uapi/linux/timex.h> #define ADJ_ADJTIME 0x8000/* switch between adjtime/adjtimex modes */
include/uapi/linux/timex.h +41 -0
47 lines not on this page · raw message
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 20/29 time: fix sys_timer_settime prototype
In reply to Arnd BergmannA small typo has crept into the y2038 conversion of the timer_settime system call. So far this was completely harmless, but once we start using the new version, this has to be fixed.
--- include/linux/syscalls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/syscalls.h +1 -1
@@ -591,7 +591,7 @@ asmlinkage long sys_timer_gettime(timer_t timer_id,asmlinkage long sys_timer_getoverrun (timer_t timer_id);asmlinkage long sys_timer_settime (timer_t timer_id,int flags,const struct __kernel_itimerspec __user *new_setting, -struct itimerspec __user *old_setting); +struct __kernel_itimerspec __user *old_setting);asmlinkage long sys_timer_delete (timer_t timer_id);asmlinkage long sys_clock_settime (clockid_t which_clock,const struct __kernel_timespec __user *tp);
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 21/29 sparc64: add custom adjtimex/clock_adjtime functions
In reply to Arnd Bergmannsparc64 is the only architecture on Linux that has a 'timeval' definition with a 32-bit tv_usec but a 64-bit tv_sec. This causes problems for sparc32 compat mode when we convert it to use the new __kernel_timex type that has the same layout as all other 64-bit architectures.
To avoid adding sparc64 specific code into the generic adjtimex implementation, this adds a wrapper in the sparc64 system call handling that converts the sparc64 'timex' into the new '__kernel_timex'.
At this point, the two structures are defined to be identical, but that will change in the next step once we convert sparc32.
--- arch/sparc/kernel/sys_sparc_64.c | 59 +++++++++++++++++++++++++- arch/sparc/kernel/syscalls/syscall.tbl | 6 ++- include/linux/timex.h | 2 + kernel/time/posix-timers.c | 24 +++++------ 4 files changed, 76 insertions(+), 15 deletions(-)
arch/sparc/kernel/sys_sparc_64.c +58 -1
@@ -28,8 +28,9 @@#include <linux/random.h> #include <linux/export.h> #include <linux/context_tracking.h> - +#include <linux/timex.h> #include <linux/uaccess.h> +#include <asm/utrap.h> #include <asm/unistd.h>
@@ -544,6 +545,62 @@ SYSCALL_DEFINE2(getdomainname, char __user *, name, int, len)return err; } +SYSCALL_DEFINE1(sparc_adjtimex, struct timex __user *, txc_p) +{ +struct timex txc;/* Local copy of parameter */ +struct timex *kt = (void *)&txc; +int ret; + +/* Copy the user data space into the kernel copy +* structure. But bear in mind that the structures +* may change +*/ +if (copy_from_user (&txc, txc_p,sizeof (struct timex ))) +return -EFAULT ; + +/* +* override for sparc64 specific timeval type: tv_usec +* is 32 bit wide instead of 64-bit in __kernel_timex +*/ + kt->time.tv_usec = txc.time.tv_usec; + ret =do_adjtimex (kt); + txc.time.tv_usec = kt->time.tv_usec; + +return copy_to_user (txc_p, &txc,sizeof (struct timex )) ? -EFAULT : ret; +} + +SYSCALL_DEFINE2(sparc_clock_adjtime, const clockid_t, which_clock,struct timex __user *, txc_p) +{ +struct timex txc;/* Local copy of parameter */ +struct timex *kt = (void *)&txc; +int ret; + +if (!IS_ENABLED (CONFIG_POSIX_TIMERS )) { +pr_err_once ("process %d (%s) attempted a POSIX timer syscall " +"while CONFIG_POSIX_TIMERS is not set\n" , + current->pid, current->comm); + +return -ENOSYS ; + } + +/* Copy the user data space into the kernel copy +* structure. But bear in mind that the structures +* may change +*/ +if (copy_from_user (&txc, txc_p,sizeof (struct timex ))) +return -EFAULT ; + +/* +* override for sparc64 specific timeval type: tv_usec +* is 32 bit wide instead of 64-bit in __kernel_timex +*/ + kt->time.tv_usec = txc.time.tv_usec; + ret =do_clock_adjtime (which_clock, kt); + txc.time.tv_usec = kt->time.tv_usec; + +return copy_to_user (txc_p, &txc,sizeof (struct timex )) ? -EFAULT : ret; +} + SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type, utrap_handler_t, new_p, utrap_handler_t, new_d, utrap_handler_t __user *, old_p,
arch/sparc/kernel/syscalls/syscall.tbl +4 -2
@@ -258,7 +258,8 @@ 216 64 sigreturn sys_nis_syscall 217 common clone sys_clone 218 common ioprio_get sys_ioprio_get -219 common adjtimex sys_adjtimex compat_sys_adjtimex +219 32 adjtimex sys_adjtimex compat_sys_adjtimex +219 64 adjtimex sys_sparc_adjtimex 220 32 sigprocmask sys_sigprocmask compat_sys_sigprocmask 220 64 sigprocmask sys_nis_syscall 221 common create_module sys_ni_syscall
@@ -377,7 +378,8 @@ 331 common prlimit64 sys_prlimit64 332 common name_to_handle_at sys_name_to_handle_at 333 common open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at -334 common clock_adjtime sys_clock_adjtime compat_sys_clock_adjtime +334 32 clock_adjtime sys_clock_adjtime compat_sys_clock_adjtime +334 64 clock_adjtime sys_sparc_clock_adjtime 335 common syncfs sys_syncfs 336 common sendmmsg sys_sendmmsg compat_sys_sendmmsg 337 common setns sys_setns
include/linux/timex.h +2 -0
@@ -159,6 +159,8 @@ extern unsigned long tick_nsec; /* SHIFTED_HZ period (nsec) */#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ)extern int do_adjtimex (struct timex *); +extern int do_clock_adjtime (const clockid_t which_clock,struct timex * ktx); +extern void hardpps (const struct timespec64 *,const struct timespec64 *);int read_current_timer (unsigned long *timer_val);
kernel/time/posix-timers.c +12 -12
@@ -1047,22 +1047,28 @@ SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,return error; } -SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock, - struct timex __user *, utx) +int do_clock_adjtime (const clockid_t which_clock,struct timex * ktx) {const struct k_clock *kc =clockid_to_kclock (which_clock); -struct timex ktx; -int err;if (!kc)return -EINVAL ;if (!kc->clock_adj)return -EOPNOTSUPP ; +return kc->clock_adj (which_clock, ktx); +} + +SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock, + struct timex __user *, utx) +{ +struct timex ktx; +int err; +if (copy_from_user (&ktx, utx,sizeof (ktx)))return -EFAULT ; - err = kc->clock_adj (which_clock, &ktx); + err =do_clock_adjtime (which_clock, &ktx);if (err >=0 &©_to_user (utx, &ktx,sizeof (ktx)))return -EFAULT ;
@@ -1126,20 +1132,14 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,COMPAT_SYSCALL_DEFINE2 (clock_adjtime, clockid_t, which_clock, struct old_timex32 __user *, utp) { -const struct k_clock *kc =clockid_to_kclock (which_clock);struct timex ktx;int err; -if (!kc) -return -EINVAL ; -if (!kc->clock_adj) -return -EOPNOTSUPP ; - err =get_old_timex32 (&ktx, utp);if (err)return err; - err = kc->clock_adj (which_clock, &ktx); + err =do_clock_adjtime (which_clock, &ktx);if (err >=0 ) err =put_old_timex32 (utp, &ktx);
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 22/29 timex: use __kernel_timex internally
In reply to Arnd BergmannFrom: Deepa Dinamani <[email protected]>
struct timex is not y2038 safe.
Replace all uses of timex with y2038 safe __kernel_timex.
Note that struct __kernel_timex is an ABI interface definition. We could define a new structure based on __kernel_timex that is only available internally instead. Right now, there isn't a strong motivation for this as the structure is isolated to a few defined struct timex interfaces and such a structure would be exactly the same as struct timex.
The patch was generated by the following coccinelle script:
virtual patch
@depends on patch forall@
identifier ts;
expression e;
@@
(
- struct timex ts;
+ struct __kernel_timex ts;
|
- struct timex ts = {};
+ struct __kernel_timex ts = {};
|
- struct timex ts = e;
+ struct __kernel_timex ts = e;
|
- struct timex *ts;
+ struct __kernel_timex *ts;
|
(memset \| copy_from_user \| copy_to_user \)(...,
- sizeof(struct timex))
+ sizeof(struct __kernel_timex))
)
@depends on patch forall@
identifier ts;
identifier fn;
@@
fn(...,
- struct timex *ts,
+ struct __kernel_timex *ts,
...) {
...
}
@depends on patch forall@
identifier ts;
identifier fn;
@@
fn(...,
- struct timex *ts) {
+ struct __kernel_timex *ts) {
...
}
--- arch/alpha/kernel/osf_sys.c | 5 +++-- arch/sparc/kernel/sys_sparc_64.c | 4 ++-- drivers/ptp/ptp_clock.c | 2 +- include/linux/posix-clock.h | 2 +- include/linux/time32.h | 6 +++--- include/linux/timex.h | 4 ++-- kernel/time/ntp.c | 18 ++++++++++-------- kernel/time/ntp_internal.h | 2 +- kernel/time/posix-clock.c | 2 +- kernel/time/posix-timers.c | 8 ++++---- kernel/time/posix-timers.h | 2 +- kernel/time/time.c | 14 +++++++------- kernel/time/timekeeping.c | 4 ++-- 13 files changed, 38 insertions(+), 35 deletions(-)
arch/alpha/kernel/osf_sys.c +3 -2
@@ -1253,7 +1253,7 @@ struct timex32 { SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p) { -struct timex txc; +struct __kernel_timex txc;int ret;/* copy relevant bits of struct timex. */
@@ -1270,7 +1270,8 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)if (copy_to_user (txc_p, &txc, offsetof(struct timex32 , time)) || (copy_to_user (&txc_p->tick, &txc.tick,sizeof (struct timex32 ) - offsetof(struct timex32 , tick))) || - (put_tv_to_tv32 (&txc_p->time, &txc.time))) + (put_user (txc.time.tv_sec, &txc_p->time.tv_sec)) || + (put_user (txc.time.tv_usec, &txc_p->time.tv_usec)))return -EFAULT ;return ret;
arch/sparc/kernel/sys_sparc_64.c +2 -2
@@ -548,7 +548,7 @@ SYSCALL_DEFINE2(getdomainname, char __user *, name, int, len) SYSCALL_DEFINE1(sparc_adjtimex, struct timex __user *, txc_p) {struct timex txc;/* Local copy of parameter */ -struct timex *kt = (void *)&txc; +struct __kernel_timex *kt = (void *)&txc;int ret;/* Copy the user data space into the kernel copy
@@ -572,7 +572,7 @@ SYSCALL_DEFINE1(sparc_adjtimex, struct timex __user *, txc_p) SYSCALL_DEFINE2(sparc_clock_adjtime, const clockid_t, which_clock,struct timex __user *, txc_p) {struct timex txc;/* Local copy of parameter */ -struct timex *kt = (void *)&txc; +struct __kernel_timex *kt = (void *)&txc;int ret;if (!IS_ENABLED (CONFIG_POSIX_TIMERS )) {
drivers/ptp/ptp_clock.c +1 -1
@@ -124,7 +124,7 @@ static int ptp_clock_gettime(struct posix_clock *pc, struct timespec64 *tp)return err; } -static int ptp_clock_adjtime (struct posix_clock *pc,struct timex *tx) +static int ptp_clock_adjtime (struct posix_clock *pc,struct __kernel_timex *tx) { struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);struct ptp_clock_info *ops;
include/linux/posix-clock.h +1 -1
@@ -51,7 +51,7 @@ struct posix_clock;struct posix_clock_operations {struct module *owner; -int (*clock_adjtime)(struct posix_clock *pc,struct timex *tx); +int (*clock_adjtime)(struct posix_clock *pc,struct __kernel_timex *tx);int (*clock_gettime)(struct posix_clock *pc,struct timespec64 *ts);
include/linux/time32.h +3 -3
@@ -69,9 +69,9 @@ extern int get_old_itimerspec32(struct itimerspec64 *its, const struct old_itimerspec32 __user *uits);extern int put_old_itimerspec32 (const struct itimerspec64 *its,struct old_itimerspec32 __user *uits); -struct timex ; -int get_old_timex32 (struct timex *,const struct old_timex32 __user *); -int put_old_timex32 (struct old_timex32 __user *,const struct timex *); +struct __kernel_timex ; +int get_old_timex32 (struct __kernel_timex *,const struct old_timex32 __user *); +int put_old_timex32 (struct old_timex32 __user *,const struct __kernel_timex *);#if __BITS_PER_LONG ==64
include/linux/timex.h +2 -2
@@ -158,8 +158,8 @@ extern unsigned long tick_nsec; /* SHIFTED_HZ period (nsec) */#define NTP_INTERVAL_FREQ (HZ)#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) -extern int do_adjtimex (struct timex *); -extern int do_clock_adjtime (const clockid_t which_clock,struct timex * ktx); +extern int do_adjtimex (struct __kernel_timex *); +extern int do_clock_adjtime (const clockid_t which_clock,struct __kernel_timex * ktx);extern void hardpps (const struct timespec64 *,const struct timespec64 *);
kernel/time/ntp.c +10 -8
@@ -188,13 +188,13 @@ static inline int is_error_status(int status) && (status & (STA_PPSWANDER|STA_PPSERROR))); } -static inline void pps_fill_timex (struct timex *txc) +static inline void pps_fill_timex (struct __kernel_timex *txc) { txc->ppsfreq =shift_right ((pps_freq >>PPM_SCALE_INV_SHIFT ) *PPM_SCALE_INV ,NTP_SCALE_SHIFT ); txc->jitter = pps_jitter;if (!(time_status &STA_NANO )) - txc->jitter /=NSEC_PER_USEC ; + txc->jitter = pps_jitter /NSEC_PER_USEC ; txc->shift = pps_shift; txc->stabil = pps_stabil; txc->jitcnt = pps_jitcnt;
@@ -220,7 +220,7 @@ static inline int is_error_status(int status)return status & (STA_UNSYNC |STA_CLOCKERR ); } -static inline void pps_fill_timex (struct timex *txc) +static inline void pps_fill_timex (struct __kernel_timex *txc) {/* PPS is not implemented, so these are zero */ txc->ppsfreq =0 ;
@@ -633,7 +633,7 @@ void ntp_notify_cmos_timer(void)/* * Propagate a new txc->status value into the NTP state: */ -static inline void process_adj_status (const struct timex *txc) +static inline void process_adj_status (const struct __kernel_timex *txc) {if ((time_status &STA_PLL ) && !(txc->status &STA_PLL )) { time_state =TIME_OK ;
@@ -656,7 +656,8 @@ static inline void process_adj_status(const struct timex *txc) } -static inline void process_adjtimex_modes (const struct timex *txc,s32 *time_tai) +static inline void process_adjtimex_modes (const struct __kernel_timex *txc, +s32 *time_tai) {if (txc->modes &ADJ_STATUS )process_adj_status (txc);
@@ -707,7 +708,8 @@ static inline void process_adjtimex_modes(const struct timex *txc, s32 *time_tai* adjtimex mainly allows reading (and writing, if superuser) of * kernel time-keeping variables. used by xntpd. */ -int __do_adjtimex (struct timex *txc,const struct timespec64 *ts,s32 *time_tai) +int __do_adjtimex (struct __kernel_timex *txc,const struct timespec64 *ts, +s32 *time_tai) {int result;
@@ -729,7 +731,7 @@ int __do_adjtimex(struct timex *txc, const struct timespec64 *ts, s32 *time_tai) txc->offset =shift_right (time_offset *NTP_INTERVAL_FREQ ,NTP_SCALE_SHIFT );if (!(time_status &STA_NANO )) - txc->offset /=NSEC_PER_USEC ; + txc->offset = (u32 )txc->offset /NSEC_PER_USEC ; } result = time_state;/* mostly `TIME_OK' */
@@ -754,7 +756,7 @@ int __do_adjtimex(struct timex *txc, const struct timespec64 *ts, s32 *time_tai) txc->time.tv_sec = (time_t )ts->tv_sec; txc->time.tv_usec = ts->tv_nsec;if (!(time_status &STA_NANO )) - txc->time.tv_usec /=NSEC_PER_USEC ; + txc->time.tv_usec = ts->tv_nsec /NSEC_PER_USEC ;/* Handle leapsec adjustments */ if (unlikely (ts->tv_sec >= ntp_next_leap_sec)) {
kernel/time/ntp_internal.h +1 -1
@@ -8,6 +8,6 @@ extern void ntp_clear(void);extern u64 ntp_tick_length (void );extern ktime_t ntp_get_next_leap (void );extern int second_overflow (time64_t secs); -extern int __do_adjtimex (struct timex *txc,const struct timespec64 *ts,s32 *time_tai); +extern int __do_adjtimex (struct __kernel_timex *txc,const struct timespec64 *ts,s32 *time_tai);extern void __hardpps (const struct timespec64 *phase_ts,const struct timespec64 *raw_ts);#endif /* _LINUX_NTP_INTERNAL_H */
kernel/time/posix-clock.c +1 -1
@@ -228,7 +228,7 @@ static void put_clock_desc(struct posix_clock_desc *cd)fput (cd->fp); } -static int pc_clock_adjtime (clockid_t id,struct timex *tx) +static int pc_clock_adjtime (clockid_t id,struct __kernel_timex *tx) {struct posix_clock_desc cd;int err;
kernel/time/posix-timers.c +4 -4
@@ -179,7 +179,7 @@ static int posix_clock_realtime_set(const clockid_t which_clock, }static int posix_clock_realtime_adj (const clockid_t which_clock, -struct timex *t) +struct __kernel_timex *t) {return do_adjtimex (t); }
@@ -1047,7 +1047,7 @@ SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,return error; } -int do_clock_adjtime (const clockid_t which_clock,struct timex * ktx) +int do_clock_adjtime (const clockid_t which_clock,struct __kernel_timex * ktx) {const struct k_clock *kc =clockid_to_kclock (which_clock);
@@ -1062,7 +1062,7 @@ int do_clock_adjtime(const clockid_t which_clock, struct timex * ktx) SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock, struct timex __user *, utx) { -struct timex ktx; +struct __kernel_timex ktx;int err;if (copy_from_user (&ktx, utx,sizeof (ktx)))
@@ -1132,7 +1132,7 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,COMPAT_SYSCALL_DEFINE2 (clock_adjtime, clockid_t, which_clock, struct old_timex32 __user *, utp) { -struct timex ktx; +struct __kernel_timex ktx;int err; err =get_old_timex32 (&ktx, utp);
kernel/time/posix-timers.h +1 -1
@@ -8,7 +8,7 @@ struct k_clock { const struct timespec64 *tp);int (*clock_get)(const clockid_t which_clock,struct timespec64 *tp); -int (*clock_adj)(const clockid_t which_clock,struct timex *tx); +int (*clock_adj)(const clockid_t which_clock,struct __kernel_timex *tx);int (*timer_create)(struct k_itimer *timer);int (*nsleep)(const clockid_t which_clock,int flags,const struct timespec64 *);
kernel/time/time.c +7 -7
@@ -265,25 +265,25 @@ COMPAT_SYSCALL_DEFINE2(settimeofday, struct old_timeval32 __user *, tv, SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) { -struct timex txc;/* Local copy of parameter */ +struct __kernel_timex txc;/* Local copy of parameter */ int ret;/* Copy the user data space into the kernel copy * structure. But bear in mind that the structures * may change */ -if (copy_from_user (&txc, txc_p,sizeof (struct timex ))) +if (copy_from_user (&txc, txc_p,sizeof (struct __kernel_timex )))return -EFAULT ; ret =do_adjtimex (&txc); -return copy_to_user (txc_p, &txc,sizeof (struct timex )) ? -EFAULT : ret; +return copy_to_user (txc_p, &txc,sizeof (struct __kernel_timex )) ? -EFAULT : ret; }#ifdef CONFIG_COMPAT_32BIT_TIME -int get_old_timex32 (struct timex *txc,const struct old_timex32 __user *utp) +int get_old_timex32 (struct __kernel_timex *txc,const struct old_timex32 __user *utp) {struct old_timex32 tx32; -memset (txc,0 ,sizeof (struct timex )); +memset (txc,0 ,sizeof (struct __kernel_timex ));if (copy_from_user (&tx32, utp,sizeof (struct old_timex32 )))return -EFAULT ;
@@ -311,7 +311,7 @@ int get_old_timex32(struct timex *txc, const struct old_timex32 __user *utp)return 0 ; } -int put_old_timex32 (struct old_timex32 __user *utp,const struct timex *txc) +int put_old_timex32 (struct old_timex32 __user *utp,const struct __kernel_timex *txc) {struct old_timex32 tx32;
@@ -344,7 +344,7 @@ int put_old_timex32(struct old_timex32 __user *utp, const struct timex *txc) COMPAT_SYSCALL_DEFINE1(adjtimex, struct old_timex32 __user *, utp) { -struct timex txc; +struct __kernel_timex txc;int err, ret; err =get_old_timex32 (&txc, utp);
kernel/time/timekeeping.c +2 -2
@@ -2234,7 +2234,7 @@ ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,/** * timekeeping_validate_timex - Ensures the timex is ok for use in do_adjtimex */ -static int timekeeping_validate_timex (const struct timex *txc) +static int timekeeping_validate_timex (const struct __kernel_timex *txc) {if (txc->modes &ADJ_ADJTIME ) {/* singleshot must not be used with any other mode bits */
@@ -2300,7 +2300,7 @@ static int timekeeping_validate_timex(const struct timex *txc)/** * do_adjtimex() - Accessor function to NTP __do_adjtimex function */ -int do_adjtimex (struct timex *txc) +int do_adjtimex (struct __kernel_timex *txc) {struct timekeeper *tk = &tk_core.timekeeper;unsigned long flags;
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 23/29 timex: change syscalls to use struct __kernel_timex
In reply to Arnd BergmannFrom: Deepa Dinamani <[email protected]>
struct timex is not y2038 safe.
Switch all the syscall apis to use y2038 safe __kernel_timex.
Note that sys_adjtimex() does not have a y2038 safe solution. C libraries can implement it by calling clock_adjtime(CLOCK_REALTIME, ...).
--- include/linux/syscalls.h | 6 +++--- kernel/time/posix-timers.c | 2 +- kernel/time/time.c | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-)
include/linux/syscalls.h +3 -3
@@ -54,7 +54,7 @@ struct __sysctl_args;struct sysinfo ;struct timespec ;struct timeval ; -struct timex ; +struct __kernel_timex ;struct timezone ;struct tms ;struct utimbuf ;
@@ -695,7 +695,7 @@ asmlinkage long sys_gettimeofday(struct timeval __user *tv, struct timezone __user *tz);asmlinkage long sys_settimeofday (struct timeval __user *tv,struct timezone __user *tz); -asmlinkage long sys_adjtimex (struct timex __user *txc_p); +asmlinkage long sys_adjtimex (struct __kernel_timex __user *txc_p);/* kernel/timer.c */ asmlinkage long sys_getpid (void );
@@ -870,7 +870,7 @@ asmlinkage long sys_open_by_handle_at(int mountdirfd,struct file_handle __user *handle, int flags);asmlinkage long sys_clock_adjtime (clockid_t which_clock, -struct timex __user *tx); +struct __kernel_timex __user *tx);asmlinkage long sys_syncfs (int fd);asmlinkage long sys_setns (int fd,int nstype); asmlinkage long sys_sendmmsg(int fd, struct mmsghdr __user *msg,
kernel/time/posix-timers.c +1 -1
@@ -1060,7 +1060,7 @@ int do_clock_adjtime(const clockid_t which_clock, struct __kernel_timex * ktx) } SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock, - struct timex __user *, utx) + struct __kernel_timex __user *, utx) {struct __kernel_timex ktx;int err;
kernel/time/time.c +3 -1
@@ -263,7 +263,8 @@ COMPAT_SYSCALL_DEFINE2(settimeofday, struct old_timeval32 __user *, tv, }#endif -SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) +#if !defined(CONFIG_64BIT_TIME ) || defined(CONFIG_64BIT ) +SYSCALL_DEFINE1(adjtimex, struct __kernel_timex __user *, txc_p) {struct __kernel_timex txc;/* Local copy of parameter */ int ret;
@@ -277,6 +278,7 @@ SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) ret =do_adjtimex (&txc); return copy_to_user(txc_p, &txc, sizeof(struct __kernel_timex)) ? -EFAULT : ret; } +#endif #ifdef CONFIG_COMPAT_32BIT_TIME int get_old_timex32 (struct __kernel_timex *txc,const struct old_timex32 __user *utp)
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 24/29 x86/x32: use time64 versions of sigtimedwait and recvmmsg
In reply to Arnd Bergmannx32 has always followed the time64 calling conventions of these syscalls, which required a special hack in compat_get_timespec aka get_old_timespec32 to continue working.
Since we now have the time64 syscalls, use those explicitly.
--- arch/x86/entry/syscalls/syscall_64.tbl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/entry/syscalls/syscall_64.tbl +2 -2
@@ -361,7 +361,7 @@ 520 x32 execve __x32_compat_sys_execve/ptregs 521 x32 ptrace __x32_compat_sys_ptrace 522 x32 rt_sigpending __x32_compat_sys_rt_sigpending -523 x32 rt_sigtimedwait __x32_compat_sys_rt_sigtimedwait +523 x32 rt_sigtimedwait __x32_compat_sys_rt_sigtimedwait_time64 524 x32 rt_sigqueueinfo __x32_compat_sys_rt_sigqueueinfo 525 x32 sigaltstack __x32_compat_sys_sigaltstack 526 x32 timer_create __x32_compat_sys_timer_create
@@ -375,7 +375,7 @@ 534 x32 preadv __x32_compat_sys_preadv64 535 x32 pwritev __x32_compat_sys_pwritev64 536 x32 rt_tgsigqueueinfo __x32_compat_sys_rt_tgsigqueueinfo -537 x32 recvmmsg __x32_compat_sys_recvmmsg +537 x32 recvmmsg __x32_compat_sys_recvmmsg_time64 538 x32 sendmmsg __x32_compat_sys_sendmmsg 539 x32 process_vm_readv __x32_compat_sys_process_vm_readv 540 x32 process_vm_writev __x32_compat_sys_process_vm_writev
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 25/29 y2038: syscalls: rename y2038 compat syscalls
In reply to Arnd BergmannA lot of system calls that pass a time_t somewhere have an implementation using a COMPAT_SYSCALL_DEFINEx() on 64-bit architectures, and have been reworked so that this implementation can now be used on 32-bit architectures as well.
The missing step is to redefine them using the regular SYSCALL_DEFINEx() to get them out of the compat namespace and make it possible to build them on 32-bit architectures.
Any system call that ends in 'time' gets a '32' suffix on its name for that version, while the others get a '_time32' suffix, to distinguish them from the normal version, which takes a 64-bit time argument in the future.
In this step, only 64-bit architectures are changed, doing this rename first lets us avoid touching the 32-bit architectures twice.
--- arch/arm64/include/asm/unistd32.h | 48 +++++++-------- arch/mips/kernel/syscalls/syscall_n32.tbl | 50 ++++++++-------- arch/mips/kernel/syscalls/syscall_o32.tbl | 52 ++++++++-------- arch/parisc/kernel/syscalls/syscall.tbl | 54 ++++++++--------- arch/powerpc/kernel/syscalls/syscall.tbl | 52 ++++++++-------- arch/s390/kernel/syscalls/syscall.tbl | 52 ++++++++-------- arch/sparc/kernel/syscalls/syscall.tbl | 52 ++++++++-------- arch/x86/entry/syscalls/syscall_32.tbl | 52 ++++++++-------- fs/aio.c | 10 ++-- fs/select.c | 4 +- fs/timerfd.c | 4 +- fs/utimes.c | 10 ++-- include/linux/compat.h | 73 ++--------------------- include/linux/syscalls.h | 57 ++++++++++++++++++ include/uapi/asm-generic/unistd.h | 44 +++++++------- ipc/mqueue.c | 16 ++--- ipc/sem.c | 2 +- kernel/futex.c | 2 +- kernel/sched/core.c | 5 +- kernel/signal.c | 2 +- kernel/sys_ni.c | 18 +++--- kernel/time/hrtimer.c | 2 +- kernel/time/posix-stubs.c | 25 ++++---- kernel/time/posix-timers.c | 32 +++++----- kernel/time/time.c | 8 +-- net/compat.c | 2 +- 26 files changed, 361 insertions(+), 367 deletions(-)
arch/arm64/include/asm/unistd32.h +24 -24
@@ -270,7 +270,7 @@ __SYSCALL(__NR_uname, sys_newuname)/* 123 was sys_modify_ldt */ __SYSCALL(123, sys_ni_syscall)#define __NR_adjtimex 124 -__SYSCALL(__NR_adjtimex, compat_sys_adjtimex) +__SYSCALL(__NR_adjtimex, sys_adjtimex_time32)#define __NR_mprotect 125 __SYSCALL(__NR_mprotect, sys_mprotect)#define __NR_sigprocmask 126
@@ -344,9 +344,9 @@ __SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max)#define __NR_sched_get_priority_min 160 __SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min)#define __NR_sched_rr_get_interval 161 -__SYSCALL(__NR_sched_rr_get_interval, compat_sys_sched_rr_get_interval) +__SYSCALL(__NR_sched_rr_get_interval, sys_sched_rr_get_interval_time32)#define __NR_nanosleep 162 -__SYSCALL(__NR_nanosleep, compat_sys_nanosleep) +__SYSCALL(__NR_nanosleep, sys_nanosleep_time32)#define __NR_mremap 163 __SYSCALL(__NR_mremap, sys_mremap)#define __NR_setresuid 164
@@ -376,7 +376,7 @@ __SYSCALL(__NR_rt_sigprocmask, compat_sys_rt_sigprocmask)#define __NR_rt_sigpending 176 __SYSCALL(__NR_rt_sigpending, compat_sys_rt_sigpending)#define __NR_rt_sigtimedwait 177 -__SYSCALL(__NR_rt_sigtimedwait, compat_sys_rt_sigtimedwait) +__SYSCALL(__NR_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time32)#define __NR_rt_sigqueueinfo 178 __SYSCALL(__NR_rt_sigqueueinfo, compat_sys_rt_sigqueueinfo)#define __NR_rt_sigsuspend 179
@@ -502,7 +502,7 @@ __SYSCALL(__NR_tkill, sys_tkill)#define __NR_sendfile64 239 __SYSCALL(__NR_sendfile64, sys_sendfile64)#define __NR_futex 240 -__SYSCALL(__NR_futex, compat_sys_futex) +__SYSCALL(__NR_futex, sys_futex_time32)#define __NR_sched_setaffinity 241 __SYSCALL(__NR_sched_setaffinity, compat_sys_sched_setaffinity)#define __NR_sched_getaffinity 242
@@ -512,7 +512,7 @@ __SYSCALL(__NR_io_setup, compat_sys_io_setup)#define __NR_io_destroy 244 __SYSCALL(__NR_io_destroy, sys_io_destroy)#define __NR_io_getevents 245 -__SYSCALL(__NR_io_getevents, compat_sys_io_getevents) +__SYSCALL(__NR_io_getevents, sys_io_getevents_time32)#define __NR_io_submit 246 __SYSCALL(__NR_io_submit, compat_sys_io_submit)#define __NR_io_cancel 247
@@ -538,21 +538,21 @@ __SYSCALL(__NR_set_tid_address, sys_set_tid_address)#define __NR_timer_create 257 __SYSCALL(__NR_timer_create, compat_sys_timer_create)#define __NR_timer_settime 258 -__SYSCALL(__NR_timer_settime, compat_sys_timer_settime) +__SYSCALL(__NR_timer_settime, sys_timer_settime32)#define __NR_timer_gettime 259 -__SYSCALL(__NR_timer_gettime, compat_sys_timer_gettime) +__SYSCALL(__NR_timer_gettime, sys_timer_gettime32)#define __NR_timer_getoverrun 260 __SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun)#define __NR_timer_delete 261 __SYSCALL(__NR_timer_delete, sys_timer_delete)#define __NR_clock_settime 262 -__SYSCALL(__NR_clock_settime, compat_sys_clock_settime) +__SYSCALL(__NR_clock_settime, sys_clock_settime32)#define __NR_clock_gettime 263 -__SYSCALL(__NR_clock_gettime, compat_sys_clock_gettime) +__SYSCALL(__NR_clock_gettime, sys_clock_gettime32)#define __NR_clock_getres 264 -__SYSCALL(__NR_clock_getres, compat_sys_clock_getres) +__SYSCALL(__NR_clock_getres, sys_clock_getres_time32)#define __NR_clock_nanosleep 265 -__SYSCALL(__NR_clock_nanosleep, compat_sys_clock_nanosleep) +__SYSCALL(__NR_clock_nanosleep, sys_clock_nanosleep_time32)#define __NR_statfs64 266 __SYSCALL(__NR_statfs64, compat_sys_aarch32_statfs64)#define __NR_fstatfs64 267
@@ -560,7 +560,7 @@ __SYSCALL(__NR_fstatfs64, compat_sys_aarch32_fstatfs64)#define __NR_tgkill 268 __SYSCALL(__NR_tgkill, sys_tgkill)#define __NR_utimes 269 -__SYSCALL(__NR_utimes, compat_sys_utimes) +__SYSCALL(__NR_utimes, sys_utimes_time32)#define __NR_arm_fadvise64_64 270 __SYSCALL(__NR_arm_fadvise64_64, compat_sys_aarch32_fadvise64_64)#define __NR_pciconfig_iobase 271
@@ -574,9 +574,9 @@ __SYSCALL(__NR_mq_open, compat_sys_mq_open)#define __NR_mq_unlink 275 __SYSCALL(__NR_mq_unlink, sys_mq_unlink)#define __NR_mq_timedsend 276 -__SYSCALL(__NR_mq_timedsend, compat_sys_mq_timedsend) +__SYSCALL(__NR_mq_timedsend, sys_mq_timedsend_time32)#define __NR_mq_timedreceive 277 -__SYSCALL(__NR_mq_timedreceive, compat_sys_mq_timedreceive) +__SYSCALL(__NR_mq_timedreceive, sys_mq_timedreceive_time32)#define __NR_mq_notify 278 __SYSCALL(__NR_mq_notify, compat_sys_mq_notify)#define __NR_mq_getsetattr 279
@@ -646,7 +646,7 @@ __SYSCALL(__NR_request_key, sys_request_key)#define __NR_keyctl 311 __SYSCALL(__NR_keyctl, compat_sys_keyctl)#define __NR_semtimedop 312 -__SYSCALL(__NR_semtimedop, compat_sys_semtimedop) +__SYSCALL(__NR_semtimedop, sys_semtimedop_time32)#define __NR_vserver 313 __SYSCALL(__NR_vserver, sys_ni_syscall)#define __NR_ioprio_set 314
@@ -674,7 +674,7 @@ __SYSCALL(__NR_mknodat, sys_mknodat)#define __NR_fchownat 325 __SYSCALL(__NR_fchownat, sys_fchownat)#define __NR_futimesat 326 -__SYSCALL(__NR_futimesat, compat_sys_futimesat) +__SYSCALL(__NR_futimesat, sys_futimesat_time32)#define __NR_fstatat64 327 __SYSCALL(__NR_fstatat64, sys_fstatat64)#define __NR_unlinkat 328
@@ -692,9 +692,9 @@ __SYSCALL(__NR_fchmodat, sys_fchmodat)#define __NR_faccessat 334 __SYSCALL(__NR_faccessat, sys_faccessat)#define __NR_pselect6 335 -__SYSCALL(__NR_pselect6, compat_sys_pselect6) +__SYSCALL(__NR_pselect6, compat_sys_pselect6_time32)#define __NR_ppoll 336 -__SYSCALL(__NR_ppoll, compat_sys_ppoll) +__SYSCALL(__NR_ppoll, compat_sys_ppoll_time32)#define __NR_unshare 337 __SYSCALL(__NR_unshare, sys_unshare)#define __NR_set_robust_list 338
@@ -718,7 +718,7 @@ __SYSCALL(__NR_epoll_pwait, compat_sys_epoll_pwait)#define __NR_kexec_load 347 __SYSCALL(__NR_kexec_load, compat_sys_kexec_load)#define __NR_utimensat 348 -__SYSCALL(__NR_utimensat, compat_sys_utimensat) +__SYSCALL(__NR_utimensat, sys_utimensat_time32)#define __NR_signalfd 349 __SYSCALL(__NR_signalfd, compat_sys_signalfd)#define __NR_timerfd_create 350
@@ -728,9 +728,9 @@ __SYSCALL(__NR_eventfd, sys_eventfd)#define __NR_fallocate 352 __SYSCALL(__NR_fallocate, compat_sys_aarch32_fallocate)#define __NR_timerfd_settime 353 -__SYSCALL(__NR_timerfd_settime, compat_sys_timerfd_settime) +__SYSCALL(__NR_timerfd_settime, sys_timerfd_settime32)#define __NR_timerfd_gettime 354 -__SYSCALL(__NR_timerfd_gettime, compat_sys_timerfd_gettime) +__SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime32)#define __NR_signalfd4 355 __SYSCALL(__NR_signalfd4, compat_sys_signalfd4)#define __NR_eventfd2 356
@@ -752,7 +752,7 @@ __SYSCALL(__NR_rt_tgsigqueueinfo, compat_sys_rt_tgsigqueueinfo)#define __NR_perf_event_open 364 __SYSCALL(__NR_perf_event_open, sys_perf_event_open)#define __NR_recvmmsg 365 -__SYSCALL(__NR_recvmmsg, compat_sys_recvmmsg) +__SYSCALL(__NR_recvmmsg, compat_sys_recvmmsg_time32)#define __NR_accept4 366 __SYSCALL(__NR_accept4, sys_accept4)#define __NR_fanotify_init 367
@@ -766,7 +766,7 @@ __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)#define __NR_open_by_handle_at 371 __SYSCALL(__NR_open_by_handle_at, compat_sys_open_by_handle_at)#define __NR_clock_adjtime 372 -__SYSCALL(__NR_clock_adjtime, compat_sys_clock_adjtime) +__SYSCALL(__NR_clock_adjtime, sys_clock_adjtime32)#define __NR_syncfs 373 __SYSCALL(__NR_syncfs, sys_syncfs)#define __NR_sendmmsg 374
arch/mips/kernel/syscalls/syscall_n32.tbl +25 -25
143 lines not on this page · raw message
arch/mips/kernel/syscalls/syscall_o32.tbl +26 -26
145 lines not on this page · raw message
arch/parisc/kernel/syscalls/syscall.tbl +27 -27
154 lines not on this page · raw message
arch/powerpc/kernel/syscalls/syscall.tbl +26 -26
151 lines not on this page · raw message
arch/s390/kernel/syscalls/syscall.tbl +26 -26
145 lines not on this page · raw message
arch/sparc/kernel/syscalls/syscall.tbl +26 -26
141 lines not on this page · raw message
arch/x86/entry/syscalls/syscall_32.tbl +26 -26
148 lines not on this page · raw message
fs/aio.c +5 -5
@@ -2198,11 +2198,11 @@ SYSCALL_DEFINE6(io_pgetevents_time32,#if defined(CONFIG_COMPAT_32BIT_TIME ) -COMPAT_SYSCALL_DEFINE5 (io_getevents, compat_aio_context_t, ctx_id, - compat_long_t, min_nr, - compat_long_t, nr, - struct io_event __user *, events, - struct old_timespec32 __user *, timeout) +SYSCALL_DEFINE5 (io_getevents_time32, __u32, ctx_id, + __s32, min_nr, + __s32, nr, + struct io_event __user *, events, + struct old_timespec32 __user *, timeout) {struct timespec64 t;int ret;
fs/select.c +2 -2
@@ -1379,7 +1379,7 @@ COMPAT_SYSCALL_DEFINE6(pselect6_time64, int, n, compat_ulong_t __user *, inp,#if defined(CONFIG_COMPAT_32BIT_TIME ) -COMPAT_SYSCALL_DEFINE6(pselect6, int, n, compat_ulong_t __user *, inp, +COMPAT_SYSCALL_DEFINE6(pselect6_time32, int, n, compat_ulong_t __user *, inp, compat_ulong_t __user *, outp, compat_ulong_t __user *, exp, struct old_timespec32 __user *, tsp, void __user *, sig) {
@@ -1402,7 +1402,7 @@ COMPAT_SYSCALL_DEFINE6(pselect6, int, n, compat_ulong_t __user *, inp,#endif #if defined(CONFIG_COMPAT_32BIT_TIME ) -COMPAT_SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds, +COMPAT_SYSCALL_DEFINE5(ppoll_time32, struct pollfd __user *, ufds, unsigned int, nfds, struct old_timespec32 __user *, tsp, const compat_sigset_t __user *, sigmask, compat_size_t, sigsetsize) {
fs/timerfd.c +2 -2
@@ -560,7 +560,7 @@ SYSCALL_DEFINE2(timerfd_gettime, int, ufd, struct __kernel_itimerspec __user *, }#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE4 (timerfd_settime, int, ufd, int, flags, +SYSCALL_DEFINE4 (timerfd_settime32, int, ufd, int, flags, const struct old_itimerspec32 __user *, utmr, struct old_itimerspec32 __user *, otmr) {
@@ -577,7 +577,7 @@ COMPAT_SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags,return ret; } -COMPAT_SYSCALL_DEFINE2 (timerfd_gettime, int, ufd, +SYSCALL_DEFINE2 (timerfd_gettime32, int, ufd, struct old_itimerspec32 __user *, otmr) {struct itimerspec64 kotmr;
fs/utimes.c +5 -5
@@ -224,8 +224,8 @@ SYSCALL_DEFINE2(utime, char __user *, filename, struct utimbuf __user *, times)* of sys_utimes. */ #ifdef __ARCH_WANT_SYS_UTIME32 -COMPAT_SYSCALL_DEFINE2(utime, const char __user *, filename, - struct old_utimbuf32 __user *, t) +SYSCALL_DEFINE2(utime32, const char __user *, filename, + struct old_utimbuf32 __user *, t) {struct timespec64 tv[2 ];
@@ -240,7 +240,7 @@ COMPAT_SYSCALL_DEFINE2(utime, const char __user *, filename, }#endif -COMPAT_SYSCALL_DEFINE4(utimensat, unsigned int, dfd, const char __user *, filename, struct old_timespec32 __user *, t, int, flags) +SYSCALL_DEFINE4(utimensat_time32, unsigned int, dfd, const char __user *, filename, struct old_timespec32 __user *, t, int, flags) {struct timespec64 tv[2 ];
@@ -276,14 +276,14 @@ static long do_compat_futimesat(unsigned int dfd, const char __user *filename,return do_utimes (dfd, filename, t ? tv :NULL ,0 ); } -COMPAT_SYSCALL_DEFINE3(futimesat, unsigned int, dfd, +SYSCALL_DEFINE3(futimesat_time32, unsigned int, dfd, const char __user *, filename, struct old_timeval32 __user *, t) {return do_compat_futimesat (dfd, filename, t); } -COMPAT_SYSCALL_DEFINE2(utimes, const char __user *, filename, struct old_timeval32 __user *, t) +SYSCALL_DEFINE2(utimes_time32, const char __user *, filename, struct old_timeval32 __user *, t) {return do_compat_futimesat (AT_FDCWD , filename, t); }
include/linux/compat.h +4 -69
175 lines not on this page · raw message
include/linux/syscalls.h +57 -0
140 lines not on this page · raw message
include/uapi/asm-generic/unistd.h +22 -22
140 lines not on this page · raw message
ipc/mqueue.c +8 -8
@@ -1471,10 +1471,10 @@ static int compat_prepare_timeout(const struct old_timespec32 __user *p,return 0 ; } -COMPAT_SYSCALL_DEFINE5 (mq_timedsend, mqd_t, mqdes, - const char __user *, u_msg_ptr, - compat_size_t, msg_len, unsigned int, msg_prio, - const struct old_timespec32 __user *, u_abs_timeout) +SYSCALL_DEFINE5 (mq_timedsend_time32, mqd_t, mqdes, + const char __user *, u_msg_ptr, + unsigned int, msg_len, unsigned int, msg_prio, + const struct old_timespec32 __user *, u_abs_timeout) {struct timespec64 ts, *p =NULL ;if (u_abs_timeout) {
@@ -1486,10 +1486,10 @@ COMPAT_SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes,return do_mq_timedsend (mqdes, u_msg_ptr, msg_len, msg_prio, p); } -COMPAT_SYSCALL_DEFINE5 (mq_timedreceive, mqd_t, mqdes, - char __user *, u_msg_ptr, - compat_size_t, msg_len, unsigned int __user *, u_msg_prio, - const struct old_timespec32 __user *, u_abs_timeout) +SYSCALL_DEFINE5 (mq_timedreceive_time32, mqd_t, mqdes, + char __user *, u_msg_ptr, + unsigned int, msg_len, unsigned int __user *, u_msg_prio, + const struct old_timespec32 __user *, u_abs_timeout) {struct timespec64 ts, *p =NULL ;if (u_abs_timeout) {
ipc/sem.c +1 -1
@@ -2250,7 +2250,7 @@ long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems,return do_semtimedop (semid, tsems, nsops,NULL ); } -COMPAT_SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsems, +SYSCALL_DEFINE4(semtimedop_time32, int, semid, struct sembuf __user *, tsems, unsigned int, nsops, const struct old_timespec32 __user *, timeout) {
kernel/futex.c +1 -1
@@ -3812,7 +3812,7 @@ COMPAT_SYSCALL_DEFINE3(get_robust_list, int, pid,#endif /* CONFIG_COMPAT */ #ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val, +SYSCALL_DEFINE6(futex_time32, u32 __user *, uaddr, int, op, u32, val, struct old_timespec32 __user *, utime, u32 __user *, uaddr2, u32, val3) {
kernel/sched/core.c +2 -3
@@ -5252,9 +5252,8 @@ SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, }#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE2 (sched_rr_get_interval, - compat_pid_t, pid, - struct old_timespec32 __user *, interval) +SYSCALL_DEFINE2 (sched_rr_get_interval_time32, pid_t, pid, + struct old_timespec32 __user *, interval) {struct timespec64 t;int retval =sched_rr_get_interval (pid, &t);
kernel/signal.c +1 -1
@@ -3397,7 +3397,7 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait_time64, compat_sigset_t __user *, uthese, }#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese, +COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait_time32, compat_sigset_t __user *, uthese, struct compat_siginfo __user *, uinfo, struct old_timespec32 __user *, uts, compat_size_t, sigsetsize) {
kernel/sys_ni.c +10 -8
@@ -42,9 +42,11 @@ COND_SYSCALL(io_destroy);COND_SYSCALL (io_submit);COND_SYSCALL_COMPAT (io_submit);COND_SYSCALL (io_cancel); +COND_SYSCALL (io_getevents_time32);COND_SYSCALL (io_getevents); +COND_SYSCALL (io_pgetevents_time32);COND_SYSCALL (io_pgetevents); -COND_SYSCALL_COMPAT (io_getevents); +COND_SYSCALL_COMPAT (io_pgetevents_time32);COND_SYSCALL_COMPAT (io_pgetevents);/* fs/xattr.c */
@@ -114,9 +116,9 @@ COND_SYSCALL_COMPAT(signalfd4);/* fs/timerfd.c */ COND_SYSCALL (timerfd_create);COND_SYSCALL (timerfd_settime); -COND_SYSCALL_COMPAT (timerfd_settime); +COND_SYSCALL (timerfd_settime32);COND_SYSCALL (timerfd_gettime); -COND_SYSCALL_COMPAT (timerfd_gettime); +COND_SYSCALL (timerfd_gettime32);/* fs/utimes.c */
@@ -135,7 +137,7 @@ COND_SYSCALL(capset);/* kernel/futex.c */ COND_SYSCALL (futex); -COND_SYSCALL_COMPAT (futex); +COND_SYSCALL (futex_time32);COND_SYSCALL (set_robust_list);COND_SYSCALL_COMPAT (set_robust_list);COND_SYSCALL (get_robust_list);
@@ -187,9 +189,9 @@ COND_SYSCALL(mq_open);COND_SYSCALL_COMPAT (mq_open);COND_SYSCALL (mq_unlink);COND_SYSCALL (mq_timedsend); -COND_SYSCALL_COMPAT (mq_timedsend); +COND_SYSCALL (mq_timedsend_time32);COND_SYSCALL (mq_timedreceive); -COND_SYSCALL_COMPAT (mq_timedreceive); +COND_SYSCALL (mq_timedreceive_time32);COND_SYSCALL (mq_notify);COND_SYSCALL_COMPAT (mq_notify);COND_SYSCALL (mq_getsetattr);
@@ -211,7 +213,7 @@ COND_SYSCALL(old_semctl);COND_SYSCALL (semctl);COND_SYSCALL_COMPAT (semctl);COND_SYSCALL (semtimedop); -COND_SYSCALL_COMPAT (semtimedop); +COND_SYSCALL (semtimedop_time32);COND_SYSCALL (semop);/* ipc/shm.c */
@@ -288,7 +290,7 @@ COND_SYSCALL(perf_event_open);COND_SYSCALL (accept4);COND_SYSCALL (recvmmsg);COND_SYSCALL (recvmmsg_time32); -COND_SYSCALL_COMPAT (recvmmsg); +COND_SYSCALL_COMPAT (recvmmsg_time32);COND_SYSCALL_COMPAT (recvmmsg_time64);/*
kernel/time/hrtimer.c +1 -1
@@ -1771,7 +1771,7 @@ SYSCALL_DEFINE2(nanosleep, struct __kernel_timespec __user *, rqtp,#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE2(nanosleep, struct old_timespec32 __user *, rqtp, +SYSCALL_DEFINE2(nanosleep_time32, struct old_timespec32 __user *, rqtp, struct old_timespec32 __user *, rmtp) {struct timespec64 tu;
kernel/time/posix-stubs.c +13 -12
@@ -45,6 +45,7 @@ SYS_NI(timer_delete);SYS_NI (clock_adjtime);SYS_NI (getitimer);SYS_NI (setitimer); +SYS_NI (clock_adjtime32);#ifdef __ARCH_WANT_SYS_ALARMSYS_NI (alarm);#endif
@@ -150,16 +151,16 @@ SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,#ifdef CONFIG_COMPAT COMPAT_SYS_NI (timer_create); -COMPAT_SYS_NI (clock_adjtime); -COMPAT_SYS_NI (timer_settime); -COMPAT_SYS_NI (timer_gettime);COMPAT_SYS_NI (getitimer);COMPAT_SYS_NI (setitimer);#endif #ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, - struct old_timespec32 __user *, tp) +SYS_NI (timer_settime32); +SYS_NI (timer_gettime32); + +SYSCALL_DEFINE2(clock_settime32, const clockid_t, which_clock, + struct old_timespec32 __user *, tp) {struct timespec64 new_tp;
@@ -171,8 +172,8 @@ COMPAT_SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,return do_sys_settimeofday64 (&new_tp,NULL ); } -COMPAT_SYSCALL_DEFINE2 (clock_gettime, clockid_t, which_clock, - struct old_timespec32 __user *, tp) +SYSCALL_DEFINE2 (clock_gettime32, clockid_t, which_clock, + struct old_timespec32 __user *, tp) {int ret;struct timespec64 kernel_tp;
@@ -186,8 +187,8 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,return 0 ; } -COMPAT_SYSCALL_DEFINE2 (clock_getres, clockid_t, which_clock, - struct old_timespec32 __user *, tp) +SYSCALL_DEFINE2 (clock_getres_time32, clockid_t, which_clock, + struct old_timespec32 __user *, tp) {struct timespec64 rtn_tp = { .tv_sec =0 ,
@@ -206,9 +207,9 @@ COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock, } } -COMPAT_SYSCALL_DEFINE4 (clock_nanosleep, clockid_t, which_clock, int, flags, - struct old_timespec32 __user *, rqtp, - struct old_timespec32 __user *, rmtp) +SYSCALL_DEFINE4 (clock_nanosleep_time32, clockid_t, which_clock, int, flags, + struct old_timespec32 __user *, rqtp, + struct old_timespec32 __user *, rmtp) {struct timespec64 t;
kernel/time/posix-timers.c +16 -16
@@ -730,8 +730,8 @@ SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE2 (timer_gettime, timer_t, timer_id, - struct old_itimerspec32 __user *, setting) +SYSCALL_DEFINE2 (timer_gettime32, timer_t, timer_id, + struct old_itimerspec32 __user *, setting) {struct itimerspec64 cur_setting;
@@ -903,9 +903,9 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, }#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE4 (timer_settime, timer_t, timer_id, int, flags, - struct old_itimerspec32 __user *, new, - struct old_itimerspec32 __user *, old) +SYSCALL_DEFINE4 (timer_settime32, timer_t, timer_id, int, flags, + struct old_itimerspec32 __user *, new, + struct old_itimerspec32 __user *, old) {struct itimerspec64 new_spec, old_spec;struct itimerspec64 *rtn = old ? &old_spec :NULL ;
@@ -1096,8 +1096,8 @@ SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock,#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE2 (clock_settime, clockid_t, which_clock, - struct old_timespec32 __user *, tp) +SYSCALL_DEFINE2 (clock_settime32, clockid_t, which_clock, + struct old_timespec32 __user *, tp) {const struct k_clock *kc =clockid_to_kclock (which_clock);struct timespec64 ts;
@@ -1111,8 +1111,8 @@ COMPAT_SYSCALL_DEFINE2(clock_settime, clockid_t, which_clock,return kc->clock_set (which_clock, &ts); } -COMPAT_SYSCALL_DEFINE2 (clock_gettime, clockid_t, which_clock, - struct old_timespec32 __user *, tp) +SYSCALL_DEFINE2 (clock_gettime32, clockid_t, which_clock, + struct old_timespec32 __user *, tp) {const struct k_clock *kc =clockid_to_kclock (which_clock);struct timespec64 ts;
@@ -1129,8 +1129,8 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,return err; } -COMPAT_SYSCALL_DEFINE2 (clock_adjtime, clockid_t, which_clock, - struct old_timex32 __user *, utp) +SYSCALL_DEFINE2 (clock_adjtime32, clockid_t, which_clock, + struct old_timex32 __user *, utp) {struct __kernel_timex ktx;int err;
@@ -1147,8 +1147,8 @@ COMPAT_SYSCALL_DEFINE2(clock_adjtime, clockid_t, which_clock,return err; } -COMPAT_SYSCALL_DEFINE2 (clock_getres, clockid_t, which_clock, - struct old_timespec32 __user *, tp) +SYSCALL_DEFINE2 (clock_getres_time32, clockid_t, which_clock, + struct old_timespec32 __user *, tp) {const struct k_clock *kc =clockid_to_kclock (which_clock);struct timespec64 ts;
@@ -1204,9 +1204,9 @@ SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE4 (clock_nanosleep, clockid_t, which_clock, int, flags, - struct old_timespec32 __user *, rqtp, - struct old_timespec32 __user *, rmtp) +SYSCALL_DEFINE4 (clock_nanosleep_time32, clockid_t, which_clock, int, flags, + struct old_timespec32 __user *, rqtp, + struct old_timespec32 __user *, rmtp) {const struct k_clock *kc =clockid_to_kclock (which_clock);struct timespec64 t;
kernel/time/time.c +4 -4
@@ -98,11 +98,11 @@ SYSCALL_DEFINE1(stime, time_t __user *, tptr)#endif /* __ARCH_WANT_SYS_TIME */ -#ifdef CONFIG_COMPAT +#ifdef CONFIG_COMPAT_32BIT_TIME #ifdef __ARCH_WANT_COMPAT_SYS_TIME /* old_time32_t is a 32 bit "long" and needs to get converted. */ -COMPAT_SYSCALL_DEFINE1(time, old_time32_t __user *, tloc) +SYSCALL_DEFINE1(time32, old_time32_t __user *, tloc) { old_time32_t i;
@@ -116,7 +116,7 @@ COMPAT_SYSCALL_DEFINE1(time, old_time32_t __user *, tloc)return i; } -COMPAT_SYSCALL_DEFINE1(stime, old_time32_t __user *, tptr) +SYSCALL_DEFINE1(stime32, old_time32_t __user *, tptr) {struct timespec64 tv;int err;
@@ -344,7 +344,7 @@ int put_old_timex32(struct old_timex32 __user *utp, const struct __kernel_timexreturn 0 ; } -COMPAT_SYSCALL_DEFINE1(adjtimex, struct old_timex32 __user *, utp) +SYSCALL_DEFINE1(adjtimex_time32, struct old_timex32 __user *, utp) {struct __kernel_timex txc;int err, ret;
net/compat.c +1 -1
@@ -822,7 +822,7 @@ COMPAT_SYSCALL_DEFINE5(recvmmsg_time64, int, fd, struct compat_mmsghdr __user *, }#ifdef CONFIG_COMPAT_32BIT_TIME -COMPAT_SYSCALL_DEFINE5(recvmmsg, int, fd, struct compat_mmsghdr __user *, mmsg, +COMPAT_SYSCALL_DEFINE5(recvmmsg_time32, int, fd, struct compat_mmsghdr __user *, mmsg, unsigned int, vlen, unsigned int, flags, struct old_timespec32 __user *, timeout) {
Signature · 1 line
2.20.0
Re: [PATCH v2 25/29] y2038: syscalls: rename y2038 compat syscalls
Quoted 14 lines · Arnd Bergmann
A lot of system calls that pass a
time_tsomewhere have an implementation using aCOMPAT_SYSCALL_DEFINEx()on 64-bit architectures, and have been reworked so that this implementation can now be used on 32-bit architectures as well.The missing step is to redefine them using the regular
SYSCALL_DEFINEx()to get them out of the compat namespace and make it possible to build them on 32-bit architectures.Any system call that ends in 'time' gets a '32' suffix on its name for that version, while the others get a '
_time32' suffix, to distinguish them from the normal version, which takes a 64-bit time argument in the future.
Quoted 4 lines
In this step, only 64-bit architectures are changed, doing this rename first lets us avoid touching the 32-bit architectures twice.
Signed-off-by Arnd Bergmann <[email protected]>
For arm64:
Arnd Bergmann
maintainerPATCH v2 26/29 y2038: use time32 syscall names on 32-bit
In reply to Arnd BergmannThis is the big flip, where all 32-bit architectures set COMPAT_32BIT_TIME abd use the _time32 system calls from the former compat layer instead of the system calls that take __kernel_timespec and similar arguments.
The temporary redirects for __kernel_timespec, __kernel_itimerspec and __kernel_timex can get removed with this.
It would be easy to split this commit by architecture, but with the new generated system call tables, it's easy enough to do it all at once, which makes it a little easier to check that the changes are the same in each table.
--- arch/Kconfig | 2 +- arch/arm/kernel/sys_oabi-compat.c | 8 +- arch/arm/tools/syscall.tbl | 46 ++++++------ arch/m68k/kernel/syscalls/syscall.tbl | 42 +++++------ arch/microblaze/kernel/syscalls/syscall.tbl | 46 ++++++------ arch/mips/kernel/syscalls/syscall_o32.tbl | 44 +++++------ arch/parisc/kernel/syscalls/syscall.tbl | 69 +++++++++++------ arch/powerpc/kernel/syscalls/syscall.tbl | 82 +++++++++++++++------ arch/sh/kernel/syscalls/syscall.tbl | 42 +++++------ arch/sparc/kernel/syscalls/syscall.tbl | 64 ++++++++++------ arch/x86/entry/syscalls/syscall_32.tbl | 44 +++++------ arch/xtensa/kernel/syscalls/syscall.tbl | 44 +++++------ include/uapi/asm-generic/unistd.h | 56 +++++++------- 13 files changed, 335 insertions(+), 254 deletions(-)
arch/Kconfig +1 -1
@@ -759,7 +759,7 @@ config 64BIT_TIME handling. config COMPAT_32BIT_TIME - def_bool (!64BIT && 64BIT_TIME) || COMPAT + def_bool !64BIT || COMPAT help This enables 32 bit time_t support in addition to 64 bit time_t support. This is relevant on all 32-bit architectures, and 64-bit architectures
arch/arm/kernel/sys_oabi-compat.c +4 -4
@@ -317,10 +317,10 @@ struct oabi_sembuf {asmlinkage long sys_oabi_semtimedop (int semid,struct oabi_sembuf __user *tsops,unsigned nsops, -const struct timespec __user *timeout) +const struct old_timespec32 __user *timeout) {struct sembuf *sops; -struct timespec local_timeout; +struct old_timespec32 local_timeout;long err;int i;
@@ -350,7 +350,7 @@ asmlinkage long sys_oabi_semtimedop(int semid, }else {mm_segment_t fs =get_fs ();set_fs (KERNEL_DS ); - err =sys_semtimedop (semid, sops, nsops, timeout); + err =sys_semtimedop_time32 (semid, sops, nsops, timeout);set_fs (fs); }kfree (sops);
@@ -375,7 +375,7 @@ asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third,return sys_oabi_semtimedop (first, (struct oabi_sembuf __user *)ptr, second, - (const struct timespec __user *)fifth); + (const struct old_timespec32 __user *)fifth);default :return sys_ipc (call, first, second, third, ptr, fifth); }
arch/arm/tools/syscall.tbl +23 -23
127 lines not on this page · raw message
arch/m68k/kernel/syscalls/syscall.tbl +21 -21
114 lines not on this page · raw message
arch/microblaze/kernel/syscalls/syscall.tbl +23 -23
121 lines not on this page · raw message
arch/mips/kernel/syscalls/syscall_o32.tbl +22 -22
120 lines not on this page · raw message
arch/parisc/kernel/syscalls/syscall.tbl +46 -23
149 lines not on this page · raw message
arch/powerpc/kernel/syscalls/syscall.tbl +60 -22
159 lines not on this page · raw message
arch/sh/kernel/syscalls/syscall.tbl +21 -21
111 lines not on this page · raw message
arch/sparc/kernel/syscalls/syscall.tbl +42 -22
137 lines not on this page · raw message
arch/x86/entry/syscalls/syscall_32.tbl +22 -22
121 lines not on this page · raw message
arch/xtensa/kernel/syscalls/syscall.tbl +22 -22
114 lines not on this page · raw message
include/uapi/asm-generic/unistd.h +28 -28
149 lines not on this page · raw message
Signature · 1 line
2.20.0
Geert Uytterhoeven
maintainerRe: [PATCH v2 26/29] y2038: use time32 syscall names on 32-bit
Hi Arnd,
Quoted 2 lines · Arnd Bergmann
This is the big flip, where all 32-bit architectures set
COMPAT_32BIT_TIMEabd use the_time32system calls from the former compat layer instead
and
Quoted 1 line
of the system calls that take
__kernel_timespecand similar arguments.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH v2 26/29] y2038: use time32 syscall names on 32-bit
In reply to Arnd BergmannQuoted 7 lines · Arnd Bergmann
This is the big flip, where all 32-bit architectures set
COMPAT_32BIT_TIMEabd use the_time32system calls from the former compat layer instead of the system calls that take__kernel_timespecand similar arguments.The temporary redirects for
__kernel_timespec,__kernel_itimerspecand__kernel_timexcan get removed with this.
Quoted 8 lines
It would be easy to split this commit by architecture, but with the new generated system call tables, it's easy enough to do it all at once, which makes it a little easier to check that the changes are the same in each table.
Signed-off-by Arnd Bergmann <[email protected]>arch/m68k/kernel/syscalls/syscall.tbl | 42 +++++------
For m68k:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Arnd Bergmann
maintainerPATCH v2 27/29 y2038: remove struct definition redirects
In reply to Arnd BergmannWe now use 64-bit time_t on all architectures, so the __kernel_timex, __kernel_timeval and __kernel_timespec redirects can be removed after having served their purpose.
This makes it all much less confusing, as the __kernel_* types now always refer to the same layout based on 64-bit time_t across all 32-bit and 64-bit architectures.
--- include/linux/time64.h | 8 -------- include/linux/timex.h | 7 ------- include/uapi/linux/time.h | 4 ---- include/uapi/linux/timex.h | 2 -- 4 files changed, 21 deletions(-)
include/linux/time64.h +0 -8
@@ -7,14 +7,6 @@typedef __s64 time64_t ;typedef __u64 timeu64_t ; -/* CONFIG_64BIT_TIME enables new 64 bit time_t syscalls in the compat path -* and 32-bit emulation. -*/ -#ifndef CONFIG_64BIT_TIME -#define __kernel_timespec timespec -#define __kernel_itimerspec itimerspec -#endif -#include <uapi/linux/time.h> struct timespec64 {
include/linux/timex.h +0 -7
@@ -53,13 +53,6 @@#ifndef _LINUX_TIMEX_H#define _LINUX_TIMEX_H -/* CONFIG_64BIT_TIME enables new 64 bit time_t syscalls in the compat path -* and 32-bit emulation. -*/ -#ifndef CONFIG_64BIT_TIME -#define __kernel_timex timex -#endif -#include <uapi/linux/timex.h> #define ADJ_ADJTIME 0x8000/* switch between adjtime/adjtimex modes */
include/uapi/linux/time.h +0 -4
@@ -42,19 +42,15 @@ struct itimerval {struct timeval it_value;/* current value */ }; -#ifndef __kernel_timespecstruct __kernel_timespec {__kernel_time64_t tv_sec;/* seconds */ long long tv_nsec;/* nanoseconds */ }; -#endif -#ifndef __kernel_itimerspecstruct __kernel_itimerspec {struct __kernel_timespec it_interval;/* timer period */ struct __kernel_timespec it_value;/* timer expiration */ }; -#endif /* * legacy timeval structure, only embedded in structures that
include/uapi/linux/timex.h +0 -2
@@ -97,7 +97,6 @@ struct __kernel_timex_timeval {long long tv_usec; }; -#ifndef __kernel_timexstruct __kernel_timex {unsigned int modes;/* mode selector */ int :32; /* pad */
@@ -131,7 +130,6 @@ struct __kernel_timex { int :32; int :32; int :32; int :32; int :32; int :32; int :32; }; -#endif /* * Mode codes (timex.mode)
Signature · 1 line
2.20.0
Arnd Bergmann
maintainerPATCH v2 28/29 y2038: rename old time and utime syscalls
In reply to Arnd BergmannThe 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.
--- arch/arm/include/asm/unistd.h | 4 ++-- arch/arm/tools/syscall.tbl | 10 +++++----- arch/m68k/include/asm/unistd.h | 4 ++-- arch/m68k/kernel/syscalls/syscall.tbl | 10 +++++----- arch/microblaze/include/asm/unistd.h | 4 ++-- arch/microblaze/kernel/syscalls/syscall.tbl | 10 +++++----- arch/mips/include/asm/unistd.h | 4 ++-- arch/mips/kernel/syscalls/syscall_o32.tbl | 10 +++++----- arch/parisc/include/asm/unistd.h | 9 ++++++--- arch/parisc/kernel/syscalls/syscall.tbl | 15 ++++++++++----- arch/powerpc/include/asm/unistd.h | 8 ++++---- arch/powerpc/kernel/syscalls/syscall.tbl | 19 ++++++++++++++----- arch/s390/include/asm/unistd.h | 2 +- arch/sh/include/asm/unistd.h | 4 ++-- arch/sh/kernel/syscalls/syscall.tbl | 10 +++++----- arch/sparc/include/asm/unistd.h | 8 ++++---- arch/sparc/kernel/syscalls/syscall.tbl | 14 +++++++++----- arch/x86/entry/syscalls/syscall_32.tbl | 10 +++++----- arch/x86/include/asm/unistd.h | 8 ++++---- arch/xtensa/include/asm/unistd.h | 2 +- arch/xtensa/kernel/syscalls/syscall.tbl | 6 +++--- kernel/time/time.c | 4 ++-- 22 files changed, 98 insertions(+), 77 deletions(-)
arch/arm/include/asm/unistd.h +2 -2
@@ -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
arch/arm/tools/syscall.tbl +5 -5
@@ -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
@@ -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
@@ -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
@@ -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
arch/m68k/include/asm/unistd.h +2 -2
@@ -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
arch/m68k/kernel/syscalls/syscall.tbl +5 -5
@@ -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
@@ -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
@@ -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
@@ -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
arch/microblaze/include/asm/unistd.h +2 -2
@@ -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
arch/microblaze/kernel/syscalls/syscall.tbl +5 -5
@@ -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
@@ -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
@@ -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
@@ -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
arch/mips/include/asm/unistd.h +2 -2
@@ -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
arch/mips/kernel/syscalls/syscall_o32.tbl +5 -5
@@ -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
@@ -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
@@ -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
@@ -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
arch/parisc/include/asm/unistd.h +6 -3
@@ -150,10 +150,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
@@ -168,6 +166,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
arch/parisc/kernel/syscalls/syscall.tbl +10 -5
@@ -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
@@ -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
@@ -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
@@ -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
arch/powerpc/include/asm/unistd.h +4 -4
@@ -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
@@ -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
arch/powerpc/kernel/syscalls/syscall.tbl +14 -5
@@ -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
@@ -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
@@ -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
@@ -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
arch/s390/include/asm/unistd.h +1 -1
@@ -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
arch/sh/include/asm/unistd.h +2 -2
@@ -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
arch/sh/kernel/syscalls/syscall.tbl +5 -5
@@ -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_lchown16
@@ -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
@@ -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_wrapper # 273 is reserved for vserver 274 common mbind sys_mbind
@@ -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
arch/sparc/include/asm/unistd.h +4 -4
@@ -30,8 +30,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
@@ -43,8 +43,8 @@#ifdef __32bit_syscall_numbers__#define __ARCH_WANT_SYS_IPC#else -#define __ARCH_WANT_COMPAT_SYS_TIME -#define __ARCH_WANT_SYS_UTIME32 +#define __ARCH_WANT_SYS_TIME +#define __ARCH_WANT_SYS_UTIME#define __ARCH_WANT_COMPAT_SYS_SENDFILE#endif
arch/sparc/kernel/syscalls/syscall.tbl +9 -5
@@ -44,7 +44,8 @@ 28 common sigaltstack sys_sigaltstack compat_sys_sigaltstack 29 32 pause sys_pause 29 64 pause sys_nis_syscall -30 common utime sys_utime sys_utime32 +30 32 utime sys_utime32 +30 64 utime sys_utime 31 32 lchown32 sys_lchown 32 32 fchown32 sys_fchown 33 common access sys_access
@@ -169,7 +170,8 @@ 135 common socketpair sys_socketpair 136 common mkdir sys_mkdir 137 common rmdir sys_rmdir -138 common utimes sys_utimes sys_utimes_time32 +138 32 utimes sys_utimes_time32 +138 64 utimes sys_utimes 139 common stat64 sys_stat64 compat_sys_stat64 140 common sendfile64 sys_sendfile64 141 common getpeername sys_getpeername
@@ -274,9 +276,10 @@ 228 common setfsuid sys_setfsuid16 229 common setfsgid sys_setfsgid16 230 common _newselect sys_select compat_sys_select -231 32 time sys_time sys_time32 +231 32 time sys_time32 232 common splice sys_splice -233 common stime sys_stime sys_stime32 +233 32 stime sys_stime32 +233 64 stime sys_stime 234 common statfs64 sys_statfs64 compat_sys_statfs64 235 common fstatfs64 sys_fstatfs64 compat_sys_fstatfs64 236 common _llseek sys_llseek
@@ -345,7 +348,8 @@ 285 common mkdirat sys_mkdirat 286 common mknodat sys_mknodat 287 common fchownat sys_fchownat -288 common futimesat sys_futimesat sys_futimesat_time32 +288 32 futimesat sys_futimesat_time32 +288 64 futimesat sys_futimesat 289 common fstatat64 sys_fstatat64 compat_sys_fstatat64 290 common unlinkat sys_unlinkat 291 common renameat sys_renameat
arch/x86/entry/syscalls/syscall_32.tbl +5 -5
@@ -24,7 +24,7 @@ 10 i386 unlink sys_unlink __ia32_sys_unlink 11 i386 execve sys_execve __ia32_compat_sys_execve 12 i386 chdir sys_chdir __ia32_sys_chdir -13 i386 time sys_time __ia32_sys_time32 +13 i386 time sys_time32 __ia32_sys_time32 14 i386 mknod sys_mknod __ia32_sys_mknod 15 i386 chmod sys_chmod __ia32_sys_chmod 16 i386 lchown sys_lchown16 __ia32_sys_lchown16
@@ -36,12 +36,12 @@ 22 i386 umount sys_oldumount __ia32_sys_oldumount 23 i386 setuid sys_setuid16 __ia32_sys_setuid16 24 i386 getuid sys_getuid16 __ia32_sys_getuid16 -25 i386 stime sys_stime __ia32_sys_stime32 +25 i386 stime sys_stime32 __ia32_sys_stime32 26 i386 ptrace sys_ptrace __ia32_compat_sys_ptrace 27 i386 alarm sys_alarm __ia32_sys_alarm 28 i386 oldfstat sys_fstat __ia32_sys_fstat 29 i386 pause sys_pause __ia32_sys_pause -30 i386 utime sys_utime __ia32_sys_utime32 +30 i386 utime sys_utime32 __ia32_sys_utime32 31 i386 stty 32 i386 gtty 33 i386 access sys_access __ia32_sys_access
@@ -282,7 +282,7 @@ 268 i386 statfs64 sys_statfs64 __ia32_compat_sys_statfs64 269 i386 fstatfs64 sys_fstatfs64 __ia32_compat_sys_fstatfs64 270 i386 tgkill sys_tgkill __ia32_sys_tgkill -271 i386 utimes sys_utimes __ia32_sys_utimes_time32 +271 i386 utimes sys_utimes_time32 __ia32_sys_utimes_time32 272 i386 fadvise64_64 sys_fadvise64_64 __ia32_compat_sys_x86_fadvise64_64 273 i386 vserver 274 i386 mbind sys_mbind __ia32_sys_mbind
@@ -310,7 +310,7 @@ 296 i386 mkdirat sys_mkdirat __ia32_sys_mkdirat 297 i386 mknodat sys_mknodat __ia32_sys_mknodat 298 i386 fchownat sys_fchownat __ia32_sys_fchownat -299 i386 futimesat sys_futimesat __ia32_sys_futimesat_time32 +299 i386 futimesat sys_futimesat_time32 __ia32_sys_futimesat_time32 300 i386 fstatat64 sys_fstatat64 __ia32_compat_sys_x86_fstatat 301 i386 unlinkat sys_unlinkat __ia32_sys_unlinkat 302 i386 renameat sys_renameat __ia32_sys_renameat
arch/x86/include/asm/unistd.h +4 -4
@@ -23,8 +23,8 @@# include <asm/unistd_64.h> # include <asm/unistd_64_x32.h> -# define __ARCH_WANT_COMPAT_SYS_TIME -# define __ARCH_WANT_SYS_UTIME32 +# define __ARCH_WANT_SYS_TIME +# define __ARCH_WANT_SYS_UTIME# define __ARCH_WANT_COMPAT_SYS_PREADV64# define __ARCH_WANT_COMPAT_SYS_PWRITEV64# define __ARCH_WANT_COMPAT_SYS_PREADV64V2
@@ -48,8 +48,8 @@# define __ARCH_WANT_SYS_SIGPENDING# define __ARCH_WANT_SYS_SIGPROCMASK# define __ARCH_WANT_SYS_SOCKETCALL -# 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_FORK# define __ARCH_WANT_SYS_VFORK
arch/xtensa/include/asm/unistd.h +1 -1
@@ -7,7 +7,7 @@#define __ARCH_WANT_NEW_STAT#define __ARCH_WANT_STAT64 -#define __ARCH_WANT_SYS_UTIME +#define __ARCH_WANT_SYS_UTIME32#define __ARCH_WANT_SYS_GETPGRP#define NR_syscalls __NR_syscalls
arch/xtensa/kernel/syscalls/syscall.tbl +3 -3
@@ -72,8 +72,8 @@ 61 common fcntl64 sys_fcntl64 62 common fallocate sys_fallocate 63 common fadvise64_64 xtensa_fadvise64_64 -64 common utime sys_utime -65 common utimes sys_utimes +64 common utime sys_utime32 +65 common utimes sys_utimes_time32 66 common ioctl sys_ioctl 67 common fcntl sys_fcntl 68 common setxattr sys_setxattr
@@ -318,7 +318,7 @@ 295 common readlinkat sys_readlinkat 296 common utimensat sys_utimensat_time32 297 common fchownat sys_fchownat -298 common futimesat sys_futimesat +298 common futimesat sys_futimesat_time32 299 common fstatat64 sys_fstatat64 300 common fchmodat sys_fchmodat 301 common faccessat sys_faccessat
kernel/time/time.c +2 -2
@@ -99,7 +99,7 @@ SYSCALL_DEFINE1(stime, time_t __user *, tptr)#endif /* __ARCH_WANT_SYS_TIME */ #ifdef CONFIG_COMPAT_32BIT_TIME -#ifdef __ARCH_WANT_COMPAT_SYS_TIME +#ifdef __ARCH_WANT_SYS_TIME32/* old_time32_t is a 32 bit "long" and needs to get converted. */ SYSCALL_DEFINE1(time32, old_time32_t __user *, tloc)
@@ -134,7 +134,7 @@ SYSCALL_DEFINE1(stime32, old_time32_t __user *, tptr)return 0 ; } -#endif /* __ARCH_WANT_COMPAT_SYS_TIME */ +#endif /* __ARCH_WANT_SYS_TIME32 */ #endif SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
Signature · 1 line
2.20.0
Re: [PATCH v2 28/29] y2038: rename old time and utime syscalls
Quoted 17 lines · Arnd Bergmann
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, andutimensat_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_TIMEand__ARCH_WANT_SYS_UTIMEand only set__ARCH_WANT_COMPAT_SYS_TIMEand__ARCH_WANT_SYS_UTIME32for 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 resultingasm/unistd.hchanges look a bit counterintuitive.
Quoted 6 lines
This is only a cleanup patch and it should not change any behavior.
Signed-off-by Arnd Bergmann <[email protected]>arch/m68k/include/asm/unistd.h | 4 ++-- arch/m68k/kernel/syscalls/syscall.tbl | 10 +++++-----
For m68k:
Gr{oetje,eeting}s,
Geert
Re: [PATCH v2 28/29] y2038: rename old time and utime syscalls
In reply to Arnd BergmannQuoted 20 lines · Arnd Bergmann
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, andutimensat_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_TIMEand__ARCH_WANT_SYS_UTIMEand only set__ARCH_WANT_COMPAT_SYS_TIMEand__ARCH_WANT_SYS_UTIME32for 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 resultingasm/unistd.hchanges look a bit counterintuitive.This is only a cleanup patch and it should not change any behavior.
Signed-off-by Arnd Bergmann <[email protected]>
...
Quoted 1 line
arch/s390/include/asm/unistd.h | 2 +-
For the s390 bits:
Arnd Bergmann
maintainerPATCH v2 29/29 y2038: add 64-bit time_t syscalls to all 32-bit architectures
In reply to Arnd BergmannThis adds 21 new system calls on each ABI that has 32-bit time_t today. All of these have the exact same semantics as their existing counterparts, and the new ones all have macro names that end in 'time64' for clarification.
This gets us to the point of being able to safely use a C library that has 64-bit time_t in user space. There are still a couple of loose ends to tie up in various areas of the code, but this is the big one, and should be entirely uncontroversial at this point.
In particular, there are four system calls (getitimer, setitimer, waitid, and getrusage) that don't have a 64-bit counterpart yet, but these can all be safely implemented in the C library by wrapping around the existing system calls because the 32-bit time_t they pass only counts elapsed time, not time since the epoch. They will be dealt with later.
---
The one point that still needs to be agreed on is the actual number assignment. Following the earlier patch that added the sysv IPC calls with common numbers where possible, I also tried the same here, using consistent numbers on all 32-bit architectures.
There are a couple of minor issues with this:
- On asm-generic, we now leave the numbers from 295 to 402 unassigned, which wastes a small amount of kernel .data segment. Originally I had asm-generic start at 300 and everyone else start at 400 here, which was also not perfect, and we have gone beyond 400 already, so I ended up just using the same numbers as the rest here.
- Once we get to 512, we clash with the x32 numbers (unless we remove x32 support first), and probably have to skip a few more. I also considered using the 512..547 space for 32-bit-only calls (which never clash with x32), but that also seems to add a bit of complexity.
- On alpha, we have already used up the space up to 527 (with a small hole between 261 and 299). We could sync up with that as well, but my feeling was that alpha syscalls are already special enough that I don't care.
Let me know if you have other ideas.
--- arch/alpha/kernel/syscalls/syscall.tbl | 2 + arch/arm/tools/syscall.tbl | 21 ++++++++++ arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 41 +++++++++++++++++++ arch/ia64/kernel/syscalls/syscall.tbl | 1 + arch/m68k/kernel/syscalls/syscall.tbl | 20 +++++++++ arch/microblaze/kernel/syscalls/syscall.tbl | 21 ++++++++++ arch/mips/kernel/syscalls/syscall_n32.tbl | 21 ++++++++++ arch/mips/kernel/syscalls/syscall_n64.tbl | 1 + arch/mips/kernel/syscalls/syscall_o32.tbl | 20 +++++++++ arch/parisc/kernel/syscalls/syscall.tbl | 21 ++++++++++ arch/powerpc/kernel/syscalls/syscall.tbl | 20 +++++++++ arch/s390/kernel/syscalls/syscall.tbl | 20 +++++++++ arch/sh/kernel/syscalls/syscall.tbl | 20 +++++++++ arch/sparc/kernel/syscalls/syscall.tbl | 20 +++++++++ arch/x86/entry/syscalls/syscall_32.tbl | 20 +++++++++ arch/xtensa/kernel/syscalls/syscall.tbl | 21 ++++++++++ include/uapi/asm-generic/unistd.h | 45 ++++++++++++++++++++- scripts/checksyscalls.sh | 40 ++++++++++++++++++ 19 files changed, 375 insertions(+), 2 deletions(-)
arch/alpha/kernel/syscalls/syscall.tbl +2 -0
@@ -461,3 +461,5 @@ 530 common getegid sys_getegid 531 common geteuid sys_geteuid 532 common getppid sys_getppid +# all other architectures have common numbers for new syscall, alpha +# is the exception.
arch/arm/tools/syscall.tbl +21 -0
@@ -416,3 +416,24 @@ 399 common io_pgetevents sys_io_pgetevents_time32 400 common migrate_pages sys_migrate_pages 401 common kexec_file_load sys_kexec_file_load +# 402 is unused +403 common clock_gettime64 sys_clock_gettime +404 common clock_settime64 sys_clock_settime +405 common clock_adjtime64 sys_clock_adjtime +406 common clock_getres_time64 sys_clock_getres +407 common clock_nanosleep_time64 sys_clock_nanosleep +408 common timer_gettime64 sys_timer_gettime +409 common timer_settime64 sys_timer_settime +410 common timerfd_gettime64 sys_timerfd_gettime +411 common timerfd_settime64 sys_timerfd_settime +412 common utimensat_time64 sys_utimensat +413 common pselect6_time64 sys_pselect6 +414 common ppoll_time64 sys_ppoll +416 common io_pgetevents_time64 sys_io_pgetevents +417 common recvmmsg_time64 sys_recvmmsg +418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceiv_time64 sys_mq_timedreceive +420 common semtimedop_time64 sys_semtimedop +421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait +422 common futex_time64 sys_futex +423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
arch/arm64/include/asm/unistd.h +1 -1
@@ -44,7 +44,7 @@#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) -#define __NR_compat_syscalls 402 +#define __NR_compat_syscalls 424#endif #define __ARCH_WANT_SYS_CLONE
arch/arm64/include/asm/unistd32.h +41 -0
47 lines not on this page · raw message
arch/ia64/kernel/syscalls/syscall.tbl +1 -0
@@ -343,3 +343,4 @@ 331 common pkey_free sys_pkey_free 332 common pkey_mprotect sys_pkey_mprotect 333 common rseq sys_rseq +# 334 through 423 are reserved to sync up with other architectures
arch/m68k/kernel/syscalls/syscall.tbl +20 -0
@@ -403,3 +403,23 @@ 400 common msgsnd sys_msgsnd 401 common msgrcv sys_msgrcv 402 common msgctl sys_msgctl +403 common clock_gettime64 sys_clock_gettime +404 common clock_settime64 sys_clock_settime +405 common clock_adjtime64 sys_clock_adjtime +406 common clock_getres_time64 sys_clock_getres +407 common clock_nanosleep_time64 sys_clock_nanosleep +408 common timer_gettime64 sys_timer_gettime +409 common timer_settime64 sys_timer_settime +410 common timerfd_gettime64 sys_timerfd_gettime +411 common timerfd_settime64 sys_timerfd_settime +412 common utimensat_time64 sys_utimensat +413 common pselect6_time64 sys_pselect6 +414 common ppoll_time64 sys_ppoll +416 common io_pgetevents_time64 sys_io_pgetevents +417 common recvmmsg_time64 sys_recvmmsg +418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceiv_time64 sys_mq_timedreceive +420 common semtimedop_time64 sys_semtimedop +421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait +422 common futex_time64 sys_futex +423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
arch/microblaze/kernel/syscalls/syscall.tbl +21 -0
@@ -408,3 +408,24 @@ 398 common statx sys_statx 399 common io_pgetevents sys_io_pgetevents_time32 400 common rseq sys_rseq +# 401 and 402 are unused +403 common clock_gettime64 sys_clock_gettime +404 common clock_settime64 sys_clock_settime +405 common clock_adjtime64 sys_clock_adjtime +406 common clock_getres_time64 sys_clock_getres +407 common clock_nanosleep_time64 sys_clock_nanosleep +408 common timer_gettime64 sys_timer_gettime +409 common timer_settime64 sys_timer_settime +410 common timerfd_gettime64 sys_timerfd_gettime +411 common timerfd_settime64 sys_timerfd_settime +412 common utimensat_time64 sys_utimensat +413 common pselect6_time64 sys_pselect6 +414 common ppoll_time64 sys_ppoll +416 common io_pgetevents_time64 sys_io_pgetevents +417 common recvmmsg_time64 sys_recvmmsg +418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceiv_time64 sys_mq_timedreceive +420 common semtimedop_time64 sys_semtimedop +421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait +422 common futex_time64 sys_futex +423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
arch/mips/kernel/syscalls/syscall_n32.tbl +21 -0
@@ -341,3 +341,24 @@ 330 n32 statx sys_statx 331 n32 rseq sys_rseq 332 n32 io_pgetevents compat_sys_io_pgetevents +# 333 through 402 are unassigned to sync up with generic numbers +403 n32 clock_gettime64 sys_clock_gettime +404 n32 clock_settime64 sys_clock_settime +405 n32 clock_adjtime64 sys_clock_adjtime +406 n32 clock_getres_time64 sys_clock_getres +407 n32 clock_nanosleep_time64 sys_clock_nanosleep +408 n32 timer_gettime64 sys_timer_gettime +409 n32 timer_settime64 sys_timer_settime +410 n32 timerfd_gettime64 sys_timerfd_gettime +411 n32 timerfd_settime64 sys_timerfd_settime +412 n32 utimensat_time64 sys_utimensat +413 n32 pselect6_time64 compat_sys_pselect6_time64 +414 n32 ppoll_time64 compat_sys_ppoll_time64 +416 n32 io_pgetevents_time64 sys_io_pgetevents +417 n32 recvmmsg_time64 compat_sys_recvmmsg_time64 +418 n32 mq_timedsend_time64 sys_mq_timedsend +419 n32 mq_timedreceiv_time64 sys_mq_timedreceive +420 n32 semtimedop_time64 sys_semtimedop +421 n32 rt_sigtimedwait_time64 compat_sys_rt_sigtimedwait_time64 +422 n32 futex_time64 sys_futex +423 n32 sched_rr_get_interval_time64 sys_sched_rr_get_interval
arch/mips/kernel/syscalls/syscall_n64.tbl +1 -0
@@ -337,3 +337,4 @@ 326 n64 statx sys_statx 327 n64 rseq sys_rseq 328 n64 io_pgetevents sys_io_pgetevents +# 329 through 423 are reserved to sync up with other architectures
arch/mips/kernel/syscalls/syscall_o32.tbl +20 -0
@@ -391,3 +391,23 @@ 400 o32 msgsnd sys_msgsnd compat_sys_msgsnd 401 o32 msgrcv sys_msgrcv compat_sys_msgrcv 402 o32 msgctl sys_msgctl compat_sys_msgctl +403 o32 clock_gettime64 sys_clock_gettime sys_clock_gettime +404 o32 clock_settime64 sys_clock_settime sys_clock_settime +405 o32 clock_adjtime64 sys_clock_adjtime sys_clock_adjtime +406 o32 clock_getres_time64 sys_clock_getres sys_clock_getres +407 o32 clock_nanosleep_time64 sys_clock_nanosleep sys_clock_nanosleep +408 o32 timer_gettime64 sys_timer_gettime sys_timer_gettime +409 o32 timer_settime64 sys_timer_settime sys_timer_settime +410 o32 timerfd_gettime64 sys_timerfd_gettime sys_timerfd_gettime +411 o32 timerfd_settime64 sys_timerfd_settime sys_timerfd_settime +412 o32 utimensat_time64 sys_utimensat sys_utimensat +413 o32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 +414 o32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +416 o32 io_pgetevents_time64 sys_io_pgetevents sys_io_pgetevents +417 o32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 +418 o32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend +419 o32 mq_timedreceiv_time64 sys_mq_timedreceive sys_mq_timedreceive +420 o32 semtimedop_time64 sys_semtimedop sys_semtimedop +421 o32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 +422 o32 futex_time64 sys_futex sys_futex +423 o32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval
arch/parisc/kernel/syscalls/syscall.tbl +21 -0
@@ -399,3 +399,24 @@ 352 common pkey_free sys_pkey_free 353 common pkey_mprotect sys_pkey_mprotect 354 common rseq sys_rseq +# 355 through 402 are unassigned to sync up with generic numbers +403 32 clock_gettime64 sys_clock_gettime sys_clock_gettime +404 32 clock_settime64 sys_clock_settime sys_clock_settime +405 32 clock_adjtime64 sys_clock_adjtime sys_clock_adjtime +406 32 clock_getres_time64 sys_clock_getres sys_clock_getres +407 32 clock_nanosleep_time64 sys_clock_nanosleep sys_clock_nanosleep +408 32 timer_gettime64 sys_timer_gettime sys_timer_gettime +409 32 timer_settime64 sys_timer_settime sys_timer_settime +410 32 timerfd_gettime64 sys_timerfd_gettime sys_timerfd_gettime +411 32 timerfd_settime64 sys_timerfd_settime sys_timerfd_settime +412 32 utimensat_time64 sys_utimensat sys_utimensat +413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 +414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +416 32 io_pgetevents_time64 sys_io_pgetevents sys_io_pgetevents +417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 +418 32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend +419 32 mq_timedreceiv_time64 sys_mq_timedreceive sys_mq_timedreceive +420 32 semtimedop_time64 sys_semtimedop sys_semtimedop +421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 +422 32 futex_time64 sys_futex sys_futex +423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval
arch/powerpc/kernel/syscalls/syscall.tbl +20 -0
@@ -485,3 +485,23 @@ 400 common msgsnd sys_msgsnd compat_sys_msgsnd 401 common msgrcv sys_msgrcv compat_sys_msgrcv 402 common msgctl sys_msgctl compat_sys_msgctl +403 32 clock_gettime64 sys_clock_gettime sys_clock_gettime +404 32 clock_settime64 sys_clock_settime sys_clock_settime +405 32 clock_adjtime64 sys_clock_adjtime sys_clock_adjtime +406 32 clock_getres_time64 sys_clock_getres sys_clock_getres +407 32 clock_nanosleep_time64 sys_clock_nanosleep sys_clock_nanosleep +408 32 timer_gettime64 sys_timer_gettime sys_timer_gettime +409 32 timer_settime64 sys_timer_settime sys_timer_settime +410 32 timerfd_gettime64 sys_timerfd_gettime sys_timerfd_gettime +411 32 timerfd_settime64 sys_timerfd_settime sys_timerfd_settime +412 32 utimensat_time64 sys_utimensat sys_utimensat +413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 +414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +416 32 io_pgetevents_time64 sys_io_pgetevents sys_io_pgetevents +417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 +418 32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend +419 32 mq_timedreceiv_time64 sys_mq_timedreceive sys_mq_timedreceive +420 32 semtimedop_time64 sys_semtimedop sys_semtimedop +421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 +422 32 futex_time64 sys_futex sys_futex +423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval
arch/s390/kernel/syscalls/syscall.tbl +20 -0
@@ -406,3 +406,23 @@ 400 common msgsnd sys_msgsnd compat_sys_msgsnd 401 common msgrcv sys_msgrcv compat_sys_msgrcv 402 common msgctl sys_msgctl compat_sys_msgctl +403 32 clock_gettime64 - sys_clock_gettime +404 32 clock_settime64 - sys_clock_settime +405 32 clock_adjtime64 - sys_clock_adjtime +406 32 clock_getres_time64 - sys_clock_getres +407 32 clock_nanosleep_time64 - sys_clock_nanosleep +408 32 timer_gettime64 - sys_timer_gettime +409 32 timer_settime64 - sys_timer_settime +410 32 timerfd_gettime64 - sys_timerfd_gettime +411 32 timerfd_settime64 - sys_timerfd_settime +412 32 utimensat_time64 - sys_utimensat +413 32 pselect6_time64 - compat_sys_pselect6_time64 +414 32 ppoll_time64 - compat_sys_ppoll_time64 +416 32 io_pgetevents_time64 - sys_io_pgetevents +417 32 recvmmsg_time64 - compat_sys_recvmmsg_time64 +418 32 mq_timedsend_time64 - sys_mq_timedsend +419 32 mq_timedreceiv_time64 - sys_mq_timedreceive +420 32 semtimedop_time64 - sys_semtimedop +421 32 rt_sigtimedwait_time64 - compat_sys_rt_sigtimedwait_time64 +422 32 futex_time64 - sys_futex +423 32 sched_rr_get_interval_time64 - sys_sched_rr_get_interval
arch/sh/kernel/syscalls/syscall.tbl +20 -0
@@ -406,3 +406,23 @@ 400 common msgsnd sys_msgsnd 401 common msgrcv sys_msgrcv 402 common msgctl sys_msgctl +403 common clock_gettime64 sys_clock_gettime +404 common clock_settime64 sys_clock_settime +405 common clock_adjtime64 sys_clock_adjtime +406 common clock_getres_time64 sys_clock_getres +407 common clock_nanosleep_time64 sys_clock_nanosleep +408 common timer_gettime64 sys_timer_gettime +409 common timer_settime64 sys_timer_settime +410 common timerfd_gettime64 sys_timerfd_gettime +411 common timerfd_settime64 sys_timerfd_settime +412 common utimensat_time64 sys_utimensat +413 common pselect6_time64 sys_pselect6 +414 common ppoll_time64 sys_ppoll +416 common io_pgetevents_time64 sys_io_pgetevents +417 common recvmmsg_time64 sys_recvmmsg +418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceiv_time64 sys_mq_timedreceive +420 common semtimedop_time64 sys_semtimedop +421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait +422 common futex_time64 sys_futex +423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
arch/sparc/kernel/syscalls/syscall.tbl +20 -0
@@ -449,3 +449,23 @@ 400 common msgsnd sys_msgsnd compat_sys_msgsnd 401 common msgrcv sys_msgrcv compat_sys_msgrcv 402 common msgctl sys_msgctl compat_sys_msgctl +403 32 clock_gettime64 sys_clock_gettime sys_clock_gettime +404 32 clock_settime64 sys_clock_settime sys_clock_settime +405 32 clock_adjtime64 sys_clock_adjtime sys_clock_adjtime +406 32 clock_getres_time64 sys_clock_getres sys_clock_getres +407 32 clock_nanosleep_time64 sys_clock_nanosleep sys_clock_nanosleep +408 32 timer_gettime64 sys_timer_gettime sys_timer_gettime +409 32 timer_settime64 sys_timer_settime sys_timer_settime +410 32 timerfd_gettime64 sys_timerfd_gettime sys_timerfd_gettime +411 32 timerfd_settime64 sys_timerfd_settime sys_timerfd_settime +412 32 utimensat_time64 sys_utimensat sys_utimensat +413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 +414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 +416 32 io_pgetevents_time64 sys_io_pgetevents sys_io_pgetevents +417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 +418 32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend +419 32 mq_timedreceiv_time64 sys_mq_timedreceive sys_mq_timedreceive +420 32 semtimedop_time64 sys_semtimedop sys_semtimedop +421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 +422 32 futex_time64 sys_futex sys_futex +423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval
arch/x86/entry/syscalls/syscall_32.tbl +20 -0
@@ -409,3 +409,23 @@ 400 i386 msgsnd sys_msgsnd __ia32_compat_sys_msgsnd 401 i386 msgrcv sys_msgrcv __ia32_compat_sys_msgrcv 402 i386 msgctl sys_msgctl __ia32_compat_sys_msgctl +403 i386 clock_gettime64 sys_clock_gettime __ia32_sys_clock_gettime +404 i386 clock_settime64 sys_clock_settime __ia32_sys_clock_settime +405 i386 clock_adjtime64 sys_clock_adjtime __ia32_sys_clock_adjtime +406 i386 clock_getres_time64 sys_clock_getres __ia32_sys_clock_getres +407 i386 clock_nanosleep_time64 sys_clock_nanosleep __ia32_sys_clock_nanosleep +408 i386 timer_gettime64 sys_timer_gettime __ia32_sys_timer_gettime +409 i386 timer_settime64 sys_timer_settime __ia32_sys_timer_settime +410 i386 timerfd_gettime64 sys_timerfd_gettime __ia32_sys_timerfd_gettime +411 i386 timerfd_settime64 sys_timerfd_settime __ia32_sys_timerfd_settime +412 i386 utimensat_time64 sys_utimensat __ia32_sys_utimensat +413 i386 pselect6_time64 sys_pselect6 __ia32_compat_sys_pselect6_time64 +414 i386 ppoll_time64 sys_ppoll __ia32_compat_sys_ppoll_time64 +416 i386 io_pgetevents_time64 sys_io_pgetevents __ia32_sys_io_pgetevents +417 i386 recvmmsg_time64 sys_recvmmsg __ia32_compat_sys_recvmmsg_time64 +418 i386 mq_timedsend_time64 sys_mq_timedsend __ia32_sys_mq_timedsend +419 i386 mq_timedreceiv_time64 sys_mq_timedreceive __ia32_sys_mq_timedreceive +420 i386 semtimedop_time64 sys_semtimedop __ia32_sys_semtimedop +421 i386 rt_sigtimedwait_time64 sys_rt_sigtimedwait __ia32_compat_sys_rt_sigtimedwait_time64 +422 i386 futex_time64 sys_futex __ia32_sys_futex +423 i386 sched_rr_get_interval_time64 sys_sched_rr_get_interval __ia32_sys_sched_rr_get_interval
arch/xtensa/kernel/syscalls/syscall.tbl +21 -0
@@ -373,3 +373,24 @@ 350 common pkey_free sys_pkey_free 351 common statx sys_statx 352 common rseq sys_rseq +# 353 through 402 are unassigned to sync up with generic numbers +403 common clock_gettime64 sys_clock_gettime +404 common clock_settime64 sys_clock_settime +405 common clock_adjtime64 sys_clock_adjtime +406 common clock_getres_time64 sys_clock_getres +407 common clock_nanosleep_time64 sys_clock_nanosleep +408 common timer_gettime64 sys_timer_gettime +409 common timer_settime64 sys_timer_settime +410 common timerfd_gettime64 sys_timerfd_gettime +411 common timerfd_settime64 sys_timerfd_settime +412 common utimensat_time64 sys_utimensat +413 common pselect6_time64 sys_pselect6 +414 common ppoll_time64 sys_ppoll +416 common io_pgetevents_time64 sys_io_pgetevents +417 common recvmmsg_time64 sys_recvmmsg +418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceiv_time64 sys_mq_timedreceive +420 common semtimedop_time64 sys_semtimedop +421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait +422 common futex_time64 sys_futex +423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
include/uapi/asm-generic/unistd.h +44 -1
53 lines not on this page · raw message
scripts/checksyscalls.sh +40 -0
@@ -84,6 +84,26 @@ cat << EOF #define __IGNORE_statfs64 #define __IGNORE_llseek #define __IGNORE_mmap2 +#define __IGNORE_clock_gettime64 +#define __IGNORE_clock_settime64 +#define __IGNORE_clock_adjtime64 +#define __IGNORE_clock_getres_time64 +#define __IGNORE_clock_nanosleep_time64 +#define __IGNORE_timer_gettime64 +#define __IGNORE_timer_settime64 +#define __IGNORE_timerfd_gettime64 +#define __IGNORE_timerfd_settime64 +#define __IGNORE_utimensat_time64 +#define __IGNORE_pselect6_time64 +#define __IGNORE_ppoll_time64 +#define __IGNORE_io_pgetevents_time64 +#define __IGNORE_recvmmsg_time64 +#define __IGNORE_mq_timedsend_time64 +#define __IGNORE_mq_timedreceiv_time64 +#define __IGNORE_semtimedop_time64 +#define __IGNORE_rt_sigtimedwait_time64 +#define __IGNORE_futex_time64 +#define __IGNORE_sched_rr_get_interval_time64 #else #define __IGNORE_sendfile #define __IGNORE_ftruncate
@@ -98,6 +118,26 @@ cat << EOF #define __IGNORE_statfs #define __IGNORE_lseek #define __IGNORE_mmap +#define __IGNORE_clock_gettime +#define __IGNORE_clock_settime +#define __IGNORE_clock_adjtime +#define __IGNORE_clock_getres +#define __IGNORE_clock_nanosleep +#define __IGNORE_timer_gettime +#define __IGNORE_timer_settime +#define __IGNORE_timerfd_gettime +#define __IGNORE_timerfd_settime +#define __IGNORE_utimensat +#define __IGNORE_pselect6 +#define __IGNORE_ppoll +#define __IGNORE_io_pgetevents +#define __IGNORE_recvmmsg +#define __IGNORE_mq_timedsend +#define __IGNORE_mq_timedreceiv +#define __IGNORE_semtimedop +#define __IGNORE_rt_sigtimedwait +#define __IGNORE_futex +#define __IGNORE_sched_rr_get_interval #endif /* i386-specific or historical system calls */
Signature · 1 line
2.20.0
Andy Lutomirski
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
Quoted 35 lines · Arnd Bergmann
This adds 21 new system calls on each ABI that has 32-bit
time_ttoday. All of these have the exact same semantics as their existing counterparts, and the new ones all have macro names that end in 'time64' for clarification.This gets us to the point of being able to safely use a C library that has 64-bit
time_tin user space. There are still a couple of loose ends to tie up in various areas of the code, but this is the big one, and should be entirely uncontroversial at this point.In particular, there are four system calls (getitimer, setitimer, waitid, and getrusage) that don't have a 64-bit counterpart yet, but these can all be safely implemented in the C library by wrapping around the existing system calls because the 32-bit
time_tthey pass only counts elapsed time, not time since the epoch. They will be dealt with later.Signed-off-by Arnd Bergmann <[email protected]>---
The one point that still needs to be agreed on is the actual number assignment. Following the earlier patch that added the sysv IPC calls with common numbers where possible, I also tried the same here, using consistent numbers on all 32-bit architectures.There are a couple of minor issues with this:
- On asm-generic, we now leave the numbers from 295 to 402 unassigned, which wastes a small amount of kernel .data segment. Originally I had asm-generic start at 300 and everyone else start at 400 here, which was also not perfect, and we have gone beyond 400 already, so I ended up just using the same numbers as the rest here.
Quoted 5 lines
- Once we get to 512, we clash with the x32 numbers (unless we remove x32 support first), and probably have to skip a few more. I also considered using the 512..547 space for 32-bit-only calls (which never clash with x32), but that also seems to add a bit of complexity.
I have a patch that I'll send soon to make x32 use its own table. As far as I'm concerned, 547 is *it*. 548 is just a normal number and is not special. But let's please not reuse 512..547 for other purposes on x86 variants -- that way lies even more confusion, IMO.
--Andy
Arnd Bergmann
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
Quoted 11 lines · Andy Lutomirski
Quoted 5 lines · Arnd Bergmann
- Once we get to 512, we clash with the x32 numbers (unless we remove x32 support first), and probably have to skip a few more. I also considered using the 512..547 space for 32-bit-only calls (which never clash with x32), but that also seems to add a bit of complexity.
I have a patch that I'll send soon to make x32 use its own table. As far as I'm concerned, 547 is *it*. 548 is just a normal number and is not special. But let's please not reuse 512..547 for other purposes on x86 variants -- that way lies even more confusion, IMO.
Fair enough, the space for those numbers is cheap enough here. I take it you mean we also should not reuse that number space if we were to decide to remove x32 soon, but you are not worried about clashing with arch/alpha when everything else uses consistent numbers?
Arnd
Andy Lutomirski
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
Quoted 14 lines · Arnd Bergmann
Quoted 11 lines · Andy Lutomirski
Quoted 5 lines · Arnd Bergmann
- Once we get to 512, we clash with the x32 numbers (unless we remove x32 support first), and probably have to skip a few more. I also considered using the 512..547 space for 32-bit-only calls (which never clash with x32), but that also seems to add a bit of complexity.
I have a patch that I'll send soon to make x32 use its own table. As far as I'm concerned, 547 is *it*. 548 is just a normal number and is not special. But let's please not reuse 512..547 for other purposes on x86 variants -- that way lies even more confusion, IMO.
Quoted 6 lines
Fair enough, the space for those numbers is cheap enough here. I take it you mean we also should not reuse that number space if we were to decide to remove x32 soon, but you are not worried about clashing with
arch/alphawhen everything else uses consistent numbers?
I think we have two issues if we reuse those numbers for new syscalls. First, I'd really like to see new syscalls be numbered consistently everywhere, or at least on all x86 variants, and we can't on x32 because they mean something else. Perhaps more importantly, due to what is arguably a rather severe bug, issuing a native x86_64 syscall (x32 bit clear) with nr in the range 512..547 does *not* return -ENOSYS on a kernel with x32 enabled. Instead it does something that is somewhat arbitrary. With my patch applied, it will return -ENOSYS, but old kernels will still exist, and this will break syscall probing.
Can we perhaps just start the consistent numbers above 547 or maybe block out 512..547 in the new regime?
--Andy
Arnd Bergmann
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
Quoted 10 lines · Andy Lutomirski
I think we have two issues if we reuse those numbers for new syscalls. First, I'd really like to see new syscalls be numbered consistently everywhere, or at least on all x86 variants, and we can't on x32 because they mean something else. Perhaps more importantly, due to what is arguably a rather severe bug, issuing a native
x86_64syscall (x32 bit clear) with nr in the range 512..547 does *not* return-ENOSYSon a kernel with x32 enabled. Instead it does something that is somewhat arbitrary. With my patch applied, it will return-ENOSYS, but old kernels will still exist, and this will break syscall probing.
Quoted 2 lines
Can we perhaps just start the consistent numbers above 547 or maybe block out 512..547 in the new regime?
I'm definitely fine with not reusing them ever, and jumping from 511 to 548 when we get there on all architectures, if you think that helps.
While we could also jump to 548 *now*, I think that would be a bit wasteful. Syscall numbers are fairly cheap, but not entirely free, especially when you consider architectures like mips that have an upper bound of 1000 syscalls before they have to get inventive.
Arnd
Russell King - ARM Linux admin
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
In reply to Andy LutomirskiQuoted 32 lines · Andy Lutomirski
Quoted 14 lines · Arnd Bergmann
Quoted 11 lines · Andy Lutomirski
Quoted 5 lines · Arnd Bergmann
- Once we get to 512, we clash with the x32 numbers (unless we remove x32 support first), and probably have to skip a few more. I also considered using the 512..547 space for 32-bit-only calls (which never clash with x32), but that also seems to add a bit of complexity.
I have a patch that I'll send soon to make x32 use its own table. As far as I'm concerned, 547 is *it*. 548 is just a normal number and is not special. But let's please not reuse 512..547 for other purposes on x86 variants -- that way lies even more confusion, IMO.
Quoted 6 lines
Fair enough, the space for those numbers is cheap enough here. I take it you mean we also should not reuse that number space if we were to decide to remove x32 soon, but you are not worried about clashing with
arch/alphawhen everything else uses consistent numbers?I think we have two issues if we reuse those numbers for new syscalls. First, I'd really like to see new syscalls be numbered consistently everywhere, or at least on all x86 variants, and we can't on x32 because they mean something else. Perhaps more importantly, due to what is arguably a rather severe bug, issuing a native
x86_64syscall (x32 bit clear) with nr in the range 512..547 does *not* return-ENOSYSon a kernel with x32 enabled. Instead it does something that is somewhat arbitrary. With my patch applied, it will return-ENOSYS, but old kernels will still exist, and this will break syscall probing.
Quoted 2 lines
Can we perhaps just start the consistent numbers above 547 or maybe block out 512..547 in the new regime?
I don't think you gain much with that kind of scheme - it won't take very long before an architecture misses having a syscall added, and then someone else adds their own. Been there with ARM - I was keeping the syscall table in the same order as x86 for new syscalls, but now that others have been adding syscalls to the table since I converted ARM to the tabular form, that's now gone out the window.
So, I think it's completely pointless to do what you're suggesting. We'll just end up with a big hole in the middle of the syscall table and then revert back to random numbering of syscalls thereafter again.
Signature · 7 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
Geert Uytterhoeven
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
Hi Russell,
Quoted 32 lines · Russell King - ARM Linux admin
Quoted 31 lines · Andy Lutomirski
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Andy Lutomirski
Quoted 5 lines · Arnd Bergmann
- Once we get to 512, we clash with the x32 numbers (unless we remove x32 support first), and probably have to skip a few more. I also considered using the 512..547 space for 32-bit-only calls (which never clash with x32), but that also seems to add a bit of complexity.
I have a patch that I'll send soon to make x32 use its own table. As far as I'm concerned, 547 is *it*. 548 is just a normal number and is not special. But let's please not reuse 512..547 for other purposes on x86 variants -- that way lies even more confusion, IMO.
Quoted 6 lines
Fair enough, the space for those numbers is cheap enough here. I take it you mean we also should not reuse that number space if we were to decide to remove x32 soon, but you are not worried about clashing with
arch/alphawhen everything else uses consistent numbers?I think we have two issues if we reuse those numbers for new syscalls. First, I'd really like to see new syscalls be numbered consistently everywhere, or at least on all x86 variants, and we can't on x32 because they mean something else. Perhaps more importantly, due to what is arguably a rather severe bug, issuing a native
x86_64syscall (x32 bit clear) with nr in the range 512..547 does *not* return-ENOSYSon a kernel with x32 enabled. Instead it does something that is somewhat arbitrary. With my patch applied, it will return-ENOSYS, but old kernels will still exist, and this will break syscall probing.
Quoted 7 lines
Quoted 2 lines
Can we perhaps just start the consistent numbers above 547 or maybe block out 512..547 in the new regime?
I don't think you gain much with that kind of scheme - it won't take very long before an architecture misses having a syscall added, and then someone else adds their own. Been there with ARM - I was keeping the syscall table in the same order as x86 for new syscalls, but now
Same for m68k, and probably other architectures.
Quoted 6 lines
that others have been adding syscalls to the table since I converted ARM to the tabular form, that's now gone out the window.
So, I think it's completely pointless to do what you're suggesting. We'll just end up with a big hole in the middle of the syscall table and then revert back to random numbering of syscalls thereafter again.
I believe the plan is to add future syscalls for all architectures in a single commit, to keep everything in sync.
Regardless, I'm wondering what to do with the holes marked "room for arch specific calls".
When is a syscall really arch-specific, and can it be added there, and when does it turn out (later) that it isn't, breaking the synchronization again?
The pkey syscalls may be a bad example, as AFAIU they can be implemented on some architectures, but not on some others. Still, I had skipped them when adding new syscalls to m68k.
Perhaps we should get rid of the notion of "arch-specific syscalls", and reserve a slot everywhere anyway?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Arnd Bergmann
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
Quoted 19 lines · Geert Uytterhoeven
Quoted 11 lines · Russell King - ARM Linux admin
Quoted 5 lines · Andy Lutomirski
Quoted 1 line · Arnd Bergmann
On Fri, Jan 18, 2019 at 7:50 PM Andy Lutomirski <[email protected]> wrote:
Can we perhaps just start the consistent numbers above 547 or maybe block out 512..547 in the new regime?
I don't think you gain much with that kind of scheme - it won't take very long before an architecture misses having a syscall added, and then someone else adds their own. Been there with ARM - I was keeping the syscall table in the same order as x86 for new syscalls, but now
Same for m68k, and probably other architectures.
Quoted 3 lines
that others have been adding syscalls to the table since I converted ARM to the tabular form, that's now gone out the window.
Quoted 6 lines
Quoted 3 lines
So, I think it's completely pointless to do what you're suggesting. We'll just end up with a big hole in the middle of the syscall table and then revert back to random numbering of syscalls thereafter again.
I believe the plan is to add future syscalls for all architectures in a single commit, to keep everything in sync.
Yes, that is the idea. This was not realistic before, since each one of the old architectures had its own way of describing the system call tables, and many needed a different set of quirks.
Since (almost) everything is now converted to the syscall.tbl format, we have removed all obsolete architectures, and a lot of the quirks (x32, spu, s390-31) won't matter as much in the future, I think it is now possible to do it.
We could even extend scripts/checksyscalls.sh to warn if a new syscall above 423 is not added to all 16 tables at the same time.
Quoted 5 lines
Regardless, I'm wondering what to do with the holes marked "room for arch specific calls".
When is a syscall really arch-specific, and can it be added there, and when does it turn out (later) that it isn't, breaking the synchronization again?
We've had a bit of that already, with cacheflush(), which exists on a couple of architectures, including some that use the first 'arch specific' slot (244) of the asm-generic table. I think this will be rare enough that we can figure out a solution when we get there.
Quoted 6 lines
The pkey syscalls may be a bad example, as AFAIU they can be implemented on some architectures, but not on some others. Still, I had skipped them when adding new syscalls to m68k.
Perhaps we should get rid of the notion of "arch-specific syscalls", and reserve a slot everywhere anyway?
I don't mind calling the hole something else if that helps. Out of principle I would already assume that anything we add for x86 or the generic table should be added everywhere, but we can make it broader than that.
Arnd
Arnd Bergmann
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
Quoted 17 lines · Arnd Bergmann
Quoted 5 lines · Geert Uytterhoeven
Regardless, I'm wondering what to do with the holes marked "room for arch specific calls".
When is a syscall really arch-specific, and can it be added there, and when does it turn out (later) that it isn't, breaking the synchronization again?We've had a bit of that already, with
cacheflush(), which exists on a couple of architectures, including some that use the first 'arch specific' slot (244) of the asm-generic table. I think this will be rare enough that we can figure out a solution when we get there.Quoted 4 lines
The pkey syscalls may be a bad example, as AFAIU they can be implemented on some architectures, but not on some others. Still, I had skipped them when adding new syscalls to m68k.
Quoted 7 lines
Quoted 2 lines
Perhaps we should get rid of the notion of "arch-specific syscalls", and reserve a slot everywhere anyway?
I don't mind calling the hole something else if that helps. Out of principle I would already assume that anything we add for x86 or the generic table should be added everywhere, but we can make it broader than that.
Applying this fixup below,
ARnd
(quoted diff) +0 -0
b/arch/x86/entry/syscalls/syscall_32.tbl
index d9c2d2eea044..955ab6a3b61f 100644
arch/x86/entry/syscalls/syscall_32.tbl +1 -1
@@ -398,7 +398,7 @@ 384 i386 arch_prctl sys_arch_prctl __ia32_compat_sys_arch_prctl 385 i386 io_pgetevents sys_io_pgetevents_time32 __ia32_compat_sys_io_pgetevents 386 i386 rseq sys_rseq __ia32_sys_rseq -# room for arch specific syscalls +# don't use numbers 387 through 392, add new calls at the end
393 i386 semget sys_semget
__ia32_sys_semget
394 i386 semctl sys_semctl
__ia32_compat_sys_semctl
395 i386 shmget sys_shmget
__ia32_sys_shmget
(quoted diff) +0 -0
b/arch/x86/entry/syscalls/syscall_64.tbl
index 43a622aec07e..2ae92fddb6d5 100644
arch/x86/entry/syscalls/syscall_64.tbl +2 -0
@@ -343,6 +343,8 @@ 332 common statx __x64_sys_statx 333 common io_pgetevents __x64_sys_io_pgetevents 334 common rseq __x64_sys_rseq +# don't use numbers 387 through 423, add new calls after the last +# 'common' entry # # x32-specific system call numbers start at 512 to avoid cache impact
(quoted diff) +0 -0
b/include/uapi/asm-generic/unistd.h
index 53831e4a4c86..acf9a07ab2ff 100644
include/uapi/asm-generic/unistd.h +0 -0
@@ -740,7 +740,7 @@ __SC_COMP_3264(__NR_io_pgetevents,
sys_io_pgetevents_time32, sys_io_pgetevents,
__SYSCALL(__NR_rseq, sys_rseq)
#define __NR_kexec_file_load 294
__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
-/* 295 through 402 are unassigned to sync up with generic numbers */ +/* 295 through 402 are unassigned to sync up with generic numbers, don't use */
#if __BITS_PER_LONG == 32
#define __NR_clock_gettime64 403
__SYSCALL(__NR_clock_gettime64, sys_clock_gettime)
Arnd Bergmann
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
In reply to Andy LutomirskiQuoted 6 lines · Andy Lutomirski
On Fri, Jan 18, 2019 at 8:25 AM Arnd Bergmann <[email protected]> wrote:
I have a patch that I'll send soon to make x32 use its own table. As far as I'm concerned, 547 is *it*. 548 is just a normal number and is not special. But let's please not reuse 512..547 for other purposes on x86 variants -- that way lies even more confusion, IMO.
(trimming Cc list, as this is getting a little off-topic most most)
Just so I understand: do you mean duplicating the .tbl file, or just the resulting table of entry points?
In either way, how will that work with the new io_uring_setup() system call that will have to use the compat entry point? Are you planning to use the same syscall number as x86_64 but point it to the compat function, or do we still need a new syscall number for x32 in the regular range?
Arnd
Re: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
In reply to Arnd BergmannQuoted 17 lines · Arnd Bergmann
This adds 21 new system calls on each ABI that has 32-bit
time_ttoday. All of these have the exact same semantics as their existing counterparts, and the new ones all have macro names that end in 'time64' for clarification.This gets us to the point of being able to safely use a C library that has 64-bit
time_tin user space. There are still a couple of loose ends to tie up in various areas of the code, but this is the big one, and should be entirely uncontroversial at this point.In particular, there are four system calls (getitimer, setitimer, waitid, and getrusage) that don't have a 64-bit counterpart yet, but these can all be safely implemented in the C library by wrapping around the existing system calls because the 32-bit
time_tthey pass only counts elapsed time, not time since the epoch. They will be dealt with later.
Quoted 3 lines
Signed-off-by Arnd Bergmann <[email protected]>arch/m68k/kernel/syscalls/syscall.tbl | 20 +++++++++
For m68k:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
In reply to Arnd BergmannQuoted 17 lines · Arnd Bergmann
This adds 21 new system calls on each ABI that has 32-bit
time_ttoday. All of these have the exact same semantics as their existing counterparts, and the new ones all have macro names that end in 'time64' for clarification.This gets us to the point of being able to safely use a C library that has 64-bit
time_tin user space. There are still a couple of loose ends to tie up in various areas of the code, but this is the big one, and should be entirely uncontroversial at this point.In particular, there are four system calls (getitimer, setitimer, waitid, and getrusage) that don't have a 64-bit counterpart yet, but these can all be safely implemented in the C library by wrapping around the existing system calls because the 32-bit
time_tthey pass only counts elapsed time, not time since the epoch. They will be dealt with later.
Quoted 3 lines
Signed-off-by Arnd Bergmann <[email protected]>--- arch/s390/kernel/syscalls/syscall.tbl | 20 +++++++++
For the s390 bits:
Arnd Bergmann
maintainerRe: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
In reply to Arnd BergmannQuoted 10 lines · Arnd Bergmann
This adds 21 new system calls on each ABI that has 32-bit
time_ttoday. All of these have the exact same semantics as their existing counterparts, and the new ones all have macro names that end in 'time64' for clarification.This gets us to the point of being able to safely use a C library that has 64-bit
time_tin user space. There are still a couple of loose ends to tie up in various areas of the code, but this is the big one, and should be entirely uncontroversial at this point.
I've successfully tested this with musl and LTP now, using an i386 kernel. The musl port I used is at
https://git.linaro.org/people/arnd.bergmann/musl-y2038.git/
This is just an updated version of what I used for testing last year, using the current syscall assignment, and going back to the time32 versions of getitimer/setitimer and wait4/waitid/getusage.
It's certainly not intended for merging like this, but a proper musl port is under discussion now, and this should be sufficient if anyone else wants to try out the new syscall ABI before we merge it.
The LTP I have is heavily hacked, and has a number of failures resulting from differences between musl and glibc, or from the way we convert between the kernel types and the user space types.
The testing found one minor bug in all the kernel syscall tables:
Quoted 2 lines
+418 common mq_timedsend_time64 sys_mq_timedsend +419 common mq_timedreceiv_time64 sys_mq_timedreceive
While this would have fit in with umount(), creat() and mknod(), it was unintentional, and I've changed it back to mq_timedreceive_time64 (with an added 'e').
Arnd
Re: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures
In reply to Arnd BergmannQuoted 10 lines · Arnd Bergmann
This adds 21 new system calls on each ABI that has 32-bit
time_ttoday. All of these have the exact same semantics as their existing counterparts, and the new ones all have macro names that end in 'time64' for clarification.This gets us to the point of being able to safely use a C library that has 64-bit
time_tin user space. There are still a couple of loose ends to tie up in various areas of the code, but this is the big one, and should be entirely uncontroversial at this point.
Quoted 8 lines
In particular, there are four system calls (getitimer, setitimer, waitid, and getrusage) that don't have a 64-bit counterpart yet, but these can all be safely implemented in the C library by wrapping around the existing system calls because the 32-bit
time_tthey pass only counts elapsed time, not time since the epoch. They will be dealt with later.Signed-off-by Arnd Bergmann <[email protected]>
(as long as compat follows the arm32 syscall numbers)
Quoted 7 lines · Arnd Bergmann
This is a minor update of the patches I posted last week, I would like to add this into linux-next now, but would still do changes if there are concerns about the contents. The first version did not see a lot of replies, which could mean that either everyone is happy with it, or that it was largely ignored.
See also the article at https://lwn.net/Articles/776435/.
I would be happy to read "Approaching the kernel year-2038 end game" however it is behind a pay wall. Perhaps it may be best to just host interesting articles about open source idea elsewhere.
Dennis Clarke
Arnd Bergmann
maintainerQuoted 8 lines · Dennis Clarke
Quoted 6 lines · Arnd Bergmann
This is a minor update of the patches I posted last week, I would like to add this into linux-next now, but would still do changes if there are concerns about the contents. The first version did not see a lot of replies, which could mean that either everyone is happy with it, or that it was largely ignored.
Quoted 5 lines
Quoted 1 line
See also the article at https://lwn.net/Articles/776435/.
I would be happy to read "Approaching the kernel year-2038 end game" however it is behind a pay wall. Perhaps it may be best to just host interesting articles about open source idea elsewhere.
It's a short summary of the current state. You can also find a video and slides from my ELC presentation online for a little more context.
Generally speaking, I'd recommend paying for the subscription to lwn.net to anyone interested in the kernel, but it should become visible to everyone with the next day (a week after the initial publication). In the meantime, you can find the article at
https://lwn.net/SubscriberLink/776435/a59d93d01d1addfc/.
Finally, I've made a list of the remaining work that Deepa and I are planning to still continue (this should be mostly complete but may be missing a few things):
syscalls
- merge big series for 5.1, to allow time64 syscalls
- waitid/wait4/getrusage should get a replacement based on __kernel_timespec
- getitimer/setitimer should probably follow getrusage
- vdso, waiting for consolidation series from Vincenzo Frascino before adding time64 entry points
file systems
- range checks on timestamps
- xfs
- NFS
- hfs/hfsplus
- coda
- hostfs
- relatime_need_update
drivers
- media
- alsa
- sockets
- af_packet
- ppp ioctl
- rtc ioctl
- omap3isp
core kernel
- fix ELF core files (elfcore.h)
- syscall Audit code (kernel/audit.c, kernel/auditsc.c)
- make all time32 code conditional
- remove include/linux/timekeeping32.h
- remove compat_time* from time32.h
- remove timeval
- remove timespec
- remove time_t
Arnd
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · Dennis Clarke
Quoted 6 lines · Arnd Bergmann
This is a minor update of the patches I posted last week, I would like to add this into linux-next now, but would still do changes if there are concerns about the contents. The first version did not see a lot of replies, which could mean that either everyone is happy with it, or that it was largely ignored.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
See also the article at https://lwn.net/Articles/776435/.
I would be happy to read "Approaching the kernel year-2038 end game" however it is behind a pay wall. Perhaps it may be best to just host interesting articles about open source idea elsewhere.
It's a short summary of the current state.
Oh, I pay. Also to FSF and other places however I was merely ranting very very quietly that so much open source is becoming commercialized in so many ways. Sort of expected really.
Pardon my little rant .. I will go back to hacking OpenSSL 1.1.1a and trying to get Apache httpd 2.4.38 release running cleanly.
Dennis
James Bottomley
maintainerQuoted 7 lines · Dennis Clarke
Quoted 6 lines · Arnd Bergmann
This is a minor update of the patches I posted last week, I would like to add this into linux-next now, but would still do changes if there are concerns about the contents. The first version did not see a lot of replies, which could mean that either everyone is happy with it, or that it was largely ignored.
Quoted 5 lines
Quoted 1 line
See also the article at https://lwn.net/Articles/776435/.
I would be happy to read "Approaching the kernel year-2038 end game" however it is behind a pay wall. Perhaps it may be best to just host interesting articles about open source idea elsewhere.
Hey, this is an unfair characterization: lwn.net operates an early access subscription model, so you can't read the above for 14 days after publication without paying for an lwn.net subscription, but by the time these patches are upstream there will be no paywall because it will expire on 24 January and that URL will then be readable by all. That makes LWN.net a nice, reliable resource for us while still supporting some business model to keep it going.
James
Quoted 7 lines · Arnd Bergmann
This is a minor update of the patches I posted last week, I would like to add this into linux-next now, but would still do changes if there are concerns about the contents. The first version did not see a lot of replies, which could mean that either everyone is happy with it, or that it was largely ignored.
See also the article at https://lwn.net/Articles/776435/.
I would be happy to read "Approaching the kernel year-2038 end game" however it is behind a pay wall. Perhaps it may be best to just host interesting articles about open source idea elsewhere.
Dennis Clarke