aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-23 21:11:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-23 21:11:45 -0400
commitf9369910a6225b8d4892c3f20ae740a711cd5ace (patch)
tree8650ff79d7607bceb35509c028400ecf1c317de0 /arch/mn10300/kernel
parent05f144a0d5c2207a0349348127f996e104ad7404 (diff)
parent415d04d08fec74b226c92c1fb54ad117c9c6bac4 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull first series of signal handling cleanups from Al Viro: "This is just the first part of the queue (about a half of it); assorted fixes all over the place in signal handling. This one ends with all sigsuspend() implementations switched to generic one (->saved_sigmask-based). With this, a bunch of assorted old buglets are fixed and most of the missing bits of NOTIFY_RESUME hookup are in place. Two more fixes sit in arm and um trees respectively, and there's a couple of broken ones that need obvious fixes - parisc and avr32 check TIF_NOTIFY_RESUME only on one of two codepaths; fixes for that will happen in the next series" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (55 commits) unicore32: if there's no handler we need to restore sigmask, syscall or no syscall xtensa: add handling of TIF_NOTIFY_RESUME microblaze: drop 'oldset' argument of do_notify_resume() microblaze: handle TIF_NOTIFY_RESUME score: add handling of NOTIFY_RESUME to do_notify_resume() m68k: add TIF_NOTIFY_RESUME and handle it. sparc: kill ancient comment in sparc_sigaction() h8300: missing checks of __get_user()/__put_user() return values frv: missing checks of __get_user()/__put_user() return values cris: missing checks of __get_user()/__put_user() return values powerpc: missing checks of __get_user()/__put_user() return values sh: missing checks of __get_user()/__put_user() return values sparc: missing checks of __get_user()/__put_user() return values avr32: struct old_sigaction is never used m32r: struct old_sigaction is never used xtensa: xtensa_sigaction doesn't exist alpha: tidy signal delivery up score: don't open-code force_sigsegv() cris: don't open-code force_sigsegv() blackfin: don't open-code force_sigsegv() ...
Diffstat (limited to 'arch/mn10300/kernel')
-rw-r--r--arch/mn10300/kernel/signal.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index 690f4e9507d7..890cf91767cc 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -38,17 +38,9 @@
38 */ 38 */
39asmlinkage long sys_sigsuspend(int history0, int history1, old_sigset_t mask) 39asmlinkage long sys_sigsuspend(int history0, int history1, old_sigset_t mask)
40{ 40{
41 mask &= _BLOCKABLE; 41 sigset_t blocked;
42 spin_lock_irq(&current->sighand->siglock); 42 siginitset(&blocked, mask);
43 current->saved_sigmask = current->blocked; 43 return sigsuspend(&blocked);
44 siginitset(&current->blocked, mask);
45 recalc_sigpending();
46 spin_unlock_irq(&current->sighand->siglock);
47
48 current->state = TASK_INTERRUPTIBLE;
49 schedule();
50 set_thread_flag(TIF_RESTORE_SIGMASK);
51 return -ERESTARTNOHAND;
52} 44}
53 45
54/* 46/*
@@ -172,10 +164,7 @@ asmlinkage long sys_sigreturn(void)
172 goto badframe; 164 goto badframe;
173 165
174 sigdelsetmask(&set, ~_BLOCKABLE); 166 sigdelsetmask(&set, ~_BLOCKABLE);
175 spin_lock_irq(&current->sighand->siglock); 167 set_current_blocked(&set);
176 current->blocked = set;
177 recalc_sigpending();
178 spin_unlock_irq(&current->sighand->siglock);
179 168
180 if (restore_sigcontext(current_frame(), &frame->sc, &d0)) 169 if (restore_sigcontext(current_frame(), &frame->sc, &d0))
181 goto badframe; 170 goto badframe;
@@ -203,10 +192,7 @@ asmlinkage long sys_rt_sigreturn(void)
203 goto badframe; 192 goto badframe;
204 193
205 sigdelsetmask(&set, ~_BLOCKABLE); 194 sigdelsetmask(&set, ~_BLOCKABLE);
206 spin_lock_irq(&current->sighand->siglock); 195 set_current_blocked(&set);
207 current->blocked = set;
208 recalc_sigpending();
209 spin_unlock_irq(&current->sighand->siglock);
210 196
211 if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0)) 197 if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0))
212 goto badframe; 198 goto badframe;
@@ -476,15 +462,8 @@ static int handle_signal(int sig,
476 else 462 else
477 ret = setup_frame(sig, ka, oldset, regs); 463 ret = setup_frame(sig, ka, oldset, regs);
478 464
479 if (ret == 0) { 465 if (ret == 0)
480 spin_lock_irq(&current->sighand->siglock); 466 block_sigmask(ka, sig);
481 sigorsets(&current->blocked, &current->blocked,
482 &ka->sa.sa_mask);
483 if (!(ka->sa.sa_flags & SA_NODEFER))
484 sigaddset(&current->blocked, sig);
485 recalc_sigpending();
486 spin_unlock_irq(&current->sighand->siglock);
487 }
488 467
489 return ret; 468 return ret;
490} 469}