public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] signals: convert the X86_32 code to use set_current_blocked()
@ 2011-07-10 19:27 Oleg Nesterov
  2011-07-11  9:31 ` Matt Fleming
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Oleg Nesterov @ 2011-07-10 19:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Tejun Heo, Matt Fleming, linux-kernel

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: Oleg Nesterov <oleg@redhat.com>
---

 arch/x86/kernel/signal.c |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

--- ptrace/arch/x86/kernel/signal.c~3_x86_set_current_blocked	2011-07-10 19:45:21.000000000 +0200
+++ ptrace/arch/x86/kernel/signal.c	2011-07-10 21:00:04.000000000 +0200
@@ -485,17 +485,18 @@ static int __setup_rt_frame(int sig, str
 asmlinkage int
 sys_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();
 
+	set_restore_sigmask();
 	return -ERESTARTNOHAND;
 }
 
@@ -572,10 +573,7 @@ unsigned long sys_sigreturn(struct pt_re
 		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 (restore_sigcontext(regs, &frame->sc, &ax))
 		goto badframe;


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-15  5:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-10 19:27 [PATCH] signals: convert the X86_32 code to use set_current_blocked() Oleg Nesterov
2011-07-11  9:31 ` Matt Fleming
2011-07-13 12:30 ` Tejun Heo
2011-07-15  5:46 ` [tip:x86/signal] x86, signals: Convert " tip-bot for Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox