Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 905f29e2 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by H. Peter Anvin
Browse files

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



sys32_sigsuspend() and sys32_*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: default avatarOleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/20110710192724.GA31755@redhat.com


Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent 620917de
Loading
Loading
Loading
Loading
+9 −13
Original line number Original line Diff line number Diff line
@@ -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)
asmlinkage long sys32_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;
}
}
@@ -279,10 +281,7 @@ asmlinkage long sys32_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 (ia32_restore_sigcontext(regs, &frame->sc, &ax))
	if (ia32_restore_sigcontext(regs, &frame->sc, &ax))
		goto badframe;
		goto badframe;
@@ -308,10 +307,7 @@ asmlinkage long sys32_rt_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 (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
	if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
		goto badframe;
		goto badframe;