Skip to content

Commit 43aca32

Browse files
Matt Flemingtorvalds
authored andcommitted
Hexagon: use set_current_blocked() and block_sigmask()
As described in e6fa16a ("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 5e6292c ("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> Acked-by: Richard Kuo <rkuo@codeaurora.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ee00560 commit 43aca32

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

arch/hexagon/kernel/signal.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,7 @@ static int handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
192192
if (rc)
193193
return rc;
194194

195-
spin_lock_irq(&current->sighand->siglock);
196-
sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
197-
if (!(ka->sa.sa_flags & SA_NODEFER))
198-
sigaddset(&current->blocked, sig);
199-
recalc_sigpending();
200-
spin_unlock_irq(&current->sighand->siglock);
195+
block_sigmask(ka, sig);
201196

202197
return 0;
203198
}
@@ -305,10 +300,7 @@ asmlinkage int sys_rt_sigreturn(void)
305300
goto badframe;
306301

307302
sigdelsetmask(&blocked, ~_BLOCKABLE);
308-
spin_lock_irq(&current->sighand->siglock);
309-
current->blocked = blocked;
310-
recalc_sigpending();
311-
spin_unlock_irq(&current->sighand->siglock);
303+
set_current_blocked(&blocked);
312304

313305
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
314306
goto badframe;

0 commit comments

Comments
 (0)