diff options
author | Oleg Nesterov <oleg@redhat.com> | 2011-05-09 07:48:56 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2011-05-09 07:48:56 -0400 |
commit | 2e4f7c7769a0b8b6b3e88b0436c6c634f146a4ef (patch) | |
tree | 1e8a46790b0c0834006cd07c321aa4b7556a3d05 /kernel/signal.c | |
parent | b013c399245a88a73aaa031279f0c4d7cea7fe68 (diff) |
signal: sys_sigprocmask() needs retarget_shared_pending()
sys_sigprocmask() changes current->blocked by hand. Convert this code
to use set_current_blocked().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 22 |
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(¤t->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(¤t->blocked, new_set); | 2916 | sigaddsetmask(&new_blocked, new_set); |
2920 | break; | 2917 | break; |
2921 | case SIG_UNBLOCK: | 2918 | case SIG_UNBLOCK: |
2922 | sigdelsetmask(¤t->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(¤t->sighand->siglock); | ||
2931 | if (error) | ||
2932 | return error; | ||
2933 | } | 2929 | } |
2934 | 2930 | ||
2935 | if (oset) { | 2931 | if (oset) { |