signals: convert the X86_32 code to use set_current_blocked()
PATCH 1/1 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().
---
arch/x86/kernel/signal.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
arch/x86/kernel/signal.c renamed from arch/x86/kernel/signal.c~3_x86_set_current_blocked +8 -10
@@ -485,17 +485,18 @@ static int __setup_rt_frame(int sig, str asmlinkage intsys_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 (); +set_restore_sigmask ();return -ERESTARTNOHAND ; }
@@ -572,10 +573,7 @@ unsigned long sys_sigreturn(struct pt_re 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 (restore_sigcontext (regs, &frame->sc, &ax)) goto badframe;
Quoted 7 lines · On Sun, 10 Jul 2011 21:27:27 +0200 Oleg Nesterov <[email protected]> wrote:
sys_sigsuspend()andsys_sigreturn()change ->blocked directly. This is not correct, see the changelog ine6fa16ab"signal:sigprocmask()should doretarget_shared_pending()"Change them to use
set_current_blocked().Signed-off-by Oleg Nesterov <[email protected]>
Quoted 7 lines · Oleg Nesterov
sys_sigsuspend()andsys_sigreturn()change ->blocked directly. This is not correct, see the changelog ine6fa16ab"signal:sigprocmask()should doretarget_shared_pending()"Change them to use
set_current_blocked().Signed-off-by Oleg Nesterov <[email protected]>
Signature · 1 line
tejun
[tip:x86/signal] x86, signals: Convert the X86_32 code to use set_current_blocked()
In reply to Oleg NesterovCommit-ID: 3982294b0342474ff91472b34c6afb701785f524 Gitweb: http://git.kernel.org/tip/3982294b0342474ff91472b34c6afb701785f524 Author: Oleg Nesterov <[email protected]> AuthorDate: Sun, 10 Jul 2011 21:27:27 +0200 Committer: H. Peter Anvin <[email protected]> CommitDate: Thu, 14 Jul 2011 21:21:57 -0700
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().
--- arch/x86/kernel/signal.c | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-)
arch/x86/kernel/signal.c +8 -10
@@ -485,17 +485,18 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, asmlinkage intsys_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 (); +set_restore_sigmask ();return -ERESTARTNOHAND ; }
@@ -572,10 +573,7 @@ unsigned long sys_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 (restore_sigcontext (regs, &frame->sc, &ax)) goto badframe;