diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-14 14:09:47 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-19 18:07:40 -0500 |
commit | 6bf9adfc90370b695cb111116e15fdc0e1906270 (patch) | |
tree | b8e4d369cadad21f33b7a5f7f69d43665f821ddc /arch | |
parent | 9b064fc3f95a8e44e929fdf4d6037334ea03d15b (diff) |
introduce generic sys_sigaltstack(), switch x86 and um to it
Conditional on CONFIG_GENERIC_SIGALTSTACK; architectures that do not
select it are completely unaffected
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/Kconfig | 3 | ||||
-rw-r--r-- | arch/um/kernel/signal.c | 5 | ||||
-rw-r--r-- | arch/x86/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/syscalls.h | 3 | ||||
-rw-r--r-- | arch/x86/kernel/entry_32.S | 1 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S | 1 | ||||
-rw-r--r-- | arch/x86/kernel/signal.c | 7 | ||||
-rw-r--r-- | arch/x86/syscalls/syscall_32.tbl | 2 | ||||
-rw-r--r-- | arch/x86/syscalls/syscall_64.tbl | 2 | ||||
-rw-r--r-- | arch/x86/um/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86/um/sys_call_table_32.c | 1 | ||||
-rw-r--r-- | arch/x86/um/sys_call_table_64.c | 1 |
12 files changed, 7 insertions, 21 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index 0a8dd0585d0d..330176824594 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -335,6 +335,9 @@ config MODULES_USE_ELF_REL | |||
335 | Modules only use ELF REL relocations. Modules with ELF RELA | 335 | Modules only use ELF REL relocations. Modules with ELF RELA |
336 | relocations will give an error. | 336 | relocations will give an error. |
337 | 337 | ||
338 | config GENERIC_SIGALTSTACK | ||
339 | bool | ||
340 | |||
338 | # | 341 | # |
339 | # ABI hall of shame | 342 | # ABI hall of shame |
340 | # | 343 | # |
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c index db18eb6124e1..48ccf718e290 100644 --- a/arch/um/kernel/signal.c +++ b/arch/um/kernel/signal.c | |||
@@ -132,8 +132,3 @@ long sys_sigsuspend(int history0, int history1, old_sigset_t mask) | |||
132 | siginitset(&blocked, mask); | 132 | siginitset(&blocked, mask); |
133 | return sigsuspend(&blocked); | 133 | return sigsuspend(&blocked); |
134 | } | 134 | } |
135 | |||
136 | long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) | ||
137 | { | ||
138 | return do_sigaltstack(uss, uoss, PT_REGS_SP(¤t->thread.regs)); | ||
139 | } | ||
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 01ca0ebaff0e..f380614d7d89 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -111,6 +111,7 @@ config X86 | |||
111 | select MODULES_USE_ELF_REL if X86_32 | 111 | select MODULES_USE_ELF_REL if X86_32 |
112 | select MODULES_USE_ELF_RELA if X86_64 | 112 | select MODULES_USE_ELF_RELA if X86_64 |
113 | select CLONE_BACKWARDS if X86_32 | 113 | select CLONE_BACKWARDS if X86_32 |
114 | select GENERIC_SIGALTSTACK | ||
114 | 115 | ||
115 | config INSTRUCTION_DECODER | 116 | config INSTRUCTION_DECODER |
116 | def_bool y | 117 | def_bool y |
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h index 2f8374718aa3..58b7e3eac0ae 100644 --- a/arch/x86/include/asm/syscalls.h +++ b/arch/x86/include/asm/syscalls.h | |||
@@ -25,9 +25,6 @@ asmlinkage int sys_modify_ldt(int, void __user *, unsigned long); | |||
25 | 25 | ||
26 | /* kernel/signal.c */ | 26 | /* kernel/signal.c */ |
27 | long sys_rt_sigreturn(struct pt_regs *); | 27 | long sys_rt_sigreturn(struct pt_regs *); |
28 | long sys_sigaltstack(const stack_t __user *, stack_t __user *, | ||
29 | struct pt_regs *); | ||
30 | |||
31 | 28 | ||
32 | /* kernel/tls.c */ | 29 | /* kernel/tls.c */ |
33 | asmlinkage int sys_set_thread_area(struct user_desc __user *); | 30 | asmlinkage int sys_set_thread_area(struct user_desc __user *); |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index c763116c5359..ff84d5469d77 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -739,7 +739,6 @@ ENTRY(ptregs_##name) ; \ | |||
739 | ENDPROC(ptregs_##name) | 739 | ENDPROC(ptregs_##name) |
740 | 740 | ||
741 | PTREGSCALL1(iopl) | 741 | PTREGSCALL1(iopl) |
742 | PTREGSCALL2(sigaltstack) | ||
743 | PTREGSCALL0(sigreturn) | 742 | PTREGSCALL0(sigreturn) |
744 | PTREGSCALL0(rt_sigreturn) | 743 | PTREGSCALL0(rt_sigreturn) |
745 | PTREGSCALL2(vm86) | 744 | PTREGSCALL2(vm86) |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 2363e820ed68..6e462019f195 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -864,7 +864,6 @@ END(stub_\func) | |||
864 | FORK_LIKE clone | 864 | FORK_LIKE clone |
865 | FORK_LIKE fork | 865 | FORK_LIKE fork |
866 | FORK_LIKE vfork | 866 | FORK_LIKE vfork |
867 | PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx | ||
868 | PTREGSCALL stub_iopl, sys_iopl, %rsi | 867 | PTREGSCALL stub_iopl, sys_iopl, %rsi |
869 | 868 | ||
870 | ENTRY(ptregscall_common) | 869 | ENTRY(ptregscall_common) |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 70b27ee6118e..16d065c23baf 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -602,13 +602,6 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, | |||
602 | } | 602 | } |
603 | #endif /* CONFIG_X86_32 */ | 603 | #endif /* CONFIG_X86_32 */ |
604 | 604 | ||
605 | long | ||
606 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
607 | struct pt_regs *regs) | ||
608 | { | ||
609 | return do_sigaltstack(uss, uoss, regs->sp); | ||
610 | } | ||
611 | |||
612 | /* | 605 | /* |
613 | * Do a signal return; undo the signal stack. | 606 | * Do a signal return; undo the signal stack. |
614 | */ | 607 | */ |
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl index ee3c220ee500..62c7b222e45c 100644 --- a/arch/x86/syscalls/syscall_32.tbl +++ b/arch/x86/syscalls/syscall_32.tbl | |||
@@ -192,7 +192,7 @@ | |||
192 | 183 i386 getcwd sys_getcwd | 192 | 183 i386 getcwd sys_getcwd |
193 | 184 i386 capget sys_capget | 193 | 184 i386 capget sys_capget |
194 | 185 i386 capset sys_capset | 194 | 185 i386 capset sys_capset |
195 | 186 i386 sigaltstack ptregs_sigaltstack stub32_sigaltstack | 195 | 186 i386 sigaltstack sys_sigaltstack stub32_sigaltstack |
196 | 187 i386 sendfile sys_sendfile sys32_sendfile | 196 | 187 i386 sendfile sys_sendfile sys32_sendfile |
197 | 188 i386 getpmsg | 197 | 188 i386 getpmsg |
198 | 189 i386 putpmsg | 198 | 189 i386 putpmsg |
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl index a582bfed95bb..6ffa7f9d005e 100644 --- a/arch/x86/syscalls/syscall_64.tbl +++ b/arch/x86/syscalls/syscall_64.tbl | |||
@@ -137,7 +137,7 @@ | |||
137 | 128 64 rt_sigtimedwait sys_rt_sigtimedwait | 137 | 128 64 rt_sigtimedwait sys_rt_sigtimedwait |
138 | 129 64 rt_sigqueueinfo sys_rt_sigqueueinfo | 138 | 129 64 rt_sigqueueinfo sys_rt_sigqueueinfo |
139 | 130 common rt_sigsuspend sys_rt_sigsuspend | 139 | 130 common rt_sigsuspend sys_rt_sigsuspend |
140 | 131 64 sigaltstack stub_sigaltstack | 140 | 131 64 sigaltstack sys_sigaltstack |
141 | 132 common utime sys_utime | 141 | 132 common utime sys_utime |
142 | 133 common mknod sys_mknod | 142 | 133 common mknod sys_mknod |
143 | 134 64 uselib | 143 | 134 64 uselib |
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index 0fd20f241e40..96b89d874ead 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig | |||
@@ -13,6 +13,7 @@ endmenu | |||
13 | config UML_X86 | 13 | config UML_X86 |
14 | def_bool y | 14 | def_bool y |
15 | select GENERIC_FIND_FIRST_BIT | 15 | select GENERIC_FIND_FIRST_BIT |
16 | select GENERIC_SIGALTSTACK | ||
16 | 17 | ||
17 | config 64BIT | 18 | config 64BIT |
18 | bool "64-bit kernel" if SUBARCH = "x86" | 19 | bool "64-bit kernel" if SUBARCH = "x86" |
diff --git a/arch/x86/um/sys_call_table_32.c b/arch/x86/um/sys_call_table_32.c index 812e98c098e4..a0c3b0d1a122 100644 --- a/arch/x86/um/sys_call_table_32.c +++ b/arch/x86/um/sys_call_table_32.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #define ptregs_iopl sys_iopl | 27 | #define ptregs_iopl sys_iopl |
28 | #define ptregs_vm86old sys_vm86old | 28 | #define ptregs_vm86old sys_vm86old |
29 | #define ptregs_vm86 sys_vm86 | 29 | #define ptregs_vm86 sys_vm86 |
30 | #define ptregs_sigaltstack sys_sigaltstack | ||
31 | 30 | ||
32 | #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; | 31 | #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; |
33 | #include <asm/syscalls_32.h> | 32 | #include <asm/syscalls_32.h> |
diff --git a/arch/x86/um/sys_call_table_64.c b/arch/x86/um/sys_call_table_64.c index 170bd926a69c..f2f0723070ca 100644 --- a/arch/x86/um/sys_call_table_64.c +++ b/arch/x86/um/sys_call_table_64.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #define stub_fork sys_fork | 31 | #define stub_fork sys_fork |
32 | #define stub_vfork sys_vfork | 32 | #define stub_vfork sys_vfork |
33 | #define stub_execve sys_execve | 33 | #define stub_execve sys_execve |
34 | #define stub_sigaltstack sys_sigaltstack | ||
35 | #define stub_rt_sigreturn sys_rt_sigreturn | 34 | #define stub_rt_sigreturn sys_rt_sigreturn |
36 | 35 | ||
37 | #define __SYSCALL_COMMON(nr, sym, compat) __SYSCALL_64(nr, sym, compat) | 36 | #define __SYSCALL_COMMON(nr, sym, compat) __SYSCALL_64(nr, sym, compat) |