提交 3982294b 编写于 作者: O Oleg Nesterov 提交者: H. Peter Anvin

x86, signals: Convert the X86_32 code to use set_current_blocked()

sys_sigsuspend() and sys_sigreturn() change ->blocked directly.
This is not correct, see the changelog in e6fa16ab
"signal: sigprocmask() should do retarget_shared_pending()"

Change them to use set_current_blocked().
Signed-off-by: NOleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/20110710192727.GA31759@redhat.comSigned-off-by: NH. Peter Anvin <hpa@linux.intel.com>
上级 905f29e2
...@@ -485,17 +485,18 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -485,17 +485,18 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
asmlinkage int asmlinkage int
sys_sigsuspend(int history0, int history1, old_sigset_t mask) sys_sigsuspend(int history0, int history1, old_sigset_t mask)
{ {
mask &= _BLOCKABLE; sigset_t blocked;
spin_lock_irq(&current->sighand->siglock);
current->saved_sigmask = current->blocked; current->saved_sigmask = current->blocked;
siginitset(&current->blocked, mask);
recalc_sigpending(); mask &= _BLOCKABLE;
spin_unlock_irq(&current->sighand->siglock); siginitset(&blocked, mask);
set_current_blocked(&blocked);
current->state = TASK_INTERRUPTIBLE; current->state = TASK_INTERRUPTIBLE;
schedule(); schedule();
set_restore_sigmask();
set_restore_sigmask();
return -ERESTARTNOHAND; return -ERESTARTNOHAND;
} }
...@@ -572,10 +573,7 @@ unsigned long sys_sigreturn(struct pt_regs *regs) ...@@ -572,10 +573,7 @@ unsigned long sys_sigreturn(struct pt_regs *regs)
goto badframe; goto badframe;
sigdelsetmask(&set, ~_BLOCKABLE); sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock); set_current_blocked(&set);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
if (restore_sigcontext(regs, &frame->sc, &ax)) if (restore_sigcontext(regs, &frame->sc, &ax))
goto badframe; goto badframe;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册