Commit 0c4a8423 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

signals: set_current_blocked() can use __set_current_blocked()

Cleanup.  And I think we need more cleanups, in particular
__set_current_blocked() and sigprocmask() should die.  Nobody should
ever block SIGKILL or SIGSTOP.

 - Change set_current_blocked() to use __set_current_blocked()

 - Change sys_sigprocmask() to use set_current_blocked(), this way it
   should not worry about SIGKILL/SIGSTOP.
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5ba53ff6
...@@ -2528,11 +2528,8 @@ static void __set_task_blocked(struct task_struct *tsk, const sigset_t *newset) ...@@ -2528,11 +2528,8 @@ static void __set_task_blocked(struct task_struct *tsk, const sigset_t *newset)
*/ */
void set_current_blocked(sigset_t *newset) void set_current_blocked(sigset_t *newset)
{ {
struct task_struct *tsk = current;
sigdelsetmask(newset, sigmask(SIGKILL) | sigmask(SIGSTOP)); sigdelsetmask(newset, sigmask(SIGKILL) | sigmask(SIGSTOP));
spin_lock_irq(&tsk->sighand->siglock); __set_current_blocked(newset);
__set_task_blocked(tsk, newset);
spin_unlock_irq(&tsk->sighand->siglock);
} }
void __set_current_blocked(const sigset_t *newset) void __set_current_blocked(const sigset_t *newset)
...@@ -3204,7 +3201,6 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset, ...@@ -3204,7 +3201,6 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
if (nset) { if (nset) {
if (copy_from_user(&new_set, nset, sizeof(*nset))) if (copy_from_user(&new_set, nset, sizeof(*nset)))
return -EFAULT; return -EFAULT;
new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP));
new_blocked = current->blocked; new_blocked = current->blocked;
...@@ -3222,7 +3218,7 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset, ...@@ -3222,7 +3218,7 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
return -EINVAL; return -EINVAL;
} }
__set_current_blocked(&new_blocked); set_current_blocked(&new_blocked);
} }
if (oset) { if (oset) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment