diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-25 23:12:10 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-03 15:09:18 -0500 |
commit | eaca6eae3e0c41d41fcb9d1d70e00934988dff2e (patch) | |
tree | ad1fc38c1a76d2eadccb0cd591151b09a270fc57 | |
parent | 377840744bea59aacd524f496dc577463f94584b (diff) |
sanitize rt_sigaction() situation a bit
Switch from __ARCH_WANT_SYS_RT_SIGACTION to opposite
(!CONFIG_ODD_RT_SIGACTION); the only two architectures that
need it are alpha and sparc. The reason for use of CONFIG_...
instead of __ARCH_... is that it's needed only kernel-side
and doing it that way avoids a mess with include order on many
architectures.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | arch/Kconfig | 5 | ||||
-rw-r--r-- | arch/alpha/Kconfig | 1 | ||||
-rw-r--r-- | arch/ia64/include/asm/unistd.h | 4 | ||||
-rw-r--r-- | arch/powerpc/include/asm/syscalls.h | 3 | ||||
-rw-r--r-- | arch/sparc/Kconfig | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/sys_sparc_32.c | 11 | ||||
-rw-r--r-- | arch/x86/um/shared/sysdep/syscalls_32.h | 5 | ||||
-rw-r--r-- | arch/xtensa/include/asm/syscall.h | 5 | ||||
-rw-r--r-- | include/asm-generic/syscalls.h | 5 | ||||
-rw-r--r-- | include/linux/syscalls.h | 6 | ||||
-rw-r--r-- | kernel/signal.c | 4 |
11 files changed, 20 insertions, 30 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index 7f8f281f2585..6e4c32a5a358 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -373,4 +373,9 @@ config CLONE_BACKWARDS2 | |||
373 | help | 373 | help |
374 | Architecture has the first two arguments of clone(2) swapped. | 374 | Architecture has the first two arguments of clone(2) swapped. |
375 | 375 | ||
376 | config ODD_RT_SIGACTION | ||
377 | bool | ||
378 | help | ||
379 | Architecture has unusual rt_sigaction(2) arguments | ||
380 | |||
376 | source "kernel/gcov/Kconfig" | 381 | source "kernel/gcov/Kconfig" |
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 9d5904cc7712..8696c03a9d73 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -23,6 +23,7 @@ config ALPHA | |||
23 | select HAVE_MOD_ARCH_SPECIFIC | 23 | select HAVE_MOD_ARCH_SPECIFIC |
24 | select MODULES_USE_ELF_RELA | 24 | select MODULES_USE_ELF_RELA |
25 | select GENERIC_SIGALTSTACK | 25 | select GENERIC_SIGALTSTACK |
26 | select ODD_RT_SIGACTION | ||
26 | help | 27 | help |
27 | The Alpha is a 64-bit general-purpose processor designed and | 28 | The Alpha is a 64-bit general-purpose processor designed and |
28 | marketed by the Digital Equipment Corporation of blessed memory, | 29 | marketed by the Digital Equipment Corporation of blessed memory, |
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index c3cc42a15af1..bfbb109458be 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h | |||
@@ -49,10 +49,6 @@ asmlinkage unsigned long sys_mmap2( | |||
49 | struct pt_regs; | 49 | struct pt_regs; |
50 | struct sigaction; | 50 | struct sigaction; |
51 | asmlinkage long sys_ia64_pipe(void); | 51 | asmlinkage long sys_ia64_pipe(void); |
52 | asmlinkage long sys_rt_sigaction(int sig, | ||
53 | const struct sigaction __user *act, | ||
54 | struct sigaction __user *oact, | ||
55 | size_t sigsetsize); | ||
56 | 52 | ||
57 | /* | 53 | /* |
58 | * "Conditional" syscalls | 54 | * "Conditional" syscalls |
diff --git a/arch/powerpc/include/asm/syscalls.h b/arch/powerpc/include/asm/syscalls.h index b5308d3e6d39..5c51659e61d5 100644 --- a/arch/powerpc/include/asm/syscalls.h +++ b/arch/powerpc/include/asm/syscalls.h | |||
@@ -19,9 +19,6 @@ asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len, | |||
19 | unsigned long fd, unsigned long pgoff); | 19 | unsigned long fd, unsigned long pgoff); |
20 | asmlinkage long sys_pipe(int __user *fildes); | 20 | asmlinkage long sys_pipe(int __user *fildes); |
21 | asmlinkage long sys_pipe2(int __user *fildes, int flags); | 21 | asmlinkage long sys_pipe2(int __user *fildes, int flags); |
22 | asmlinkage long sys_rt_sigaction(int sig, | ||
23 | const struct sigaction __user *act, | ||
24 | struct sigaction __user *oact, size_t sigsetsize); | ||
25 | asmlinkage long ppc64_personality(unsigned long personality); | 22 | asmlinkage long ppc64_personality(unsigned long personality); |
26 | asmlinkage int ppc_rtas(struct rtas_args __user *uargs); | 23 | asmlinkage int ppc_rtas(struct rtas_args __user *uargs); |
27 | asmlinkage time_t sys64_time(time_t __user * tloc); | 24 | asmlinkage time_t sys64_time(time_t __user * tloc); |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 9f2edb5c5551..89dde2f0653a 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -41,6 +41,7 @@ config SPARC | |||
41 | select GENERIC_STRNCPY_FROM_USER | 41 | select GENERIC_STRNCPY_FROM_USER |
42 | select GENERIC_STRNLEN_USER | 42 | select GENERIC_STRNLEN_USER |
43 | select MODULES_USE_ELF_RELA | 43 | select MODULES_USE_ELF_RELA |
44 | select ODD_RT_SIGACTION | ||
44 | 45 | ||
45 | config SPARC32 | 46 | config SPARC32 |
46 | def_bool !64BIT | 47 | def_bool !64BIT |
diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c index 2da0bdcae52f..cdd2d7035930 100644 --- a/arch/sparc/kernel/sys_sparc_32.c +++ b/arch/sparc/kernel/sys_sparc_32.c | |||
@@ -197,12 +197,11 @@ sparc_sigaction (int sig, const struct old_sigaction __user *act, | |||
197 | return ret; | 197 | return ret; |
198 | } | 198 | } |
199 | 199 | ||
200 | asmlinkage long | 200 | SYSCALL_DEFINE5(rt_sigaction, int, sig, |
201 | sys_rt_sigaction(int sig, | 201 | const struct sigaction __user *, act, |
202 | const struct sigaction __user *act, | 202 | struct sigaction __user *, oact, |
203 | struct sigaction __user *oact, | 203 | void __user *, restorer, |
204 | void __user *restorer, | 204 | size_t, sigsetsize) |
205 | size_t sigsetsize) | ||
206 | { | 205 | { |
207 | struct k_sigaction new_ka, old_ka; | 206 | struct k_sigaction new_ka, old_ka; |
208 | int ret; | 207 | int ret; |
diff --git a/arch/x86/um/shared/sysdep/syscalls_32.h b/arch/x86/um/shared/sysdep/syscalls_32.h index 8436079be914..68fd2cf526fd 100644 --- a/arch/x86/um/shared/sysdep/syscalls_32.h +++ b/arch/x86/um/shared/sysdep/syscalls_32.h | |||
@@ -8,11 +8,6 @@ | |||
8 | 8 | ||
9 | typedef long syscall_handler_t(struct pt_regs); | 9 | typedef long syscall_handler_t(struct pt_regs); |
10 | 10 | ||
11 | /* Not declared on x86, incompatible declarations on x86_64, so these have | ||
12 | * to go here rather than in sys_call_table.c | ||
13 | */ | ||
14 | extern syscall_handler_t sys_rt_sigaction; | ||
15 | |||
16 | extern syscall_handler_t *sys_call_table[]; | 11 | extern syscall_handler_t *sys_call_table[]; |
17 | 12 | ||
18 | #define EXECUTE_SYSCALL(syscall, regs) \ | 13 | #define EXECUTE_SYSCALL(syscall, regs) \ |
diff --git a/arch/xtensa/include/asm/syscall.h b/arch/xtensa/include/asm/syscall.h index 8d5e47fad095..6cf7c6c07a84 100644 --- a/arch/xtensa/include/asm/syscall.h +++ b/arch/xtensa/include/asm/syscall.h | |||
@@ -9,15 +9,10 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | struct pt_regs; | 11 | struct pt_regs; |
12 | struct sigaction; | ||
13 | asmlinkage long xtensa_ptrace(long, long, long, long); | 12 | asmlinkage long xtensa_ptrace(long, long, long, long); |
14 | asmlinkage long xtensa_sigreturn(struct pt_regs*); | 13 | asmlinkage long xtensa_sigreturn(struct pt_regs*); |
15 | asmlinkage long xtensa_rt_sigreturn(struct pt_regs*); | 14 | asmlinkage long xtensa_rt_sigreturn(struct pt_regs*); |
16 | asmlinkage long xtensa_sigaltstack(struct pt_regs *regs); | 15 | asmlinkage long xtensa_sigaltstack(struct pt_regs *regs); |
17 | asmlinkage long sys_rt_sigaction(int, | ||
18 | const struct sigaction __user *, | ||
19 | struct sigaction __user *, | ||
20 | size_t); | ||
21 | asmlinkage long xtensa_shmat(int, char __user *, int); | 16 | asmlinkage long xtensa_shmat(int, char __user *, int); |
22 | asmlinkage long xtensa_fadvise64_64(int, int, | 17 | asmlinkage long xtensa_fadvise64_64(int, int, |
23 | unsigned long long, unsigned long long); | 18 | unsigned long long, unsigned long long); |
diff --git a/include/asm-generic/syscalls.h b/include/asm-generic/syscalls.h index 1db51b8524e9..6a8d620a84d4 100644 --- a/include/asm-generic/syscalls.h +++ b/include/asm-generic/syscalls.h | |||
@@ -36,9 +36,4 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs); | |||
36 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize); | 36 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize); |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #ifndef sys_rt_sigaction | ||
40 | asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, | ||
41 | struct sigaction __user *oact, size_t sigsetsize); | ||
42 | #endif | ||
43 | |||
44 | #endif /* __ASM_GENERIC_SYSCALLS_H */ | 39 | #endif /* __ASM_GENERIC_SYSCALLS_H */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 45e2db270255..75defcd1c276 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -377,6 +377,12 @@ asmlinkage long sys_init_module(void __user *umod, unsigned long len, | |||
377 | asmlinkage long sys_delete_module(const char __user *name_user, | 377 | asmlinkage long sys_delete_module(const char __user *name_user, |
378 | unsigned int flags); | 378 | unsigned int flags); |
379 | 379 | ||
380 | #ifndef CONFIG_ODD_RT_SIGACTION | ||
381 | asmlinkage long sys_rt_sigaction(int, | ||
382 | const struct sigaction __user *, | ||
383 | struct sigaction __user *, | ||
384 | size_t); | ||
385 | #endif | ||
380 | asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set, | 386 | asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set, |
381 | sigset_t __user *oset, size_t sigsetsize); | 387 | sigset_t __user *oset, size_t sigsetsize); |
382 | asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize); | 388 | asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize); |
diff --git a/kernel/signal.c b/kernel/signal.c index 53cd5c4d1172..00cd1ce998be 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -3231,7 +3231,7 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset, | |||
3231 | } | 3231 | } |
3232 | #endif /* __ARCH_WANT_SYS_SIGPROCMASK */ | 3232 | #endif /* __ARCH_WANT_SYS_SIGPROCMASK */ |
3233 | 3233 | ||
3234 | #ifdef __ARCH_WANT_SYS_RT_SIGACTION | 3234 | #ifndef CONFIG_ODD_RT_SIGACTION |
3235 | /** | 3235 | /** |
3236 | * sys_rt_sigaction - alter an action taken by a process | 3236 | * sys_rt_sigaction - alter an action taken by a process |
3237 | * @sig: signal to be sent | 3237 | * @sig: signal to be sent |
@@ -3265,7 +3265,7 @@ SYSCALL_DEFINE4(rt_sigaction, int, sig, | |||
3265 | out: | 3265 | out: |
3266 | return ret; | 3266 | return ret; |
3267 | } | 3267 | } |
3268 | #endif /* __ARCH_WANT_SYS_RT_SIGACTION */ | 3268 | #endif /* !CONFIG_ODD_RT_SIGACTION */ |
3269 | 3269 | ||
3270 | #ifdef __ARCH_WANT_SYS_SGETMASK | 3270 | #ifdef __ARCH_WANT_SYS_SGETMASK |
3271 | 3271 | ||