aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel
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/mn10300/kernel
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/mn10300/kernel')
-rw-r--r--arch/mn10300/kernel/signal.c60
1 files changed, 2 insertions, 58 deletions
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index f570b3085ef9..9dfac5cd16e6 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -32,59 +32,6 @@
32#define DEBUG_SIG 0 32#define DEBUG_SIG 0
33 33
34/* 34/*
35 * atomically swap in the new signal mask, and wait for a signal.
36 */
37asmlinkage long sys_sigsuspend(int history0, int history1, old_sigset_t mask)
38{
39 sigset_t blocked;
40 siginitset(&blocked, mask);
41 return sigsuspend(&blocked);
42}
43
44/*
45 * set signal action syscall
46 */
47asmlinkage long sys_sigaction(int sig,
48 const struct old_sigaction __user *act,
49 struct old_sigaction __user *oact)
50{
51 struct k_sigaction new_ka, old_ka;
52 int ret;
53
54 if (act) {
55 old_sigset_t mask;
56 if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
57 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
58 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
59 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
60 __get_user(mask, &act->sa_mask))
61 return -EFAULT;
62 siginitset(&new_ka.sa.sa_mask, mask);
63 }
64
65 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
66
67 if (!ret && oact) {
68 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
69 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
70 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
71 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
72 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
73 return -EFAULT;
74 }
75
76 return ret;
77}
78
79/*
80 * set alternate signal stack syscall
81 */
82asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t *uoss)
83{
84 return do_sigaltstack(uss, uoss, current_frame()->sp);
85}
86
87/*
88 * do a signal return; undo the signal stack. 35 * do a signal return; undo the signal stack.
89 */ 36 */
90static int restore_sigcontext(struct pt_regs *regs, 37static int restore_sigcontext(struct pt_regs *regs,
@@ -193,8 +140,7 @@ asmlinkage long sys_rt_sigreturn(void)
193 if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0)) 140 if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0))
194 goto badframe; 141 goto badframe;
195 142
196 if (do_sigaltstack(&frame->uc.uc_stack, NULL, current_frame()->sp) == 143 if (restore_altstack(&frame->uc.uc_stack))
197 -EFAULT)
198 goto badframe; 144 goto badframe;
199 145
200 return d0; 146 return d0;
@@ -359,9 +305,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
359 /* create the ucontext. */ 305 /* create the ucontext. */
360 if (__put_user(0, &frame->uc.uc_flags) || 306 if (__put_user(0, &frame->uc.uc_flags) ||
361 __put_user(0, &frame->uc.uc_link) || 307 __put_user(0, &frame->uc.uc_link) ||
362 __put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) || 308 __save_altstack(&frame->uc.uc_stack, regs->sp) ||
363 __put_user(sas_ss_flags(regs->sp), &frame->uc.uc_stack.ss_flags) ||
364 __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size) ||
365 setup_sigcontext(&frame->uc.uc_mcontext, 309 setup_sigcontext(&frame->uc.uc_mcontext,
366 &frame->fpuctx, regs, set->sig[0]) || 310 &frame->fpuctx, regs, set->sig[0]) ||
367 __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set))) 311 __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)))