Skip to content

Commit

Permalink
x86, signals: Convert the IA32_EMULATION code to use set_current_bloc…
Browse files Browse the repository at this point in the history
…ked()

sys32_sigsuspend() and sys32_*sigreturn() change ->blocked directly.
This is not correct, see the changelog in e6fa16a
"signal: sigprocmask() should do retarget_shared_pending()"

Change them to use set_current_blocked().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/20110710192724.GA31755@redhat.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Oleg Nesterov authored and H. Peter Anvin committed Jul 15, 2011
1 parent 620917d commit 905f29e
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions arch/x86/ia32/ia32_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,17 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)

asmlinkage long sys32_sigsuspend(int history0, int history1, old_sigset_t mask)
{
mask &= _BLOCKABLE;
spin_lock_irq(&current->sighand->siglock);
sigset_t blocked;

current->saved_sigmask = current->blocked;
siginitset(&current->blocked, mask);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);

mask &= _BLOCKABLE;
siginitset(&blocked, mask);
set_current_blocked(&blocked);

current->state = TASK_INTERRUPTIBLE;
schedule();

set_restore_sigmask();
return -ERESTARTNOHAND;
}
Expand Down Expand Up @@ -279,10 +281,7 @@ asmlinkage long sys32_sigreturn(struct pt_regs *regs)
goto badframe;

sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
set_current_blocked(&set);

if (ia32_restore_sigcontext(regs, &frame->sc, &ax))
goto badframe;
Expand All @@ -308,10 +307,7 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
goto badframe;

sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
set_current_blocked(&set);

if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
goto badframe;
Expand Down

0 comments on commit 905f29e

Please sign in to comment.