summaryrefslogtreecommitdiffstats
path: root/arch/frv
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 21:50:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 21:50:11 -0500
commit9e2d59ad580d590134285f361a0e80f0e98c0207 (patch)
treef3232be75781484193413f32ec82c21f6d8eb76e /arch/frv
parent5ce1a70e2f00f0bce0cab57f798ca354b9496169 (diff)
parent235b80226b986dabcbba844968f7807866bd0bfe (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull signal handling cleanups from Al Viro: "This is the first pile; another one will come a bit later and will contain SYSCALL_DEFINE-related patches. - a bunch of signal-related syscalls (both native and compat) unified. - a bunch of compat syscalls switched to COMPAT_SYSCALL_DEFINE (fixing several potential problems with missing argument validation, while we are at it) - a lot of now-pointless wrappers killed - a couple of architectures (cris and hexagon) forgot to save altstack settings into sigframe, even though they used the (uninitialized) values in sigreturn; fixed. - microblaze fixes for delivery of multiple signals arriving at once - saner set of helpers for signal delivery introduced, several architectures switched to using those." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (143 commits) x86: convert to ksignal sparc: convert to ksignal arm: switch to struct ksignal * passing alpha: pass k_sigaction and siginfo_t using ksignal pointer burying unused conditionals make do_sigaltstack() static arm64: switch to generic old sigaction() (compat-only) arm64: switch to generic compat rt_sigaction() arm64: switch compat to generic old sigsuspend arm64: switch to generic compat rt_sigqueueinfo() arm64: switch to generic compat rt_sigpending() arm64: switch to generic compat rt_sigprocmask() arm64: switch to generic sigaltstack sparc: switch to generic old sigsuspend sparc: COMPAT_SYSCALL_DEFINE does all sign-extension as well as SYSCALL_DEFINE sparc: kill sign-extending wrappers for native syscalls kill sparc32_open() sparc: switch to use of generic old sigaction sparc: switch sys_compat_rt_sigaction() to COMPAT_SYSCALL_DEFINE mips: switch to generic sys_fork() and sys_clone() ...
Diffstat (limited to 'arch/frv')
-rw-r--r--arch/frv/Kconfig2
-rw-r--r--arch/frv/include/asm/signal.h7
-rw-r--r--arch/frv/include/asm/unistd.h2
-rw-r--r--arch/frv/kernel/signal.c55
4 files changed, 4 insertions, 62 deletions
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 17df48fc8f44..2d0509d4cfee 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -11,6 +11,8 @@ config FRV
11 select ARCH_HAVE_NMI_SAFE_CMPXCHG 11 select ARCH_HAVE_NMI_SAFE_CMPXCHG
12 select GENERIC_CPU_DEVICES 12 select GENERIC_CPU_DEVICES
13 select ARCH_WANT_IPC_PARSE_VERSION 13 select ARCH_WANT_IPC_PARSE_VERSION
14 select OLD_SIGSUSPEND3
15 select OLD_SIGACTION
14 16
15config ZONE_DMA 17config ZONE_DMA
16 bool 18 bool
diff --git a/arch/frv/include/asm/signal.h b/arch/frv/include/asm/signal.h
index 599500a31025..eca0abcb79d6 100644
--- a/arch/frv/include/asm/signal.h
+++ b/arch/frv/include/asm/signal.h
@@ -3,11 +3,4 @@
3 3
4#include <uapi/asm/signal.h> 4#include <uapi/asm/signal.h>
5 5
6struct old_sigaction {
7 __sighandler_t sa_handler;
8 old_sigset_t sa_mask;
9 unsigned long sa_flags;
10 __sigrestore_t sa_restorer;
11};
12
13#endif /* _ASM_SIGNAL_H */ 6#endif /* _ASM_SIGNAL_H */
diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h
index d685da17f5fb..4cfcc7bba25a 100644
--- a/arch/frv/include/asm/unistd.h
+++ b/arch/frv/include/asm/unistd.h
@@ -27,8 +27,6 @@
27#define __ARCH_WANT_SYS_OLDUMOUNT 27#define __ARCH_WANT_SYS_OLDUMOUNT
28/* #define __ARCH_WANT_SYS_SIGPENDING */ 28/* #define __ARCH_WANT_SYS_SIGPENDING */
29#define __ARCH_WANT_SYS_SIGPROCMASK 29#define __ARCH_WANT_SYS_SIGPROCMASK
30#define __ARCH_WANT_SYS_RT_SIGACTION
31#define __ARCH_WANT_SYS_RT_SIGSUSPEND
32#define __ARCH_WANT_SYS_FORK 30#define __ARCH_WANT_SYS_FORK
33#define __ARCH_WANT_SYS_VFORK 31#define __ARCH_WANT_SYS_VFORK
34#define __ARCH_WANT_SYS_CLONE 32#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 535810a3217a..d822700d4f15 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -33,55 +33,6 @@ struct fdpic_func_descriptor {
33}; 33};
34 34
35/* 35/*
36 * Atomically swap in the new signal mask, and wait for a signal.
37 */
38asmlinkage int sys_sigsuspend(int history0, int history1, old_sigset_t mask)
39{
40 sigset_t blocked;
41 siginitset(&blocked, mask);
42 return sigsuspend(&blocked);
43}
44
45asmlinkage int sys_sigaction(int sig,
46 const struct old_sigaction __user *act,
47 struct old_sigaction __user *oact)
48{
49 struct k_sigaction new_ka, old_ka;
50 int ret;
51
52 if (act) {
53 old_sigset_t mask;
54 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
55 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
56 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
57 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
58 __get_user(mask, &act->sa_mask))
59 return -EFAULT;
60 siginitset(&new_ka.sa.sa_mask, mask);
61 }
62
63 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
64
65 if (!ret && oact) {
66 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
67 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
68 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
69 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
70 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
71 return -EFAULT;
72 }
73
74 return ret;
75}
76
77asmlinkage
78int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
79{
80 return do_sigaltstack(uss, uoss, __frame->sp);
81}
82
83
84/*
85 * Do a signal return; undo the signal stack. 36 * Do a signal return; undo the signal stack.
86 */ 37 */
87 38
@@ -173,7 +124,7 @@ asmlinkage int sys_rt_sigreturn(void)
173 if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8)) 124 if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8))
174 goto badframe; 125 goto badframe;
175 126
176 if (do_sigaltstack(&frame->uc.uc_stack, NULL, __frame->sp) == -EFAULT) 127 if (restore_altstack(&frame->uc.uc_stack))
177 goto badframe; 128 goto badframe;
178 129
179 return gr8; 130 return gr8;
@@ -345,9 +296,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
345 /* Create the ucontext. */ 296 /* Create the ucontext. */
346 if (__put_user(0, &frame->uc.uc_flags) || 297 if (__put_user(0, &frame->uc.uc_flags) ||
347 __put_user(NULL, &frame->uc.uc_link) || 298 __put_user(NULL, &frame->uc.uc_link) ||
348 __put_user((void __user *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) || 299 __save_altstack(&frame->uc.uc_stack, __frame->sp))
349 __put_user(sas_ss_flags(__frame->sp), &frame->uc.uc_stack.ss_flags) ||
350 __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size))
351 goto give_sigsegv; 300 goto give_sigsegv;
352 301
353 if (setup_sigcontext(&frame->uc.uc_mcontext, set->sig[0])) 302 if (setup_sigcontext(&frame->uc.uc_mcontext, set->sig[0]))