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.
Arnd
Arnd Bergmann (15): 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 mips: fix n32 compat_ipc_parse_version 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
arch/alpha/include/asm/unistd.h | 10 - arch/alpha/include/uapi/asm/unistd.h | 5 + arch/alpha/kernel/syscalls/syscall.tbl | 15 +- arch/arm/include/asm/unistd.h | 1 - arch/arm/tools/syscall.tbl | 8 +- arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 10 +- arch/ia64/include/asm/unistd.h | 14 - arch/ia64/include/uapi/asm/unistd.h | 2 + arch/ia64/kernel/syscalls/syscall.tbl | 10 +- arch/m68k/kernel/syscalls/syscall.tbl | 16 + arch/microblaze/kernel/syscalls/syscall.tbl | 6 +- arch/mips/Kconfig | 1 + arch/mips/kernel/syscalls/syscall_n32.tbl | 6 +- arch/mips/kernel/syscalls/syscall_n64.tbl | 6 +- arch/mips/kernel/syscalls/syscall_o32.tbl | 11 + arch/parisc/include/asm/unistd.h | 3 - arch/parisc/kernel/syscalls/syscall.tbl | 4 + arch/powerpc/kernel/syscalls/syscall.tbl | 12 + arch/s390/include/asm/unistd.h | 3 - arch/s390/kernel/syscalls/syscall.tbl | 15 + arch/sh/include/uapi/asm/unistd_32.h | 403 -------------------- arch/sh/kernel/syscalls/syscall.tbl | 16 + arch/sparc/include/asm/unistd.h | 5 - arch/sparc/kernel/sys_sparc_64.c | 2 +- arch/sparc/kernel/syscalls/syscall.tbl | 16 + arch/x86/entry/syscalls/syscall_32.tbl | 11 + arch/xtensa/kernel/syscalls/syscall.tbl | 7 +- 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 + 35 files changed, 271 insertions(+), 506 deletions(-) delete mode 100644 arch/sh/include/uapi/asm/unistd_32.h
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.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- 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(-)
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index 0b08ebd2dfde..9ba6110b10b9 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h @@ -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
diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index b2513922dcb5..013e0bcacc39 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h @@ -15,6 +15,8 @@
#define __NR_Linux 1024
+#define __NR_umount __NR_umount2 + #include <asm/unistd_64.h>
#endif /* _UAPI_ASM_IA64_UNISTD_H */ diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl index b22203b40bfe..e97caf51be42 100644 --- a/arch/ia64/kernel/syscalls/syscall.tbl +++ b/arch/ia64/kernel/syscalls/syscall.tbl @@ -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
All architectures should implement these two, so assign numbers and hook them up on ia64.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/ia64/kernel/syscalls/syscall.tbl | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl index e97caf51be42..52585281205b 100644 --- a/arch/ia64/kernel/syscalls/syscall.tbl +++ b/arch/ia64/kernel/syscalls/syscall.tbl @@ -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
Most 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.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/ia64/kernel/syscalls/syscall.tbl | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl index 52585281205b..2e93dbdcdb80 100644 --- a/arch/ia64/kernel/syscalls/syscall.tbl +++ b/arch/ia64/kernel/syscalls/syscall.tbl @@ -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
The 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.
Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/alpha/kernel/syscalls/syscall.tbl | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl index 7b56a53be5e3..e09558edae73 100644 --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl @@ -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
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.
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.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- 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(-)
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index 21b706a5b772..564ba87bdc38 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h @@ -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 diff --git a/arch/alpha/include/uapi/asm/unistd.h b/arch/alpha/include/uapi/asm/unistd.h index 9ba724f116f1..4507071f995f 100644 --- a/arch/alpha/include/uapi/asm/unistd.h +++ b/arch/alpha/include/uapi/asm/unistd.h @@ -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 */ diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl index e09558edae73..f920b65e8c49 100644 --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl @@ -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
The 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.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- 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(-)
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h index 88ef2ce1f69a..d713587dfcf4 100644 --- a/arch/arm/include/asm/unistd.h +++ b/arch/arm/include/asm/unistd.h @@ -45,7 +45,6 @@ * Unimplemented (or alternatively implemented) syscalls */ #define __IGNORE_fadvise64_64 -#define __IGNORE_migrate_pages
#ifdef __ARM_EABI__ /* diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl index 8edf93b4490f..86de9eb34296 100644 --- a/arch/arm/tools/syscall.tbl +++ b/arch/arm/tools/syscall.tbl @@ -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 diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index a7b1fc58ffdf..261216c3336e 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -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 diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 04ee190b90fe..355fe2bc035b 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -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, sys_migrate_pages)
/* * Please add new compat syscalls above this comment and update
On Thu, Jan 10, 2019 at 05:24:26PM +0100, Arnd Bergmann wrote:
The 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.
Signed-off-by: Arnd Bergmann arnd@arndb.de
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(-)
[...]
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 04ee190b90fe..355fe2bc035b 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -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, sys_migrate_pages)
Should be compat_sys_migrate_pages instead?
Will
On Thu, Jan 10, 2019 at 5:32 PM Will Deacon will.deacon@arm.com wrote:
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 04ee190b90fe..355fe2bc035b 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -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, sys_migrate_pages)
Should be compat_sys_migrate_pages instead?
Yes, good catch! Fixed now.
Thanks,
Arnd
A 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.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- 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(-)
diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl index 86de9eb34296..20ed7e026723 100644 --- a/arch/arm/tools/syscall.tbl +++ b/arch/arm/tools/syscall.tbl @@ -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 diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 261216c3336e..2c30e6f145ff 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -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 diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 355fe2bc035b..19f3f58b6146 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -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, 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
On Thu, Jan 10, 2019 at 05:24:27PM +0100, Arnd Bergmann wrote:
A 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.
Signed-off-by: Arnd Bergmann arnd@arndb.de
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(-)
diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl index 86de9eb34296..20ed7e026723 100644 --- a/arch/arm/tools/syscall.tbl +++ b/arch/arm/tools/syscall.tbl @@ -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 diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 261216c3336e..2c30e6f145ff 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -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 diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 355fe2bc035b..19f3f58b6146 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -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, sys_migrate_pages) +#define __NR_kexec_file_load 401 +__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
Hmm, I wonder if we need a compat wrapper for this, or are we assuming that the early entry code has already zero-extended the long and pointer arguments?
Will
On Thu, Jan 10, 2019 at 5:39 PM Will Deacon will.deacon@arm.com wrote:
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 355fe2bc035b..19f3f58b6146 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -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, sys_migrate_pages) +#define __NR_kexec_file_load 401 +__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
Hmm, I wonder if we need a compat wrapper for this, or are we assuming that the early entry code has already zero-extended the long and pointer arguments?
Yes, that is generally the assumption for compat syscalls.
s390 needs some extra magic to do a 31-to-64 extension on pointer arguments, and I think sometimes we need a special wrapper to do sign-extension of 32-bit arguments into 64-bit, but the arguments here should not need that.
Arnd
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_SECCOMP is implemented, the system call just returns -ENOSYS.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/m68k/kernel/syscalls/syscall.tbl | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl index 1a95c4a1bc0d..85779d6ef935 100644 --- a/arch/m68k/kernel/syscalls/syscall.tbl +++ b/arch/m68k/kernel/syscalls/syscall.tbl @@ -387,3 +387,4 @@ 377 common preadv2 sys_preadv2 378 common pwritev2 sys_pwritev2 379 common statx sys_statx +380 common seccomp sys_seccomp
When I merged this patch, the file was accidentally left intact instead of being removed, which means any changes to syscall.tbl have no effect.
Fixes: 2b3c5a99d5f3 ("sh: generate uapi header and syscall table header files") Signed-off-by: Arnd Bergmann arnd@arndb.de --- 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
diff --git a/arch/sh/include/uapi/asm/unistd_32.h b/arch/sh/include/uapi/asm/unistd_32.h deleted file mode 100644 index 31c85aa251ab..000000000000 --- a/arch/sh/include/uapi/asm/unistd_32.h +++ /dev/null @@ -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 */
statx is available on almost all other architectures but got missed on sh, so add it now.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/sh/kernel/syscalls/syscall.tbl | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl index 21ec75288562..a70db013dbc7 100644 --- a/arch/sh/kernel/syscalls/syscall.tbl +++ b/arch/sh/kernel/syscalls/syscall.tbl @@ -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
While reading through the sysvipc implementation, I noticed that the n32 semctl/shmctl/msgctl system calls behave differently based on whether o32 support is enabled or not: Without o32, the IPC_64 flag passed by user space is rejected but calls without that flag get IPC_64 behavior.
As far as I can tell, this was inadvertently changed by a cleanup patch but never noticed by anyone, possibly nobody has tried using sysvipc on n32 after linux-3.19.
Change it back to the old behavior now.
Fixes: 78aaf956ba3a ("MIPS: Compat: Fix build error if CONFIG_MIPS32_COMPAT but no compat ABI.") Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann arnd@arndb.de --- As stated above, this was only found by inspection, the patch is not tested. Please review accordingly. --- arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 787290781b8c..0d14f51d0002 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -3155,6 +3155,7 @@ config MIPS32_O32 config MIPS32_N32 bool "Kernel support for n32 binaries" depends on 64BIT + select ARCH_WANT_COMPAT_IPC_PARSE_VERSION select COMPAT select MIPS32_COMPAT select SYSVIPC_COMPAT if SYSVIPC
Hi Arnd,
On Thu, Jan 10, 2019 at 05:24:31PM +0100, Arnd Bergmann wrote:
While reading through the sysvipc implementation, I noticed that the n32 semctl/shmctl/msgctl system calls behave differently based on whether o32 support is enabled or not: Without o32, the IPC_64 flag passed by user space is rejected but calls without that flag get IPC_64 behavior.
As far as I can tell, this was inadvertently changed by a cleanup patch but never noticed by anyone, possibly nobody has tried using sysvipc on n32 after linux-3.19.
Change it back to the old behavior now.
Fixes: 78aaf956ba3a ("MIPS: Compat: Fix build error if CONFIG_MIPS32_COMPAT but no compat ABI.") Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann arnd@arndb.de
As stated above, this was only found by inspection, the patch is not tested. Please review accordingly.
Nice catch! Would you prefer to merge this yourself, or that I take it through the mips tree?
If the former then:
Acked-by: Paul Burton paul.burton@mips.com
I suspect kernels configured with n32 support but no o32 support are probably not very common - for internal testing we currently always enable both.
Thanks, Paul
arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 787290781b8c..0d14f51d0002 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -3155,6 +3155,7 @@ config MIPS32_O32 config MIPS32_N32 bool "Kernel support for n32 binaries" depends on 64BIT
- select ARCH_WANT_COMPAT_IPC_PARSE_VERSION select COMPAT select MIPS32_COMPAT select SYSVIPC_COMPAT if SYSVIPC
-- 2.20.0
On Thu, Jan 10, 2019 at 8:40 PM Paul Burton paul.burton@mips.com wrote:
On Thu, Jan 10, 2019 at 05:24:31PM +0100, Arnd Bergmann wrote:
While reading through the sysvipc implementation, I noticed that the n32 semctl/shmctl/msgctl system calls behave differently based on whether o32 support is enabled or not: Without o32, the IPC_64 flag passed by user space is rejected but calls without that flag get IPC_64 behavior.
As far as I can tell, this was inadvertently changed by a cleanup patch but never noticed by anyone, possibly nobody has tried using sysvipc on n32 after linux-3.19.
Change it back to the old behavior now.
Fixes: 78aaf956ba3a ("MIPS: Compat: Fix build error if CONFIG_MIPS32_COMPAT but no compat ABI.") Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann arnd@arndb.de
As stated above, this was only found by inspection, the patch is not tested. Please review accordingly.
Nice catch! Would you prefer to merge this yourself, or that I take it through the mips tree?
Up to you: if you want to merge it for 5.0, I'll just drop it from my tree.
If the former then:
Acked-by: Paul Burton paul.burton@mips.com
Thanks!
I suspect kernels configured with n32 support but no o32 support are probably not very common - for internal testing we currently always enable both.
Do you know of anyone actually still using n32 in production systems with 4.x kernels? I wonder if it just fell out of popularity as the 64-bit machines that used it either became large enough to want 64-bit user space, or got replaced by arm64 or mips32 hardware.
Arnd
Hello,
Arnd Bergmann wrote:
While reading through the sysvipc implementation, I noticed that the n32 semctl/shmctl/msgctl system calls behave differently based on whether o32 support is enabled or not: Without o32, the IPC_64 flag passed by user space is rejected but calls without that flag get IPC_64 behavior.
As far as I can tell, this was inadvertently changed by a cleanup patch but never noticed by anyone, possibly nobody has tried using sysvipc on n32 after linux-3.19.
Change it back to the old behavior now.
Fixes: 78aaf956ba3a ("MIPS: Compat: Fix build error if CONFIG_MIPS32_COMPAT but no compat ABI.") Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann arnd@arndb.de
Applied to mips-fixes.
Thanks, Paul
[ This message was auto-generated; if you believe anything is incorrect then please email paul.burton@mips.com to report it. ]
__kernel_timespec and timespec are currently the same type, but once they are different, the type cast has to be changed here.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/sparc/kernel/sys_sparc_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c index 274ed0b9b3e0..1c079e7bab09 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c @@ -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:
The 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.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- 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(-)
diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl index f920b65e8c49..b0e247287908 100644 --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl index 20ed7e026723..b54b7f2bc24a 100644 --- a/arch/arm/tools/syscall.tbl +++ b/arch/arm/tools/syscall.tbl @@ -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 diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 19f3f58b6146..96e2b2b07ee2 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -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 diff --git a/arch/microblaze/kernel/syscalls/syscall.tbl b/arch/microblaze/kernel/syscalls/syscall.tbl index a24d09e937dd..7cc0f9554da3 100644 --- a/arch/microblaze/kernel/syscalls/syscall.tbl +++ b/arch/microblaze/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/mips/kernel/syscalls/syscall_n32.tbl b/arch/mips/kernel/syscalls/syscall_n32.tbl index 53d5862649ae..cc134b1211aa 100644 --- a/arch/mips/kernel/syscalls/syscall_n32.tbl +++ b/arch/mips/kernel/syscalls/syscall_n32.tbl @@ -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 diff --git a/arch/mips/kernel/syscalls/syscall_n64.tbl b/arch/mips/kernel/syscalls/syscall_n64.tbl index a8286ccbb66c..af0da757a7b2 100644 --- a/arch/mips/kernel/syscalls/syscall_n64.tbl +++ b/arch/mips/kernel/syscalls/syscall_n64.tbl @@ -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 diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl index 69cf91b03b26..f8befa11b0c4 100644 --- a/arch/xtensa/kernel/syscalls/syscall.tbl +++ b/arch/xtensa/kernel/syscalls/syscall.tbl @@ -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 diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 257cccba3062..0296772e8fe5 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -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); diff --git a/ipc/msg.c b/ipc/msg.c index 0833c6405915..8dec945fa030 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -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) diff --git a/ipc/sem.c b/ipc/sem.c index 745dc6187e84..d1efff3a81bb 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -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 diff --git a/ipc/shm.c b/ipc/shm.c index 0842411cb0e9..ce1ca9f7c6e9 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -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
/* diff --git a/ipc/syscall.c b/ipc/syscall.c index 1ac06e3983c0..0197dfc04b32 100644 --- a/ipc/syscall.c +++ b/ipc/syscall.c @@ -47,7 +47,7 @@ SYSCALL_DEFINE6(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 @@ SYSCALL_DEFINE6(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 @@ SYSCALL_DEFINE6(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; @@ -146,7 +146,7 @@ COMPAT_SYSCALL_DEFINE6(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); @@ -171,7 +171,7 @@ COMPAT_SYSCALL_DEFINE6(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; @@ -190,7 +190,7 @@ COMPAT_SYSCALL_DEFINE6(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; diff --git a/ipc/util.h b/ipc/util.h index d768fdbed515..e272be622ae7 100644 --- a/ipc/util.h +++ b/ipc/util.h @@ -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 diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index ab9d0e3c6d50..a792a2093872 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c @@ -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);
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 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().
Signed-off-by: Arnd Bergmann arnd@arndb.de --- 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 | 12 ++++++++++++ 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, 80 insertions(+)
diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl index 85779d6ef935..5354ba02eed2 100644 --- a/arch/m68k/kernel/syscalls/syscall.tbl +++ b/arch/m68k/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl index 3d5a47b80d2b..fa47ea8cc6ef 100644 --- a/arch/mips/kernel/syscalls/syscall_o32.tbl +++ b/arch/mips/kernel/syscalls/syscall_o32.tbl @@ -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 diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl index db3bbb8744af..1bffab54ff35 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -425,3 +425,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 diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index 022fc099b628..428cf512a757 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl @@ -391,3 +391,15 @@ 381 common kexec_file_load sys_kexec_file_load compat_sys_kexec_file_load 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 383 common rseq sys_rseq compat_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 diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl index a70db013dbc7..6d0b84e3ef2d 100644 --- a/arch/sh/kernel/syscalls/syscall.tbl +++ b/arch/sh/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl index c8c77c05ea97..8c9580302422 100644 --- a/arch/sparc/kernel/syscalls/syscall.tbl +++ b/arch/sparc/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl index 3cf7b533b3d1..fef80b92eb7e 100644 --- a/arch/x86/entry/syscalls/syscall_32.tbl +++ b/arch/x86/entry/syscalls/syscall_32.tbl @@ -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
On Thu, Jan 10, 2019 at 05:24:34PM +0100, Arnd Bergmann wrote:
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 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().
Signed-off-by: Arnd Bergmann arnd@arndb.de
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.
diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index 022fc099b628..428cf512a757 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl @@ -391,3 +391,15 @@ 381 common kexec_file_load sys_kexec_file_load compat_sys_kexec_file_load 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 383 common rseq sys_rseq compat_sys_rseq +# room for arch specific syscalls +392 64 semtimedop sys_semtimedop - +393 common semget sys_semget sys_semget
...
+395 common shmget sys_shmget sys_shmget
...
+398 common shmdt sys_shmdt sys_shmdt +399 common msgget sys_msgget sys_msgget
These four need compat system call wrappers, unfortunately... (well, actually only shmget and shmdt require them, but let's add them for all four). See arch/s390/kernel/compat_wrapper.c
I'm afraid this compat special handling will be even more annoying in the future, since s390 will be the only architecture which requires this special handling.
_Maybe_ it would make sense to automatically generate a weak compat system call wrapper for s390 with the SYSCALL_DEFINE macros, but that probably won't work in all cases.
On Thu, Jan 10, 2019 at 9:33 PM Heiko Carstens heiko.carstens@de.ibm.com wrote:
On Thu, Jan 10, 2019 at 05:24:34PM +0100, Arnd Bergmann wrote:
diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index 022fc099b628..428cf512a757 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl @@ -391,3 +391,15 @@ 381 common kexec_file_load sys_kexec_file_load compat_sys_kexec_file_load 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 383 common rseq sys_rseq compat_sys_rseq +# room for arch specific syscalls +392 64 semtimedop sys_semtimedop - +393 common semget sys_semget sys_semget
...
+395 common shmget sys_shmget sys_shmget
...
+398 common shmdt sys_shmdt sys_shmdt +399 common msgget sys_msgget sys_msgget
These four need compat system call wrappers, unfortunately... (well, actually only shmget and shmdt require them, but let's add them for all four). See arch/s390/kernel/compat_wrapper.c
I'm afraid this compat special handling will be even more annoying in the future, since s390 will be the only architecture which requires this special handling.
_Maybe_ it would make sense to automatically generate a weak compat system call wrapper for s390 with the SYSCALL_DEFINE macros, but that probably won't work in all cases.
For some reason I was under the impression that s390 already did that. However, it seems that x86 does, so I'll try to convert the x86 version for s390, and see if I can get rid of all the wrappers that way.
It would certainly be safer to have the wrappers always present, especially if we expect future system calls to be added to the s390 table by whoever implements the syscall itself.
Arnd
Hi Arnd,
Arnd Bergmann arnd@arndb.de writes:
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 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().
Signed-off-by: Arnd Bergmann arnd@arndb.de
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 | 12 ++++++++++++
I have some changes I'd like to make to our syscall table that will clash with this.
I'll try and send them today.
diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl index db3bbb8744af..1bffab54ff35 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -425,3 +425,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
We already have a gap at 366-377 from when we tried to add the split IPC calls a few years back.
I guess I don't mind leaving that gap and using the common numbers.
But would be good to add a comment pointing out that we have room there for arch specific syscalls as well.
cheers
Hi Arnd,
Arnd Bergmann arnd@arndb.de writes:
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 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().
Signed-off-by: Arnd Bergmann arnd@arndb.de
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 | 12 ++++++++++++
I have some changes I'd like to make to our syscall table that will clash with this.
I'll try and send them today.
diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl index db3bbb8744af..1bffab54ff35 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -425,3 +425,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
We already have a gap at 366-377 from when we tried to add the split IPC calls a few years back.
I guess I don't mind leaving that gap and using the common numbers as you've done here.
But it would be good to add a comment pointing out that we have room at 366 for more arch specific syscalls as well.
cheers
Michael Ellerman mpe@ellerman.id.au writes:
Hi Arnd,
Arnd Bergmann arnd@arndb.de writes:
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 passing IPC_64 in the flags, and others that set it implicitly.
...
We already have a gap at 366-377 from when we tried to add the split IPC calls a few years back.
I guess I don't mind leaving that gap and using the common numbers as you've done here.
But it would be good to add a comment pointing out that we have room at 366 for more arch specific syscalls as well.
cheers
Guess I sent that one twice. 🤦
cheers
On Mon, Jan 14, 2019 at 4:59 AM Michael Ellerman mpe@ellerman.id.au wrote:
Arnd Bergmann arnd@arndb.de writes:
arch/m68k/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/mips/kernel/syscalls/syscall_o32.tbl | 11 +++++++++++ arch/powerpc/kernel/syscalls/syscall.tbl | 12 ++++++++++++
I have some changes I'd like to make to our syscall table that will clash with this.
I'll try and send them today.
Ok. Are those for 5.0 or 5.1? If they are intended for 5.0, it would be nice for me to have a branch based on 5.0-rc1 that I can put the other patches on top of.
diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl index db3bbb8744af..1bffab54ff35 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -425,3 +425,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
We already have a gap at 366-377 from when we tried to add the split IPC calls a few years back.
I guess I don't mind leaving that gap and using the common numbers as you've done here.
But it would be good to add a comment pointing out that we have room at 366 for more arch specific syscalls as well.
Ah, I missed that. I've added this to my patch now:
index 5c0936d862fc..2ddfba536d5f 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -460,6 +460,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
Arnd
On Tue, Jan 15, 2019 at 4:01 PM Arnd Bergmann arnd@arndb.de wrote:
On Mon, Jan 14, 2019 at 4:59 AM Michael Ellerman mpe@ellerman.id.au wrote:
Arnd Bergmann arnd@arndb.de writes:
arch/m68k/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/mips/kernel/syscalls/syscall_o32.tbl | 11 +++++++++++ arch/powerpc/kernel/syscalls/syscall.tbl | 12 ++++++++++++
I have some changes I'd like to make to our syscall table that will clash with this.
I'll try and send them today.
Ok. Are those for 5.0 or 5.1? If they are intended for 5.0, it would be nice for me to have a branch based on 5.0-rc1 that I can put the other patches on top of.
There is also another change that I considered:
At the end of my series, we have a lot of entries like
245 32 clock_settime sys_clock_settime32 245 64 clock_settime sys_clock_settime 245 spu clock_settime sys_clock_settime
which could be folded into
245 32 clock_settime sys_clock_settime32 245 spu64 clock_settime sys_clock_settime
if we just add another option to the ABI field. Any thoughts on that?
Arnd
Hi Arnd,
On Tue, Jan 15, 2019 at 4:19 PM Arnd Bergmann arnd@arndb.de wrote:
On Tue, Jan 15, 2019 at 4:01 PM Arnd Bergmann arnd@arndb.de wrote:
On Mon, Jan 14, 2019 at 4:59 AM Michael Ellerman mpe@ellerman.id.au wrote:
Arnd Bergmann arnd@arndb.de writes:
arch/m68k/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/mips/kernel/syscalls/syscall_o32.tbl | 11 +++++++++++ arch/powerpc/kernel/syscalls/syscall.tbl | 12 ++++++++++++
I have some changes I'd like to make to our syscall table that will clash with this.
I'll try and send them today.
Ok. Are those for 5.0 or 5.1? If they are intended for 5.0, it would be nice for me to have a branch based on 5.0-rc1 that I can put the other patches on top of.
There is also another change that I considered:
At the end of my series, we have a lot of entries like
245 32 clock_settime sys_clock_settime32 245 64 clock_settime sys_clock_settime 245 spu clock_settime sys_clock_settime
which could be folded into
245 32 clock_settime sys_clock_settime32 245 spu64 clock_settime sys_clock_settime
if we just add another option to the ABI field. Any thoughts on that?
So "spu64" would mean "spu + 64"? That makes it more difficult to read, and to grep. What about allowing multiple ABIs, separated by commas? So that line would become:
245 spu,64 clock_settime sys_clock_settime
Gr{oetje,eeting}s,
Geert
On Tue, Jan 15, 2019 at 5:36 PM Geert Uytterhoeven geert@linux-m68k.org wrote:
On Tue, Jan 15, 2019 at 4:19 PM Arnd Bergmann arnd@arndb.de wrote:
On Tue, Jan 15, 2019 at 4:01 PM Arnd Bergmann arnd@arndb.de wrote:
On Mon, Jan 14, 2019 at 4:59 AM Michael Ellerman mpe@ellerman.id.au wrote:
Arnd Bergmann arnd@arndb.de writes:
arch/m68k/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/mips/kernel/syscalls/syscall_o32.tbl | 11 +++++++++++ arch/powerpc/kernel/syscalls/syscall.tbl | 12 ++++++++++++
I have some changes I'd like to make to our syscall table that will clash with this.
I'll try and send them today.
Ok. Are those for 5.0 or 5.1? If they are intended for 5.0, it would be nice for me to have a branch based on 5.0-rc1 that I can put the other patches on top of.
There is also another change that I considered:
At the end of my series, we have a lot of entries like
245 32 clock_settime sys_clock_settime32 245 64 clock_settime sys_clock_settime 245 spu clock_settime sys_clock_settime
which could be folded into
245 32 clock_settime sys_clock_settime32 245 spu64 clock_settime sys_clock_settime
if we just add another option to the ABI field. Any thoughts on that?
So "spu64" would mean "spu + 64"? That makes it more difficult to read, and to grep. What about allowing multiple ABIs, separated by commas? So that line would become:
245 spu,64 clock_settime sys_clock_settime
I agree that would be a nice representation, but doing this would again require changing the script, which then in turn clashes with Firoz' patches to unify it under the scripts/ directory.
Arnd
Arnd Bergmann arnd@arndb.de writes:
On Tue, Jan 15, 2019 at 4:01 PM Arnd Bergmann arnd@arndb.de wrote:
On Mon, Jan 14, 2019 at 4:59 AM Michael Ellerman mpe@ellerman.id.au wrote:
Arnd Bergmann arnd@arndb.de writes:
arch/m68k/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/mips/kernel/syscalls/syscall_o32.tbl | 11 +++++++++++ arch/powerpc/kernel/syscalls/syscall.tbl | 12 ++++++++++++
I have some changes I'd like to make to our syscall table that will clash with this.
I'll try and send them today.
Ok. Are those for 5.0 or 5.1? If they are intended for 5.0, it would be nice for me to have a branch based on 5.0-rc1 that I can put the other patches on top of.
There is also another change that I considered:
At the end of my series, we have a lot of entries like
245 32 clock_settime sys_clock_settime32 245 64 clock_settime sys_clock_settime 245 spu clock_settime sys_clock_settime
which could be folded into
245 32 clock_settime sys_clock_settime32 245 spu64 clock_settime sys_clock_settime
if we just add another option to the ABI field. Any thoughts on that?
My series splits spu out into a separate field. So the above would be:
245 32 - clock_settime sys_clock_settime32 245 64 spu clock_settime sys_clock_settime
cheers
Arnd Bergmann arnd@arndb.de writes:
On Mon, Jan 14, 2019 at 4:59 AM Michael Ellerman mpe@ellerman.id.au wrote:
Arnd Bergmann arnd@arndb.de writes:
arch/m68k/kernel/syscalls/syscall.tbl | 11 +++++++++++ arch/mips/kernel/syscalls/syscall_o32.tbl | 11 +++++++++++ arch/powerpc/kernel/syscalls/syscall.tbl | 12 ++++++++++++
I have some changes I'd like to make to our syscall table that will clash with this.
I'll try and send them today.
Ok. Are those for 5.0 or 5.1? If they are intended for 5.0, it would be nice for me to have a branch based on 5.0-rc1 that I can put the other patches on top of.
For 5.1.
I can put them in a topic branch for you.
diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl index db3bbb8744af..1bffab54ff35 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -425,3 +425,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
We already have a gap at 366-377 from when we tried to add the split IPC calls a few years back.
I guess I don't mind leaving that gap and using the common numbers as you've done here.
But it would be good to add a comment pointing out that we have room at 366 for more arch specific syscalls as well.
Ah, I missed that. I've added this to my patch now:
index 5c0936d862fc..2ddfba536d5f 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -460,6 +460,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
Thanks.
cheers
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 arnd@arndb.de --- 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(-)
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index 564ba87bdc38..31ad350b58a0 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h @@ -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 */ diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl index b0e247287908..25b4a7e76943 100644 --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl index 2e93dbdcdb80..84e03de00177 100644 --- a/arch/ia64/kernel/syscalls/syscall.tbl +++ b/arch/ia64/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl index 5354ba02eed2..ae88b85d068e 100644 --- a/arch/m68k/kernel/syscalls/syscall.tbl +++ b/arch/m68k/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h index c2c2afb28941..9ec1026af877 100644 --- a/arch/parisc/include/asm/unistd.h +++ b/arch/parisc/include/asm/unistd.h @@ -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 ; diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl index 9bbd2f9f56c8..e07231de3597 100644 --- a/arch/parisc/kernel/syscalls/syscall.tbl +++ b/arch/parisc/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h index a1fbf15d53aa..ed08f114ee91 100644 --- a/arch/s390/include/asm/unistd.h +++ b/arch/s390/include/asm/unistd.h @@ -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 diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index 428cf512a757..f84ea364a302 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl @@ -391,6 +391,9 @@ 381 common kexec_file_load sys_kexec_file_load compat_sys_kexec_file_load 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 383 common rseq sys_rseq compat_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 diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl index 6d0b84e3ef2d..3f96ad0424e1 100644 --- a/arch/sh/kernel/syscalls/syscall.tbl +++ b/arch/sh/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h index 5194d86ef72d..08696ea5dca8 100644 --- a/arch/sparc/include/asm/unistd.h +++ b/arch/sparc/include/asm/unistd.h @@ -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 */ diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl index 8c9580302422..24ebef675184 100644 --- a/arch/sparc/kernel/syscalls/syscall.tbl +++ b/arch/sparc/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl index f8befa11b0c4..c699e014e0dd 100644 --- a/arch/xtensa/kernel/syscalls/syscall.tbl +++ b/arch/xtensa/kernel/syscalls/syscall.tbl @@ -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
On Thu, Jan 10, 2019 at 05:24:35PM +0100, Arnd Bergmann wrote:
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 arnd@arndb.de diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h index a1fbf15d53aa..ed08f114ee91 100644 --- a/arch/s390/include/asm/unistd.h +++ b/arch/s390/include/asm/unistd.h @@ -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 diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index 428cf512a757..f84ea364a302 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl @@ -391,6 +391,9 @@ 381 common kexec_file_load sys_kexec_file_load compat_sys_kexec_file_load 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 383 common rseq sys_rseq compat_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
Since you only need/want the system call numbers, could you please change these lines to:
+384 common pkey_alloc - - +385 common pkey_free - - +386 common pkey_mprotect - -
Otherwise it _looks_ like we would need compat wrappers here as well, even though all of them would just jump to sys_ni_syscall() in this case. Making this explicit seems to better.
On Thu, Jan 10, 2019 at 9:36 PM Heiko Carstens heiko.carstens@de.ibm.com wrote:
On Thu, Jan 10, 2019 at 05:24:35PM +0100, Arnd Bergmann wrote:
Since you only need/want the system call numbers, could you please change these lines to:
+384 common pkey_alloc - - +385 common pkey_free - - +386 common pkey_mprotect - -
Otherwise it _looks_ like we would need compat wrappers here as well, even though all of them would just jump to sys_ni_syscall() in this case. Making this explicit seems to better.
Ok, fair enough. I considered doing this originally and then decided against it for consistency with the asm-generic file, but I don't care much either way.
Is this something you may want to add later? I'm not sure exactly how pkey compares to s390 storage keys, or if this is something completely unrelated.
Arnd
On Fri, Jan 11, 2019 at 06:30:43PM +0100, Arnd Bergmann wrote:
On Thu, Jan 10, 2019 at 9:36 PM Heiko Carstens heiko.carstens@de.ibm.com wrote:
On Thu, Jan 10, 2019 at 05:24:35PM +0100, Arnd Bergmann wrote:
Since you only need/want the system call numbers, could you please change these lines to:
+384 common pkey_alloc - - +385 common pkey_free - - +386 common pkey_mprotect - -
Otherwise it _looks_ like we would need compat wrappers here as well, even though all of them would just jump to sys_ni_syscall() in this case. Making this explicit seems to better.
Ok, fair enough. I considered doing this originally and then decided against it for consistency with the asm-generic file, but I don't care much either way.
Is this something you may want to add later? I'm not sure exactly how pkey compares to s390 storage keys, or if this is something completely unrelated.
I don't think pkeys will ever work on s390, since they require a key per mapping, while the s390 storage keys are per physical page.
On Thu, Jan 10, 2019 at 05:24:35PM +0100, Arnd Bergmann wrote:
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.
I was lambasted for adding the pkey syscalls for 32-bit ARM in 2016, which will probably never support it. Why has the attitude towards this kind of thing now apparently become acceptable?
Signed-off-by: Arnd Bergmann arnd@arndb.de
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(-)
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index 564ba87bdc38..31ad350b58a0 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h @@ -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 */ diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl index b0e247287908..25b4a7e76943 100644 --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl index 2e93dbdcdb80..84e03de00177 100644 --- a/arch/ia64/kernel/syscalls/syscall.tbl +++ b/arch/ia64/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl index 5354ba02eed2..ae88b85d068e 100644 --- a/arch/m68k/kernel/syscalls/syscall.tbl +++ b/arch/m68k/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h index c2c2afb28941..9ec1026af877 100644 --- a/arch/parisc/include/asm/unistd.h +++ b/arch/parisc/include/asm/unistd.h @@ -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 ; diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl index 9bbd2f9f56c8..e07231de3597 100644 --- a/arch/parisc/kernel/syscalls/syscall.tbl +++ b/arch/parisc/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h index a1fbf15d53aa..ed08f114ee91 100644 --- a/arch/s390/include/asm/unistd.h +++ b/arch/s390/include/asm/unistd.h @@ -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 diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index 428cf512a757..f84ea364a302 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl @@ -391,6 +391,9 @@ 381 common kexec_file_load sys_kexec_file_load compat_sys_kexec_file_load 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 383 common rseq sys_rseq compat_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 diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl index 6d0b84e3ef2d..3f96ad0424e1 100644 --- a/arch/sh/kernel/syscalls/syscall.tbl +++ b/arch/sh/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h index 5194d86ef72d..08696ea5dca8 100644 --- a/arch/sparc/include/asm/unistd.h +++ b/arch/sparc/include/asm/unistd.h @@ -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 */ diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl index 8c9580302422..24ebef675184 100644 --- a/arch/sparc/kernel/syscalls/syscall.tbl +++ b/arch/sparc/kernel/syscalls/syscall.tbl @@ -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 diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl index f8befa11b0c4..c699e014e0dd 100644 --- a/arch/xtensa/kernel/syscalls/syscall.tbl +++ b/arch/xtensa/kernel/syscalls/syscall.tbl @@ -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
2.20.0
On Tue, Jan 15, 2019 at 12:52 PM Russell King - ARM Linux admin linux@armlinux.org.uk wrote:
On Thu, Jan 10, 2019 at 05:24:35PM +0100, Arnd Bergmann wrote:
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.
I was lambasted for adding the pkey syscalls for 32-bit ARM in 2016, which will probably never support it. Why has the attitude towards this kind of thing now apparently become acceptable?
I was (and still am) a bit unsure about this one. A number of architectures added the numbers that won't ever support them, but I wasn't sure if any of those that didn't add them might need it later.
I tried to just go by the rule that anything that we list in asm-generic/unistd.h is probably important enough that we want to list it everywhere, even if that includes a couple that we end up being rather architecture specific.
I'm happy to drop this patch if you or others feel that we're better off without it though.
Arnd
Hi Arnd,
On Thu, Jan 10, 2019 at 5:26 PM Arnd Bergmann arnd@arndb.de wrote:
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:
Thanks a lot!
- Add system calls that have not yet been integrated into all architectures but that we definitely want there.
It looks like you missed wiring up io_pgetevents() on m68k. Is that intentional?
Gr{oetje,eeting}s,
Geert
On Thu, Jan 10, 2019 at 5:59 PM Geert Uytterhoeven geert@linux-m68k.org wrote:
Hi Arnd,
On Thu, Jan 10, 2019 at 5:26 PM Arnd Bergmann arnd@arndb.de wrote:
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:
Thanks a lot!
- Add system calls that have not yet been integrated into all architectures but that we definitely want there.
It looks like you missed wiring up io_pgetevents() on m68k. Is that intentional?
Yes, I thought I had described that somewhere but maybe I forgot: semtimedop() and io_pgetevents() get replaced with time64 versions in the follow-up, so I only added them in 64-bit architectures. If you think we should have both io_pgetevents() and io_pgetevents_time32() on all 32-bit architectures, I can add that as well.
Arnd
Hi Arnd,
On Thu, Jan 10, 2019 at 6:06 PM Arnd Bergmann arnd@arndb.de wrote:
On Thu, Jan 10, 2019 at 5:59 PM Geert Uytterhoeven geert@linux-m68k.org wrote:
On Thu, Jan 10, 2019 at 5:26 PM Arnd Bergmann arnd@arndb.de wrote:
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:
Thanks a lot!
- Add system calls that have not yet been integrated into all architectures but that we definitely want there.
It looks like you missed wiring up io_pgetevents() on m68k. Is that intentional?
Yes, I thought I had described that somewhere but maybe I forgot: semtimedop() and io_pgetevents() get replaced with time64 versions in the follow-up, so I only added them in 64-bit architectures. If you think we should have both io_pgetevents() and io_pgetevents_time32() on all 32-bit architectures, I can add that as well.
Thanks, sounds fine to me.
Gr{oetje,eeting}s,
Geert
On Thu, Jan 10, 2019 at 7:11 PM Geert Uytterhoeven geert@linux-m68k.org wrote:
On Thu, Jan 10, 2019 at 6:06 PM Arnd Bergmann arnd@arndb.de wrote:
On Thu, Jan 10, 2019 at 5:59 PM Geert Uytterhoeven geert@linux-m68k.org wrote:
On Thu, Jan 10, 2019 at 5:26 PM Arnd Bergmann arnd@arndb.de wrote:
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:
Thanks a lot!
- Add system calls that have not yet been integrated into all architectures but that we definitely want there.
It looks like you missed wiring up io_pgetevents() on m68k. Is that intentional?
Yes, I thought I had described that somewhere but maybe I forgot: semtimedop() and io_pgetevents() get replaced with time64 versions in the follow-up, so I only added them in 64-bit architectures. If you think we should have both io_pgetevents() and io_pgetevents_time32() on all 32-bit architectures, I can add that as well.
Thanks, sounds fine to me.
Just to be sure, you mean it's fine to not add it, not that we should add it?
Arnd
Hi Arnd,
On Thu, Jan 10, 2019 at 11:43 PM Arnd Bergmann arnd@arndb.de wrote:
On Thu, Jan 10, 2019 at 7:11 PM Geert Uytterhoeven geert@linux-m68k.org wrote:
On Thu, Jan 10, 2019 at 6:06 PM Arnd Bergmann arnd@arndb.de wrote:
On Thu, Jan 10, 2019 at 5:59 PM Geert Uytterhoeven geert@linux-m68k.org wrote:
On Thu, Jan 10, 2019 at 5:26 PM Arnd Bergmann arnd@arndb.de wrote:
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:
Thanks a lot!
- Add system calls that have not yet been integrated into all architectures but that we definitely want there.
It looks like you missed wiring up io_pgetevents() on m68k. Is that intentional?
Yes, I thought I had described that somewhere but maybe I forgot: semtimedop() and io_pgetevents() get replaced with time64 versions in the follow-up, so I only added them in 64-bit architectures. If you think we should have both io_pgetevents() and io_pgetevents_time32() on all 32-bit architectures, I can add that as well.
Thanks, sounds fine to me.
Just to be sure, you mean it's fine to not add it, not that we should add it?
I'm fine with not having the legacy 32-bit ones.
Sorry for being unclear.
Gr{oetje,eeting}s,
Geert
On Thu, 10 Jan 2019, Arnd Bergmann wrote:
- Add system calls that have not yet been integrated into all architectures but that we definitely want there.
glibc has a note that alpha lacks statfs64, any plans for that?
On Thu, Jan 10, 2019 at 7:10 PM Joseph Myers joseph@codesourcery.com wrote:
On Thu, 10 Jan 2019, Arnd Bergmann wrote:
- Add system calls that have not yet been integrated into all architectures but that we definitely want there.
glibc has a note that alpha lacks statfs64, any plans for that?
Good catch, I missed that because all other 64-bit architectures have a statfs() call with 64-bit fields. I see that it also has an osf_statfs64 structure and system call with lots of padding and some oddly sized fields: f_type, f_flags and f_namemax are only 16 bits wide, the rest is all 64-bit.
Adding the regular statfs64() should be easy enough, we just need to decide which layout to use:
a) use the currently unused 'struct statfs64' as provided by the alpha uapi headers, which has a 32-bit __statfs_word but 64-bit f_blocks, f_bfree, f_bavail, f_files, and f_ffree.
b) copy asm-generic/statfs.h to the alpha asm/statfs.h and change statfs64 to have the regular layout that we use on all other 64-bit architectures, using all 64-bit fields.
The other open question for alpha (as mentioned in one of the patches I sent) would be whether to add get{eg,eu,g,p,pp,u}id() with the regular calling conventions.
Arnd
On Thu, Jan 10, 2019 at 11:42:32PM +0100, Arnd Bergmann wrote:
On Thu, Jan 10, 2019 at 7:10 PM Joseph Myers joseph@codesourcery.com wrote:
On Thu, 10 Jan 2019, Arnd Bergmann wrote:
- Add system calls that have not yet been integrated into all architectures but that we definitely want there.
glibc has a note that alpha lacks statfs64, any plans for that?
Good catch, I missed that because all other 64-bit architectures have a statfs() call with 64-bit fields. I see that it also has an osf_statfs64 structure and system call with lots of padding and some oddly sized fields: f_type, f_flags and f_namemax are only 16 bits wide, the rest is all 64-bit.
Adding the regular statfs64() should be easy enough, we just need to decide which layout to use:
a) use the currently unused 'struct statfs64' as provided by the alpha uapi headers, which has a 32-bit __statfs_word but 64-bit f_blocks, f_bfree, f_bavail, f_files, and f_ffree.
b) copy asm-generic/statfs.h to the alpha asm/statfs.h and change statfs64 to have the regular layout that we use on all other 64-bit architectures, using all 64-bit fields.
The other open question for alpha (as mentioned in one of the patches I sent) would be whether to add get{eg,eu,g,p,pp,u}id() with the regular calling conventions.
I would be interested in seeing those provided on Alpha. There are a handful of projects choosing to sidestep glibc for these syscalls and they break on Alpha. Such projects are never keen to include special assembler code (because the extant syscalls on Alpha are not C ABI compliant) to support a legacy arch.
Cheers Michael.