aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/signal.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index c0af959b8530..b87780ef7d28 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2900,7 +2900,7 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
2900 old_sigset_t __user *, oset) 2900 old_sigset_t __user *, oset)
2901{ 2901{
2902 old_sigset_t old_set, new_set; 2902 old_sigset_t old_set, new_set;
2903 int error; 2903 sigset_t new_blocked;
2904 2904
2905 old_set = current->blocked.sig[0]; 2905 old_set = current->blocked.sig[0];
2906 2906
@@ -2909,27 +2909,23 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
2909 return -EFAULT; 2909 return -EFAULT;
2910 new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP)); 2910 new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP));
2911 2911
2912 error = 0; 2912 new_blocked = current->blocked;
2913 spin_lock_irq(&current->sighand->siglock); 2913
2914 switch (how) { 2914 switch (how) {
2915 default:
2916 error = -EINVAL;
2917 break;
2918 case SIG_BLOCK: 2915 case SIG_BLOCK:
2919 sigaddsetmask(&current->blocked, new_set); 2916 sigaddsetmask(&new_blocked, new_set);
2920 break; 2917 break;
2921 case SIG_UNBLOCK: 2918 case SIG_UNBLOCK:
2922 sigdelsetmask(&current->blocked, new_set); 2919 sigdelsetmask(&new_blocked, new_set);
2923 break; 2920 break;
2924 case SIG_SETMASK: 2921 case SIG_SETMASK:
2925 current->blocked.sig[0] = new_set; 2922 new_blocked.sig[0] = new_set;
2926 break; 2923 break;
2924 default:
2925 return -EINVAL;
2927 } 2926 }
2928 2927
2929 recalc_sigpending(); 2928 set_current_blocked(&new_blocked);
2930 spin_unlock_irq(&current->sighand->siglock);
2931 if (error)
2932 return error;
2933 } 2929 }
2934 2930
2935 if (oset) { 2931 if (oset) {