* [PATCH] signals: convert the IA32_EMULATION code to use set_current_blocked()
@ 2011-07-10 19:27 Oleg Nesterov
2011-07-11 9:30 ` 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
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: Oleg Nesterov <oleg@redhat.com>
---
arch/x86/ia32/ia32_signal.c | 44 ++++++++++++++++++--------------------------
1 file changed, 18 insertions(+), 26 deletions(-)
--- ptrace/arch/x86/ia32/ia32_signal.c~3_ia32_set_current_blocked 2011-06-14 16:00:33.000000000 +0200
+++ ptrace/arch/x86/ia32/ia32_signal.c 2011-07-10 21:21:30.000000000 +0200
@@ -127,15 +127,17 @@ int copy_siginfo_from_user32(siginfo_t *
asmlinkage long sys32_sigsuspend(int history0, int history1, old_sigset_t mask)
{
- mask &= _BLOCKABLE;
- spin_lock_irq(¤t->sighand->siglock);
+ sigset_t blocked;
+
current->saved_sigmask = current->blocked;
- siginitset(¤t->blocked, mask);
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
+
+ mask &= _BLOCKABLE;
+ siginitset(&blocked, mask);
+ set_current_blocked(&blocked);
current->state = TASK_INTERRUPTIBLE;
schedule();
+
set_restore_sigmask();
return -ERESTARTNOHAND;
}
@@ -279,10 +281,7 @@ asmlinkage long sys32_sigreturn(struct p
goto badframe;
sigdelsetmask(&set, ~_BLOCKABLE);
- spin_lock_irq(¤t->sighand->siglock);
- current->blocked = set;
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
+ set_current_blocked(&set);
if (ia32_restore_sigcontext(regs, &frame->sc, &ax))
goto badframe;
@@ -308,10 +307,7 @@ asmlinkage long sys32_rt_sigreturn(struc
goto badframe;
sigdelsetmask(&set, ~_BLOCKABLE);
- spin_lock_irq(¤t->sighand->siglock);
- current->blocked = set;
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
+ set_current_blocked(&set);
if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
goto badframe;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] signals: convert the IA32_EMULATION code to use set_current_blocked()
2011-07-10 19:27 [PATCH] signals: convert the IA32_EMULATION code to use set_current_blocked() Oleg Nesterov
@ 2011-07-11 9:30 ` Matt Fleming
2011-07-13 12:29 ` Tejun Heo
2011-07-15 5:46 ` [tip:x86/signal] x86, signals: Convert " tip-bot for Oleg Nesterov
2 siblings, 0 replies; 4+ messages in thread
From: Matt Fleming @ 2011-07-11 9:30 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, Tejun Heo, linux-kernel
On Sun, 10 Jul 2011 21:27:24 +0200
Oleg Nesterov <oleg@redhat.com> wrote:
> 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: Oleg Nesterov <oleg@redhat.com>
Looks simple enough.
Reviewed-by: Matt Fleming <matt.fleming@linux.intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] signals: convert the IA32_EMULATION code to use set_current_blocked()
2011-07-10 19:27 [PATCH] signals: convert the IA32_EMULATION code to use set_current_blocked() Oleg Nesterov
2011-07-11 9:30 ` Matt Fleming
@ 2011-07-13 12:29 ` Tejun Heo
2011-07-15 5:46 ` [tip:x86/signal] x86, signals: Convert " tip-bot for Oleg Nesterov
2 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2011-07-13 12:29 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, Matt Fleming, linux-kernel
On Sun, Jul 10, 2011 at 09:27:24PM +0200, Oleg Nesterov wrote:
> 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: Oleg Nesterov <oleg@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:x86/signal] x86, signals: Convert the IA32_EMULATION code to use set_current_blocked()
2011-07-10 19:27 [PATCH] signals: convert the IA32_EMULATION code to use set_current_blocked() Oleg Nesterov
2011-07-11 9:30 ` Matt Fleming
2011-07-13 12:29 ` Tejun Heo
@ 2011-07-15 5:46 ` tip-bot for Oleg Nesterov
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Oleg Nesterov @ 2011-07-15 5:46 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, oleg, tglx, hpa
Commit-ID: 905f29e2aa004560907199cc96248fa11bafea8a
Gitweb: http://git.kernel.org/tip/905f29e2aa004560907199cc96248fa11bafea8a
Author: Oleg Nesterov <oleg@redhat.com>
AuthorDate: Sun, 10 Jul 2011 21:27:24 +0200
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Thu, 14 Jul 2011 21:21:31 -0700
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: 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>
---
arch/x86/ia32/ia32_signal.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 588a7aa..6557769 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -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(¤t->sighand->siglock);
+ sigset_t blocked;
+
current->saved_sigmask = current->blocked;
- siginitset(¤t->blocked, mask);
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
+
+ mask &= _BLOCKABLE;
+ siginitset(&blocked, mask);
+ set_current_blocked(&blocked);
current->state = TASK_INTERRUPTIBLE;
schedule();
+
set_restore_sigmask();
return -ERESTARTNOHAND;
}
@@ -279,10 +281,7 @@ asmlinkage long sys32_sigreturn(struct pt_regs *regs)
goto badframe;
sigdelsetmask(&set, ~_BLOCKABLE);
- spin_lock_irq(¤t->sighand->siglock);
- current->blocked = set;
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
+ set_current_blocked(&set);
if (ia32_restore_sigcontext(regs, &frame->sc, &ax))
goto badframe;
@@ -308,10 +307,7 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
goto badframe;
sigdelsetmask(&set, ~_BLOCKABLE);
- spin_lock_irq(¤t->sighand->siglock);
- current->blocked = set;
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
+ set_current_blocked(&set);
if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
goto badframe;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-15 5:46 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 IA32_EMULATION code to use set_current_blocked() Oleg Nesterov
2011-07-11 9:30 ` Matt Fleming
2011-07-13 12:29 ` Tejun Heo
2011-07-15 5:46 ` [tip:x86/signal] x86, signals: Convert " tip-bot for Oleg Nesterov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.