Commit 6e61ee3b authored by Matt Fleming's avatar Matt Fleming Committed by Linus Torvalds

C6X: 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 5e6292c0
("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
Acked-by: default avatarMark Salter <>
Cc: Aurelien Jacquiot <>
Acked-by: default avatarOleg Nesterov <>
Signed-off-by: default avatarMatt Fleming <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 389325b4
......@@ -85,10 +85,7 @@ asmlinkage int do_rt_sigreturn(struct pt_regs *regs)
goto badframe;
sigdelsetmask(&set, ~_BLOCKABLE);
current->blocked = set;
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe;
......@@ -279,15 +276,8 @@ static int handle_signal(int sig,
/* Set up the stack frame */
ret = setup_rt_frame(sig, ka, info, oldset, regs);
if (ret == 0) {
sigorsets(&current->blocked, &current->blocked,
if (!(ka->sa.sa_flags & SA_NODEFER))
sigaddset(&current->blocked, sig);
if (ret == 0)
block_sigmask(ka, sig);
return ret;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment