aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-05-10 20:57:59 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-21 23:52:37 -0400
commit43a35995562495bd70a87b5d3a2e820036ee6597 (patch)
treed848cf4117e6956c67d42325a0b45da0d3648f0f /arch
parent3334bf12480f10377e44d932baf53f34ec737f8b (diff)
m68k: use set_current_blocked() and block_sigmask()
As described in e6fa16ab ("signal: sigprocmask() should do retarget_shared_pending()") the modification of current->blocked is incorrect as we need to check whether the signal we're about to block is pending in the shared queue. Also, use the new helper function introduced in commit 5e6292c0f28f ("signal: add block_sigmask() for adding sigmask to current->blocked") which centralises the code for updating current->blocked after successfully delivering a signal and reduces the amount of duplicate code across architectures. In the past some architectures got this code wrong, so using this helper function should stop that from happening again. Acked-by: Oleg Nesterov <oleg@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/m68k/kernel/signal.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index 8186982fb32..d8f6960e8fd 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -795,8 +795,7 @@ asmlinkage int do_sigreturn(unsigned long __unused)
795 goto badframe; 795 goto badframe;
796 796
797 sigdelsetmask(&set, ~_BLOCKABLE); 797 sigdelsetmask(&set, ~_BLOCKABLE);
798 current->blocked = set; 798 set_current_blocked(&set);
799 recalc_sigpending();
800 799
801 if (restore_sigcontext(regs, &frame->sc, frame + 1)) 800 if (restore_sigcontext(regs, &frame->sc, frame + 1))
802 goto badframe; 801 goto badframe;
@@ -821,8 +820,7 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused)
821 goto badframe; 820 goto badframe;
822 821
823 sigdelsetmask(&set, ~_BLOCKABLE); 822 sigdelsetmask(&set, ~_BLOCKABLE);
824 current->blocked = set; 823 set_current_blocked(&set);
825 recalc_sigpending();
826 824
827 if (rt_restore_ucontext(regs, sw, &frame->uc)) 825 if (rt_restore_ucontext(regs, sw, &frame->uc))
828 goto badframe; 826 goto badframe;
@@ -1141,10 +1139,7 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
1141 if (err) 1139 if (err)
1142 return; 1140 return;
1143 1141
1144 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 1142 block_sigmask(ka, sig);
1145 if (!(ka->sa.sa_flags & SA_NODEFER))
1146 sigaddset(&current->blocked,sig);
1147 recalc_sigpending();
1148 1143
1149 if (test_thread_flag(TIF_DELAYED_TRACE)) { 1144 if (test_thread_flag(TIF_DELAYED_TRACE)) {
1150 regs->sr &= ~0x8000; 1145 regs->sr &= ~0x8000;