Add key management syscalls to non-i386 archs
Subsystems (9)
PATCH 1/1 Add key management syscalls to non-i386 archs
Hi Linus, Andrew,
The attached patch adds syscalls for almost all archs (everything barring m68knommu which is in a real mess, and i386 which already has it).
It also adds 32->64 compatibility where appropriate.
David
---
warthog>diffstat keys-269bk4.diff
arch/alpha/kernel/systbls.S | 3 +++ arch/arm/kernel/calls.S | 3 +++ arch/cris/arch-v10/kernel/entry.S | 3 +++ arch/h8300/kernel/syscalls.S | 3 +++ arch/ia64/ia32/ia32_entry.S | 4 ++++ arch/ia64/ia32/sys_ia32.c | 20 ++++++++++++++++++++ arch/ia64/kernel/entry.S | 6 +++--- arch/ia64/kernel/fsys.S | 6 +++--- arch/m32r/kernel/entry.S | 3 +++ arch/m68k/kernel/entry.S | 3 +++ arch/mips/kernel/scall32-o32.S | 3 +++ arch/mips/kernel/scall64-64.S | 3 +++ arch/mips/kernel/scall64-n32.S | 3 +++ arch/mips/kernel/scall64-o32.S | 3 +++ arch/parisc/kernel/syscall_table.S | 4 +++- arch/ppc/kernel/misc.S | 3 +++ arch/ppc64/kernel/misc.S | 6 ++++++ arch/ppc64/kernel/sys_ppc32.c | 33 +++++++++++++++++++++++++++++++++ arch/s390/kernel/compat_wrapper.S | 26 ++++++++++++++++++++++++++ arch/s390/kernel/syscalls.S | 3 +++ arch/sh/kernel/entry.S | 4 ++++ arch/sh64/kernel/syscalls.S | 4 +++- arch/sparc/kernel/systbls.S | 2 +- arch/sparc64/kernel/sys32.S | 3 +++ arch/sparc64/kernel/systbls.S | 4 ++-- arch/um/kernel/sys_call_table.c | 3 +++ arch/v850/kernel/entry.S | 3 +++ arch/x86_64/ia32/ia32entry.S | 4 ++++ include/asm-alpha/unistd.h | 5 ++++- include/asm-arm/unistd.h | 3 +++ include/asm-arm26/unistd.h | 3 +++ include/asm-cris/unistd.h | 5 ++++- include/asm-h8300/unistd.h | 5 ++++- include/asm-ia64/unistd.h | 3 +++ include/asm-m32r/unistd.h | 5 ++++- include/asm-m68k/unistd.h | 5 ++++- include/asm-mips/unistd.h | 17 +++++++++++++---- include/asm-parisc/unistd.h | 5 ++++- include/asm-ppc/unistd.h | 5 ++++- include/asm-ppc64/unistd.h | 5 ++++- include/asm-s390/unistd.h | 5 ++++- include/asm-sh/unistd.h | 5 ++++- include/asm-sh64/unistd.h | 5 ++++- include/asm-sparc/unistd.h | 3 +++ include/asm-sparc64/unistd.h | 3 +++ include/asm-v850/unistd.h | 3 +++ include/asm-x86_64/unistd.h | 8 +++++++- 47 files changed, 239 insertions(+), 27 deletions(-)
arch/alpha/kernel/systbls.S +3 -0
@@ -458,6 +458,9 @@ sys_call_table: .quad sys_mq_notify .quad sys_mq_getsetattr .quad sys_waitid + .quad sys_add_key + .quad sys_request_key + .quad sys_keyctl .size sys_call_table, . - sys_call_table .type sys_call_table, @object
arch/arm/kernel/calls.S +3 -0
@@ -295,6 +295,9 @@ __syscall_start: .long sys_mq_notify .long sys_mq_getsetattr /* 280 */ .long sys_waitid + .long sys_add_key + .long sys_request_key + .long sys_keyctl __syscall_end: .rept NR_syscalls - (__syscall_end - __syscall_start) / 4
arch/cris/arch-v10/kernel/entry.S +3 -0
@@ -1079,6 +1079,9 @@ sys_call_table: .long sys_mq_timedreceive /* 280 */ .long sys_mq_notify .long sys_mq_getsetattr + .long sys_add_key + .long sys_request_key /* 285 */ + .long sys_keyctl /* * NOTE!! This doesn't have to be exact - we just have
arch/h8300/kernel/syscalls.S +3 -0
@@ -289,6 +289,9 @@ SYMBOL_NAME_LABEL(sys_call_table) .long SYMBOL_NAME(sys_utimes) .long SYMBOL_NAME(sys_fadvise64_64) .long SYMBOL_NAME(sys_ni_syscall) /* sys_vserver */ + .long SYMBOL_NAME(sys_add_key) + .long SYMBOL_NAME(sys_request_key) /* 275 */ + .long SYMBOL_NAME(sys_keyctl) .rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4 .long SYMBOL_NAME(sys_ni_syscall)
arch/ia64/ia32/ia32_entry.S +4 -0
@@ -495,6 +495,10 @@ ia32_syscall_table: data8 compat_sys_mq_getsetattr data8 sys_ni_syscall /* reserved for kexec */ data8 sys32_waitid + data8 sys_ni_syscall /* reserved for setaltroot */ + data8 sys32_add_key + data8 sys32_request_key + data8 sys_keyctl // guard against failures to increase IA32_NR_syscalls .org ia32_syscall_table + 8*IA32_NR_syscalls
arch/ia64/ia32/sys_ia32.c +20 -0
@@ -2687,6 +2687,26 @@ asmlinkage long sys32_waitid(int which,return copy_siginfo_to_user32 (uinfo, &info); } + +asmlinkage long sys32_add_key (const char __user *_type, +const char __user *_description, +const void __user *_payload, +__u32 plen, +__u32 ringid) +{ +sys_add_key (_type, _description, _payload, (size_t ) plen, + (key_serial_t ) ringid); +} + +asmlinkage long sys32_request_key (const char __user *_type, +const char __user *_description, +const char __user *_callout_info, +__u32 destringid) +{ +sys_request_key (_type, _description, _callout_info, + (key_serial_t ) destringid); +} +#ifdef NOTYET /* UNTESTED FOR IA64 FROM HERE DOWN */ asmlinkage long sys32_setreuid (compat_uid_t ruid,compat_uid_t euid)
arch/ia64/kernel/entry.S +3 -3
@@ -1528,9 +1528,9 @@ sys_call_table: data8 sys_ni_syscall // reserved for kexec_load data8 sys_ni_syscall data8 sys_setaltroot // 1270 - data8 sys_ni_syscall - data8 sys_ni_syscall - data8 sys_ni_syscall + data8 sys_add_key + data8 sys_request_key + data8 sys_keyctl data8 sys_ni_syscall data8 sys_ni_syscall // 1275 data8 sys_ni_syscall
arch/ia64/kernel/fsys.S +3 -3
@@ -868,9 +868,9 @@ fsyscall_table: data8 0 // kexec_load data8 0 data8 0 // 1270 - data8 0 - data8 0 - data8 0 + data8 0 // add_key + data8 0 // request_key + data8 0 // keyctl data8 0 data8 0 // 1275 data8 0
arch/m32r/kernel/entry.S +3 -0
@@ -994,6 +994,9 @@ ENTRY(sys_call_table) .long sys_mq_getsetattr .long sys_ni_syscall /* reserved for kexec */ .long sys_waitid + .long sys_add_key /* 285 */ + .long sys_request_key + .long sys_keyctl syscall_table_size=(.-sys_call_table)
arch/m68k/kernel/entry.S +3 -0
@@ -663,3 +663,6 @@ sys_call_table: .long sys_lremovexattr .long sys_fremovexattr .long sys_futex /* 235 */ + .long sys_add_key + .long sys_request_key + .long sys_keyctl
arch/mips/kernel/scall32-o32.S +3 -0
@@ -628,6 +628,9 @@ out: jr ra sys sys_mq_notify 2 /* 4275 */ sys sys_mq_getsetattr 3 sys sys_ni_syscall 0 /* sys_vserver */ + sys sys_add_key 5 + sys sys_request_key 4 + sys sys_keyctl 5 .endm
arch/mips/kernel/scall64-64.S +3 -0
@@ -448,3 +448,6 @@ sys_call_table: PTR sys_mq_notify PTR sys_mq_getsetattr /* 5235 */ PTR sys_ni_syscall /* sys_vserver */ + PTR sys_add_key + PTR sys_request_key + PTR sys_keyctl
arch/mips/kernel/scall64-n32.S +3 -0
@@ -358,3 +358,6 @@ EXPORT(sysn32_call_table) PTR compat_sys_mq_notify PTR compat_sys_mq_getsetattr /* 6239 */ PTR sys_ni_syscall /* sys_vserver */ + PTR sys_add_key + PTR sys_request_key + PTR sys_keyctl
arch/mips/kernel/scall64-o32.S +3 -0
@@ -536,6 +536,9 @@ out: jr ra sys compat_sys_mq_notify 2 /* 4275 */ sys compat_sys_mq_getsetattr 3 sys sys_ni_syscall 0 /* sys_vserver */ + sys sys_add_key 5 + sys sys_request_key 4 + sys sys_keyctl 5 .endm
arch/parisc/kernel/syscall_table.S +3 -1
@@ -341,5 +341,7 @@ ENTRY_SAME(mq_timedreceive) ENTRY_SAME(mq_notify) ENTRY_SAME(mq_getsetattr) - /* Nothing yet */ /* 235 */ + ENTRY_SAME(add_key) /* 235 */ + ENTRY_SAME(request_key) + ENTRY_SAME(keyctl)
arch/ppc/kernel/misc.S +3 -0
@@ -1447,3 +1447,6 @@ _GLOBAL(sys_call_table) .long sys_mq_notify .long sys_mq_getsetattr .long sys_ni_syscall /* 268 reserved for sys_kexec_load */ + .long sys_add_key + .long sys_request_key /* 270 */ + .long sys_keyctl
arch/ppc64/kernel/misc.S +6 -0
@@ -963,6 +963,9 @@ _GLOBAL(sys_call_table32) .llong .compat_sys_mq_notify .llong .compat_sys_mq_getsetattr .llong .sys_ni_syscall /* 268 reserved for sys_kexec_load */ + .llong .sys32_add_key + .llong .sys32_request_key + .llong .sys32_keyctl .balign 8 _GLOBAL(sys_call_table)
@@ -1235,3 +1238,6 @@ _GLOBAL(sys_call_table) .llong .sys_mq_notify .llong .sys_mq_getsetattr .llong .sys_ni_syscall /* 268 reserved for sys_kexec_load */ + .llong .sys_add_key + .llong .sys_request_key /* 270 */ + .llong .sys_keyctl
arch/ppc64/kernel/sys_ppc32.c +33 -0
@@ -1328,3 +1328,36 @@ long ppc32_timer_create(clockid_t clock,return err; } + +asmlinkage long sys32_add_key (const char __user *_type, +const char __user *_description, +const void __user *_payload, +u32 plen, +u32 ringid) +{ +sys_add_key (_type, _description, _payload, (size_t ) plen, + (key_serial_t ) ringid); +} + +asmlinkage long sys32_request_key (const char __user *_type, +const char __user *_description, +const char __user *_callout_info, +u32 destringid) +{ +sys_request_key (_type, _description, _callout_info, + (key_serial_t ) destringid); +} + +/* Note: it is necessary to treat option as an unsigned int, +* with the corresponding cast to a signed int to insure that the +* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) +* and the register representation of a signed int (msr in 64-bit mode) is performed. +*/ +asmlinkage long sys32_keyctl (u32 option,u32 arg2,u32 arg3,u32 arg4,u32 arg5) +{ +return sys_keyctl ((int )option, + (unsigned long ) arg2, + (unsigned long ) arg3, + (unsigned long ) arg4, + (unsigned long ) arg5); +}
arch/s390/kernel/compat_wrapper.S +26 -0
@@ -1406,3 +1406,29 @@ compat_sys_mq_getsetattr_wrapper: llgtr %r3,%r3 # struct compat_mq_attr * llgtr %r4,%r4 # struct compat_mq_attr * jg compat_sys_mq_getsetattr + + .globl sys32_add_key_wrapper +sys32_add_key_wrapper: + lgfr %r2,%r2 # const char * + llgfr %r3,%r3 # const char * + llgfr %r4,%r4 # const void * + llgfr %r5,%r5 # size_t + llgfr %r6,%r6 # key_serial_t + jg sys_add_key # branch to system call + + .globl sys32_request_key_wrapper +sys32_request_key_wrapper: + lgfr %r2,%r2 # const char * + llgfr %r3,%r3 # const char * + llgfr %r4,%r4 # const char * + llgfr %r5,%r5 # key_serial_t + jg sys_request_key # branch to system call + + .globl sys32_keyctl_wrapper +sys32_keyctl_wrapper: + lgfr %r2,%r2 # int + llgfr %r3,%r3 # unsigned long + llgfr %r4,%r4 # unsigned long + llgfr %r5,%r5 # unsigned long + llgfr %r6,%r6 # unsigned long + jg sys_keyctl # branch to system call
arch/s390/kernel/syscalls.S +3 -0
@@ -285,3 +285,6 @@ SYSCALL(sys_mq_timedsend,sys_mq_timedsen SYSCALL(sys_mq_timedreceive,sys_mq_timedreceive,compat_sys_mq_timedreceive_wrapper) SYSCALL(sys_mq_notify,sys_mq_notify,compat_sys_mq_notify_wrapper) SYSCALL(sys_mq_getsetattr,sys_mq_getsetattr,compat_sys_mq_getsetattr_wrapper) +SYSCALL(sys_add_key,sys_add_key,sys32_add_key_wrapper) +SYSCALL(sys_request_key,sys_request_key,sys32_request_key_wrapper) +SYSCALL(sys_keyctl,sys_keyctl,sys32_keyctl_wrapper)
arch/sh/kernel/entry.S +4 -0
@@ -1140,5 +1140,9 @@ ENTRY(sys_call_table) .long sys_mq_timedreceive /* 280 */ .long sys_mq_notify .long sys_mq_getsetattr + .long sys_add_key + .long sys_request_key + .long sys_keyctl /* 285 */ + /* End of entry.S */
arch/sh64/kernel/syscalls.S +3 -1
@@ -337,4 +337,6 @@ sys_call_table: .long sys_mq_timedreceive .long sys_mq_notify .long sys_mq_getsetattr /* 310 */ - + .long sys_add_key + .long sys_request_key + .long sys_keyctl
arch/sparc/kernel/systbls.S +1 -1
@@ -75,7 +75,7 @@ sys_call_table: /*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy /*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink /*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid -/*280*/ .long sys_ni_syscall, sys_ni_syscall, sys_ni_syscall +/*280*/ .long sys_add_key, sys_request_key, sys_keyctl #ifdef CONFIG_SUNOS_EMUL /* Now the SunOS syscall table. */
arch/sparc64/kernel/sys32.S +3 -0
@@ -135,6 +135,9 @@ SIGN2(sys32_shutdown, sys_shutdown, %o0, SIGN3(sys32_socketpair, sys_socketpair, %o0, %o1, %o2) SIGN1(sys32_getpeername, sys_getpeername, %o0) SIGN1(sys32_getsockname, sys_getsockname, %o0) +SIGN2(sys32_add_key, sys_add_key, %o3, %o4) +SIGN1(sys32_request_key, sys_request_key, %o3) +SIGN1(sys32_keyctl, sys_keyctl, %o0) .globl sys32_mmap2 sys32_mmap2:
arch/sparc64/kernel/systbls.S +2 -2
@@ -76,7 +76,7 @@ sys_call_table32: .word sys_timer_delete, sys32_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy /*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink .word sys_mq_timedsend, sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid -/*280*/ .word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall +/*280*/ .word sys32_add_key, sys32_request_key, sys32_keyctl #endif /* CONFIG_COMPAT */
@@ -142,7 +142,7 @@ sys_call_table: .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy /*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid -/*280*/ .word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall +/*280*/ .word sys_add_key, sys_request_key, sys_keyctl #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ defined(CONFIG_SOLARIS_EMUL_MODULE)
arch/um/kernel/sys_call_table.c +3 -0
@@ -306,6 +306,9 @@ syscall_handler_t *sys_call_table[] = { [ __NR_utimes ] (syscall_handler_t *) sys_utimes, [ __NR_fadvise64_64 ] (syscall_handler_t *) sys_fadvise64_64, [ __NR_vserver ] (syscall_handler_t *) sys_ni_syscall, + [ __NR_add_key ] (syscall_handler_t *) sys_add_key, + [ __NR_request_key ] (syscall_handler_t *) sys_request_key, + [ __NR_keyctl ] (syscall_handler_t *) sys_keyctl, ARCH_SYSCALLS [ LAST_SYSCALL + 1 ... NR_syscalls ] =
arch/v850/kernel/entry.S +3 -0
@@ -1117,5 +1117,8 @@ C_DATA(sys_call_table): .long CSYM(sys_pivot_root) // 200 .long CSYM(sys_gettid) .long CSYM(sys_tkill) + .long CSYM(sys_add_key) + .long CSYM(sys_request_key) + .long CSYM(sys_keyctl) // 205 sys_call_table_end: C_END(sys_call_table)
arch/x86_64/ia32/ia32entry.S +4 -0
@@ -587,6 +587,10 @@ ia32_sys_call_table: .quad compat_sys_mq_getsetattr .quad quiet_ni_syscall /* reserved for kexec */ .quad sys32_waitid + .quad quiet_ni_syscall /* 285 reserved for setaltroot */ + .quad sys_add_key + .quad sys_request_key + .quad sys_keyctl /* don't forget to change IA32_NR_syscalls */ ia32_syscall_end: .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
include/asm-alpha/unistd.h +4 -1
@@ -374,8 +374,11 @@#define __NR_mq_notify 436#define __NR_mq_getsetattr 437#define __NR_waitid 438 +#define __NR_add_key 439 +#define __NR_request_key 440 +#define __NR_keyctl 441 -#define NR_SYSCALLS 439 +#define NR_SYSCALLS 442#if defined(__GNUC__)
include/asm-arm/unistd.h +3 -0
@@ -306,6 +306,9 @@#define __NR_mq_notify (__NR_SYSCALL_BASE+278)#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)#define __NR_waitid (__NR_SYSCALL_BASE+280) +#define __NR_add_key (__NR_SYSCALL_BASE+281) +#define __NR_request_key (__NR_SYSCALL_BASE+282) +#define __NR_keyctl (__NR_SYSCALL_BASE+283)/* * The following SWIs are ARM private.
include/asm-arm26/unistd.h +3 -0
@@ -260,6 +260,9 @@#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)#define __NR_tkill (__NR_SYSCALL_BASE+238) +#define __NR_add_key (__NR_SYSCALL_BASE+239) +#define __NR_request_key (__NR_SYSCALL_BASE+240) +#define __NR_keyctl (__NR_SYSCALL_BASE+241)/* * The following SWIs are ARM private.
include/asm-cris/unistd.h +4 -1
@@ -288,8 +288,11 @@#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_add_key 283 +#define __NR_request_key 284 +#define __NR_keyctl 285 -#define NR_syscalls 283 +#define NR_syscalls 286#ifdef __KERNEL__
include/asm-h8300/unistd.h +4 -1
@@ -269,8 +269,11 @@#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_add_key 274 +#define __NR_request_key 275 +#define __NR_keyctl 276 -#define NR_syscalls 268 +#define NR_syscalls 277/* user-visible error numbers are in the range -1 - -122: see
include/asm-ia64/unistd.h +3 -0
@@ -260,6 +260,9 @@#define __NR_kexec_load 1268#define __NR_vserver 1269#define __NR_setaltroot 1270 +#define __NR_add_key 1271 +#define __NR_request_key 1272 +#define __NR_keyctl 1273#ifdef __KERNEL__
include/asm-m32r/unistd.h +4 -1
@@ -294,8 +294,11 @@#define __NR_mq_getsetattr (__NR_mq_open+5)#define __NR_sys_kexec_load 283#define __NR_waitid 284 +#define __NR_add_key 285 +#define __NR_request_key 286 +#define __NR_keyctl 287 -#define NR_syscalls 285 +#define NR_syscalls 288/* user-visible error numbers are in the range -1 - -124: see * <asm-m32r/errno.h>
include/asm-m68k/unistd.h +4 -1
@@ -238,8 +238,11 @@#define __NR_lremovexattr 233#define __NR_fremovexattr 234#define __NR_futex 235 +#define __NR_add_key 236 +#define __NR_request_key 237 +#define __NR_keyctl 238 -#define NR_syscalls 236 +#define NR_syscalls 239/* user-visible error numbers are in the range -1 - -124: see <asm-m68k/errno.h> */
include/asm-mips/unistd.h +13 -4
@@ -298,16 +298,19 @@#define __NR_mq_notify (__NR_Linux + 275)#define __NR_mq_getsetattr (__NR_Linux + 276)#define __NR_vserver (__NR_Linux + 277) +#define __NR_add_key (__NR_Linux + 278) +#define __NR_request_key (__NR_Linux + 279) +#define __NR_keyctl (__NR_Linux + 280)/* * Offset of the last Linux o32 flavoured syscall */ -#define __NR_Linux_syscalls 277 +#define __NR_Linux_syscalls 280#endif /* _MIPS_SIM = _MIPS_SIM_ABI32 */ #define __NR_O32_Linux 4000 -#define __NR_O32_Linux_syscalls 277 +#define __NR_O32_Linux_syscalls 280 #if _MIPS_SIM = _MIPS_SIM_ABI64
@@ -552,11 +555,14 @@#define __NR_mq_notify (__NR_Linux + 234)#define __NR_mq_getsetattr (__NR_Linux + 235)#define __NR_vserver (__NR_Linux + 236) +#define __NR_add_key (__NR_Linux + 237) +#define __NR_request_key (__NR_Linux + 238) +#define __NR_keyctl (__NR_Linux + 239)/* * Offset of the last Linux flavoured syscall */ -#define __NR_Linux_syscalls 236 +#define __NR_Linux_syscalls 239#endif /* _MIPS_SIM = _MIPS_SIM_ABI64 */
@@ -810,11 +816,14 @@#define __NR_mq_notify (__NR_Linux + 238)#define __NR_mq_getsetattr (__NR_Linux + 239)#define __NR_vserver (__NR_Linux + 240) +#define __NR_add_key (__NR_Linux + 241) +#define __NR_request_key (__NR_Linux + 242) +#define __NR_keyctl (__NR_Linux + 243)/* * Offset of the last N32 flavoured syscall */ -#define __NR_Linux_syscalls 240 +#define __NR_Linux_syscalls 243#endif /* _MIPS_SIM = _MIPS_SIM_NABI32 */
include/asm-parisc/unistd.h +4 -1
@@ -727,8 +727,11 @@#define __NR_mq_timedreceive (__NR_Linux + 232)#define __NR_mq_notify (__NR_Linux + 233)#define __NR_mq_getsetattr (__NR_Linux + 234) +#define __NR_add_key (__NR_Linux + 235) +#define __NR_request_key (__NR_Linux + 236) +#define __NR_keyctl (__NR_Linux + 237) -#define __NR_Linux_syscalls 235 +#define __NR_Linux_syscalls 238#define HPUX_GATEWAY_ADDR 0xC0000004#define LINUX_GATEWAY_ADDR 0x100
include/asm-ppc/unistd.h +4 -1
@@ -273,8 +273,11 @@#define __NR_mq_notify 266#define __NR_mq_getsetattr 267#define __NR_kexec_load 268 +#define __NR_add_key 269 +#define __NR_request_key 270 +#define __NR_keyctl 271 -#define __NR_syscalls 269 +#define __NR_syscalls 272#define __NR (n) #n
include/asm-ppc64/unistd.h +4 -1
@@ -279,8 +279,11 @@#define __NR_mq_notify 266#define __NR_mq_getsetattr 267#define __NR_kexec_load 268 +#define __NR_add_key 269 +#define __NR_request_key 270 +#define __NR_keyctl 271 -#define __NR_syscalls 269 +#define __NR_syscalls 272#ifdef __KERNEL__#define NR_syscalls __NR_syscalls#endif
include/asm-s390/unistd.h +4 -1
@@ -269,8 +269,11 @@#define __NR_mq_timedreceive 274#define __NR_mq_notify 275#define __NR_mq_getsetattr 276 +#define __NR_add_key 277 +#define __NR_request_key 278 +#define __NR_keyctl 279 -#define NR_syscalls 277 +#define NR_syscalls 280/* * There are some system calls that are not present on 64 bit, some
include/asm-sh/unistd.h +4 -1
@@ -290,8 +290,11 @@#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_add_key 283 +#define __NR_request_key 284 +#define __NR_keyctl 285 -#define NR_syscalls 283 +#define NR_syscalls 286/* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */
include/asm-sh64/unistd.h +4 -1
@@ -333,8 +333,11 @@#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_add_key 311 +#define __NR_request_key 312 +#define __NR_keyctl 313 -#define NR_syscalls 311 +#define NR_syscalls 314/* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */
include/asm-sparc/unistd.h +3 -0
@@ -296,6 +296,9 @@#define __NR_mq_notify 277#define __NR_mq_getsetattr 278#define __NR_waitid 279 +#define __NR_add_key 280 +#define __NR_request_key 281 +#define __NR_keyctl 282/* WARNING: You MAY NOT add syscall numbers larger than 282, since * all of the syscall tables in the Sparc kernel are
include/asm-sparc64/unistd.h +3 -0
@@ -298,6 +298,9 @@#define __NR_mq_notify 277#define __NR_mq_getsetattr 278#define __NR_waitid 279 +#define __NR_add_key 280 +#define __NR_request_key 281 +#define __NR_keyctl 282/* WARNING: You MAY NOT add syscall numbers larger than 282, since * all of the syscall tables in the Sparc kernel are
include/asm-v850/unistd.h +3 -0
@@ -205,6 +205,9 @@#define __NR_pivot_root 200#define __NR_gettid 201#define __NR_tkill 202 +#define __NR_add_key 203 +#define __NR_request_key 204 +#define __NR_keyctl 205/* Syscall protocol:
include/asm-x86_64/unistd.h +7 -1
@@ -556,8 +556,14 @@ __SYSCALL(__NR_mq_getsetattr, sys_mq_get __SYSCALL(__NR_kexec_load, sys_ni_syscall)#define __NR_waitid 247 __SYSCALL(__NR_waitid, sys_waitid) +#define __NR_add_key 248 +__SYSCALL(__NR_add_key, sys_add_key) +#define __NR_request_key 249 +__SYSCALL(__NR_request_key, sys_request_key) +#define __NR_keyctl 250 +__SYSCALL(__NR_keyctl, sys_keyctl) -#define __NR_syscall_max __NR_waitid +#define __NR_syscall_max __NR_keyctl#ifndef __NO_STUBS/* user-visible error numbers are in the range -1 - -4095 */
Quoted 6 lines
Hi Linus, Andrew,
The attached patch adds syscalls for almost all archs (everything barring m68knommu which is in a real mess, and i386 which already has it).
It also adds 32->64 compatibility where appropriate.
Umm, that patch added the damn multiplexer that had been vetoed multiple times. Why did this happen?
Quoted 10 lines · Christoph Hellwig
Quoted 7 lines
Hi Linus, Andrew,
The attached patch adds syscalls for almost all archs (everything barring m68knommu which is in a real mess, and i386 which already has it).
It also adds 32->64 compatibility where appropriate.
Umm, that patch added the damn multiplexer that had been vetoed multiple times. Why did this happen?
Fifteen new syscalls was judged excessive and the keyfs interface was judged slow and bloaty.
Quoted 7 lines · Andrew Morton
Quoted 6 lines · Christoph Hellwig
Quoted 6 lines
Hi Linus, Andrew,
The attached patch adds syscalls for almost all archs (everything barring m68knommu which is in a real mess, and i386 which already has it).
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
It also adds 32->64 compatibility where appropriate.
Umm, that patch added the damn multiplexer that had been vetoed multiple times. Why did this happen?
Fifteen new syscalls was judged excessive and the keyfs interface was judged slow and bloaty.
Maybe 15 syscalls just means the API is goddamn awfull and we certainly shouldn't merge it as-is.
Quoted 8 lines · David Howells
The attached patch adds syscalls for almost all archs (everything barring m68knommu which is in a real mess, and i386 which already has it).
It also adds 32->64 compatibility where appropriate.
arch/parisc/kernel/syscall_table.S line 346
Quoted 7 lines
arch/parisc/kernel/syscall_table.S +3
-1@@ -341,5 +341,7 @@ ENTRY_SAME(mq_timedreceive) ENTRY_SAME(mq_notify) ENTRY_SAME(mq_getsetattr) - /* Nothing yet */ /* 235 */ + ENTRY_SAME(add_key) /* 235 */ + ENTRY_SAME(request_key) + ENTRY_SAME(keyctl)
Um, no. Should be ENTRY_COMP() if there's compat syscalls. And those particular syscall numbers have already been assigned (blame Linus for dropping the PA-RISC patch on the floor instead of including it in 2.6.9).
Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain
Quoted 2 lines
Um, no. Should be
ENTRY_COMP()if there's compat syscalls.
Not all archs (of which PA-Risc is an example) seem to require the same fixups on the same syscalls. In some instances, the upper half of the register is implicitly zero on 32-bit syscall entry to a 64-bit kernel. In such cases, none of my syscalls require fixing up, assuming the pointers are automatically correct.
Quoted 3 lines
And those particular syscall numbers have already been assigned (blame Linus for dropping the PA-RISC patch on the floor instead of including it in 2.6.9).
There's not a lot I can do about that, except wave a patch under Linus's nose and see who complains. Can you allocate three syscall numbers for me for parisc?
David
Geert Uytterhoeven
maintainerQuoted 2 lines · David Howells
The attached patch adds syscalls for almost all archs (everything barring m68knommu which is in a real mess, and i386 which already has it).
m68nommu mirrors m68k now, but that patch doesn't seem to be in Linus' tree yet.
Anyway, I'll reserve 3 syscalls for m68k, together with the other pending syscall numbers.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 8 lines · Geert Uytterhoeven
Quoted 2 lines · David Howells
The attached patch adds syscalls for almost all archs (everything barring m68knommu which is in a real mess, and i386 which already has it).
m68nommu mirrors m68k now, but that patch doesn't seem to be in Linus' tree yet.
Yes, I have a patch to do that brings it into line with m68k. I need to submit that a bunch of other patches. I am a little behind :-)
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Dude EMAIL: [email protected] SnapGear -- a CyberGuard Company PHONE: +61 7 3435 2888 825 Stanley St, FAX: +61 7 3891 3630 Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
Quoted 23 lines · David Howells
diff -uNrp
linux-2.6.9-bk4/arch/s390/kernel/compat_wrapper.Slinux-2.6.9-bk4-keys/arch/s390/kernel/compat_wrapper.Sarch/s390/kernel/compat_wrapper.S +16
-0@@ -1406,3 +1406,29 @@ compat_sys_mq_getsetattr_wrapper: llgtr %r3,%r3 # struct compat_mq_attr * llgtr %r4,%r4 # struct compat_mq_attr * jg compat_sys_mq_getsetattr + + .globl sys32_add_key_wrapper +sys32_add_key_wrapper: + lgfr %r2,%r2 # const char * + llgfr %r3,%r3 # const char * + llgfr %r4,%r4 # const void * + llgfr %r5,%r5 # size_t + llgfr %r6,%r6 # key_serial_t + jg sys_add_key # branch to system call + + .globl sys32_request_key_wrapper +sys32_request_key_wrapper: + lgfr %r2,%r2 # const char * + llgfr %r3,%r3 # const char * + llgfr %r4,%r4 # const char * + llgfr %r5,%r5 # key_serial_t
arch/s390/kernel/compat_wrapper.S compat_sys_mq_getsetattr_wrapper: · line 1434
Quoted 10 lines
arch/s390/kernel/compat_wrapper.S +10
-0+ jg sys_request_key # branch to system call + + .globl sys32_keyctl_wrapper +sys32_keyctl_wrapper: + lgfr %r2,%r2 # int + llgfr %r3,%r3 # unsigned long + llgfr %r4,%r4 # unsigned long + llgfr %r5,%r5 # unsigned long + llgfr %r6,%r6 # unsigned long + jg sys_keyctl # branch to system call
The comments don't match with the code. Please use the correct lgfr/llgfr/llgtr opcodes for signed/unsigned/pointer extension. Note that for keyctl_wrapper, the actual conversion is not static but depends on the value of %r2. You probably want to code that conversion in C.
Arnd <><
David S. Miller
maintainerDavid, I applaud your effort to take care of this. However, this patch will conflict with what I've sent into Linus already for Sparc. I also had to add the sys_altroot syscall entry as well.
I've mentioned several times that perhaps the best way to deal with this problem is to purposefully break the build of platforms when new system calls are added.
Simply adding a:
#error new syscall entries for X and Y needed
to include/asm-*/unistd.h would handle this just fine I think.
That way it won't be missed, and if the platform maintainer wants to just ignore the new syscall they can choose to do that as well.
Quoted 11 lines · David S. Miller
David, I applaud your effort to take care of this. However, this patch will conflict with what I've sent into Linus already for Sparc. I also had to add the
sys_altrootsyscall entry as well.I've mentioned several times that perhaps the best way to deal with this problem is to purposefully break the build of platforms when new system calls are added.
Quoted 6 lines
Simply adding a:
#error new syscall entries for X and Y needed
to
include/asm-*/unistd.hwould handle this just fine I think.
I don't think that's a good idea. Normally new system calls are relatively obscure and the system works fine without them, so urgent action is not needed.
And I think we can trust architecture maintainers to regularly sync the system calls with i386.
-Andi
David S. Miller
maintainerQuoted 6 lines · On Thu, 21 Oct 2004 00:56:25 +0200 Andi Kleen <[email protected]> wrote:
I don't think that's a good idea. Normally new system calls are relatively obscure and the system works fine without them, so urgent action is not needed.
And I think we can trust architecture maintainers to regularly sync the system calls with i386.
I disagree quite strongly. One major frustration for users of non-x86 platforms is that functionality is often missing for some time that we can make trivial to keep in sync.
I religiously watch what goes into Linus's tree for this purpose, but that is kind of a rediculious burdon to expect every platform maintainer to do. It's not just system calls, we have signal handling bug fixes, trap handling infrastructure, and now the nice generic IRQ handling subsystem as other examples.
Simply put, if you're not watching the tree in painstaking detail every day, you miss all of these enhancements.
The knowledge should come from the person putting the changes into the tree, therefore it gets done once and this makes it so that the other platform maintainers will find out about it automatically next time they update their tree.
Quoted 7 lines · David S. Miller
Quoted 4 lines · On Thu, 21 Oct 2004 00:56:25 +0200 Andi Kleen <[email protected]> wrote:
I don't think that's a good idea. Normally new system calls are relatively obscure and the system works fine without them, so urgent action is not needed.
Quoted 6 lines
Quoted 2 lines
And I think we can trust architecture maintainers to regularly sync the system calls with i386.
I disagree quite strongly. One major frustration for users of non-x86 platforms is that functionality is often missing for some time that we can make trivial to keep in sync.
I'm not sure really if the users of some embedded platform are all sheering for key management system calls...
I guess they will prefer just something that compiles.
Quoted 6 lines
I religiously watch what goes into Linus's tree for this purpose, but that is kind of a rediculious burdon to expect every platform maintainer to do. It's not just system calls, we have signal handling bug fixes, trap handling infrastructure, and now the nice generic IRQ handling subsystem as other examples.
Most of that is optional. When the arch maintainer choses not to use it you have just unnecessarily broken the build.
IMHO breaking the build unnecessarily is extremly bad because it will prevent all testing. And would you really want to hold up the whole linux testing machinery just for some obscure system call? IMHO not a good tradeoff.
Quoted 3 lines
Simply put, if you're not watching the tree in painstaking detail every day, you miss all of these enhancements.
I would assume the other maintainers go at least from time to time through the i386 diffs and check if they miss anything (that is what I do). For system calls they do definitely, although it may take some time.
Quoted 5 lines
The knowledge should come from the person putting the changes into the tree, therefore it gets done once and this makes it so that the other platform maintainers will find out about it automatically next time they update their tree.
And causing merging headaches and all kind of other problems.
-Andi
David S. Miller
maintainerQuoted 4 lines · On Thu, 21 Oct 2004 01:25:09 +0200 Andi Kleen <[email protected]> wrote:
IMHO breaking the build unnecessarily is extremly bad because it will prevent all testing. And would you really want to hold up the whole linux testing machinery just for some obscure system call? IMHO not a good tradeoff.
Then change the unistd.h cookie from "#error" to a "#warning". It accomplishes both of our goals.
Quoted 10 lines · David S. Miller
Quoted 4 lines · On Thu, 21 Oct 2004 01:25:09 +0200 Andi Kleen <[email protected]> wrote:
IMHO breaking the build unnecessarily is extremly bad because it will prevent all testing. And would you really want to hold up the whole linux testing machinery just for some obscure system call? IMHO not a good tradeoff.
Then change the
unistd.hcookie from "#error" to a "#warning". It accomplishes both of our goals.
#warnings would be fine for me.
-Andi
Geert Uytterhoeven
maintainerQuoted 10 lines · David S. Miller
Quoted 4 lines · On Thu, 21 Oct 2004 01:25:09 +0200 Andi Kleen <[email protected]> wrote:
IMHO breaking the build unnecessarily is extremly bad because it will prevent all testing. And would you really want to hold up the whole linux testing machinery just for some obscure system call? IMHO not a good tradeoff.
Then change the
unistd.hcookie from "#error" to a "#warning". It accomplishes both of our goals.
Please do so! And not only for syscalls, but also for other things.
That way we can procmail all mails sent to lkml or bk-commits-head that add #warnings to arch/<arch>/ or include/asm-<arch>/.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 7 lines · David S. Miller
Quoted 4 lines · On Thu, 21 Oct 2004 00:56:25 +0200 Andi Kleen <[email protected]> wrote:
I don't think that's a good idea. Normally new system calls are relatively obscure and the system works fine without them, so urgent action is not needed.
Quoted 6 lines
Quoted 2 lines
And I think we can trust architecture maintainers to regularly sync the system calls with i386.
I disagree quite strongly. One major frustration for users of non-x86 platforms is that functionality is often missing for some time that we can make trivial to keep in sync.
I agree with David here. It's also easy for arch/platform maintainers to "miss" a new syscall too ... for various reasons, we can't all read _everything_ that gets posted to lkml and we all do occasionally miss some csets going upstream, which means we can very well totally "forget" about addint the new syscall to the arch ... until somebody complains, which can be 1 or 2 releases later !
Quoted 5 lines
I religiously watch what goes into Linus's tree for this purpose, but that is kind of a rediculious burdon to expect every platform maintainer to do. It's not just system calls, we have signal handling bug fixes, trap handling infrastructure, and now the nice generic IRQ handling subsystem as other examples.
Right.
Quoted 7 lines
Simply put, if you're not watching the tree in painstaking detail every day, you miss all of these enhancements.
The knowledge should come from the person putting the changes into the tree, therefore it gets done once and this makes it so that the other platform maintainers will find out about it automatically next time they update their tree.
Agreed,
Ben.
On Wed, 2004-10-20 16:04:50 -0700, David S. Miller <[email protected]> wrote in message <[email protected]>:
Quoted 2 lines
On Thu, 21 Oct 2004 00:56:25 +0200
Andi Kleen <[email protected]> wrote:
*VAX hacker's hat on*
Quoted 3 lines
I disagree quite strongly. One major frustration for users of non-x86 platforms is that functionality is often missing for some time that we can make trivial to keep in sync.
Full ACK.
Quoted 2 lines
Simply put, if you're not watching the tree in painstaking detail every day, you miss all of these enhancements.
Right; and these missing enhancements will cause extra-pain when they're used some time later from core code. That is, you missed the feature while it was discusses/accepted and need to put it in place later on. So you've got to do extra searching etc.
Quoted 4 lines
The knowledge should come from the person putting the changes into the tree, therefore it gets done once and this makes it so that the other platform maintainers will find out about it automatically next time they update their tree.
Here's my proposal:
$ mkdir ./Documentation/new_enhancements_to_implement $ cat ./Documentation/new_enhancements_to_implement/new_key_syscalls << EOF
Quoted 16 lines
Dear Architecture Maintailers,
please add these four new cryptographic key functions to your syscall table. It's quite easy; just extend the
./include/arch-xxx/unistd.hfor four new defines and then add them to your./arch/xxx/kernel/entry.Sfile. For reference, here's my i386 patch doing this:diff -Nurp
to/file/one +1
-1text -del +add more text
Quoted 2 lines
Thanks, your keychain hacker:-)
EOF
$
This way, all arch maintainers just *see* what needs to be done and get a small introduction on how to do that. I'd *really* like to see that! That would particularly help those that cannot do full-time hacking on their port (like us VAX hackers:-)
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));