diff options
Diffstat (limited to 'arch/s390/kernel/signal.c')
-rw-r--r-- | arch/s390/kernel/signal.c | 61 |
1 files changed, 19 insertions, 42 deletions
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index abbb3c3c7aab..9a40e1cc5ec3 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -57,17 +57,15 @@ typedef struct | |||
57 | */ | 57 | */ |
58 | SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask) | 58 | SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask) |
59 | { | 59 | { |
60 | mask &= _BLOCKABLE; | 60 | sigset_t blocked; |
61 | spin_lock_irq(¤t->sighand->siglock); | ||
62 | current->saved_sigmask = current->blocked; | ||
63 | siginitset(¤t->blocked, mask); | ||
64 | recalc_sigpending(); | ||
65 | spin_unlock_irq(¤t->sighand->siglock); | ||
66 | 61 | ||
62 | current->saved_sigmask = current->blocked; | ||
63 | mask &= _BLOCKABLE; | ||
64 | siginitset(&blocked, mask); | ||
65 | set_current_blocked(&blocked); | ||
67 | set_current_state(TASK_INTERRUPTIBLE); | 66 | set_current_state(TASK_INTERRUPTIBLE); |
68 | schedule(); | 67 | schedule(); |
69 | set_thread_flag(TIF_RESTORE_SIGMASK); | 68 | set_restore_sigmask(); |
70 | |||
71 | return -ERESTARTNOHAND; | 69 | return -ERESTARTNOHAND; |
72 | } | 70 | } |
73 | 71 | ||
@@ -172,18 +170,11 @@ SYSCALL_DEFINE0(sigreturn) | |||
172 | goto badframe; | 170 | goto badframe; |
173 | if (__copy_from_user(&set.sig, &frame->sc.oldmask, _SIGMASK_COPY_SIZE)) | 171 | if (__copy_from_user(&set.sig, &frame->sc.oldmask, _SIGMASK_COPY_SIZE)) |
174 | goto badframe; | 172 | goto badframe; |
175 | |||
176 | sigdelsetmask(&set, ~_BLOCKABLE); | 173 | sigdelsetmask(&set, ~_BLOCKABLE); |
177 | spin_lock_irq(¤t->sighand->siglock); | 174 | set_current_blocked(&set); |
178 | current->blocked = set; | ||
179 | recalc_sigpending(); | ||
180 | spin_unlock_irq(¤t->sighand->siglock); | ||
181 | |||
182 | if (restore_sigregs(regs, &frame->sregs)) | 175 | if (restore_sigregs(regs, &frame->sregs)) |
183 | goto badframe; | 176 | goto badframe; |
184 | |||
185 | return regs->gprs[2]; | 177 | return regs->gprs[2]; |
186 | |||
187 | badframe: | 178 | badframe: |
188 | force_sig(SIGSEGV, current); | 179 | force_sig(SIGSEGV, current); |
189 | return 0; | 180 | return 0; |
@@ -199,21 +190,14 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
199 | goto badframe; | 190 | goto badframe; |
200 | if (__copy_from_user(&set.sig, &frame->uc.uc_sigmask, sizeof(set))) | 191 | if (__copy_from_user(&set.sig, &frame->uc.uc_sigmask, sizeof(set))) |
201 | goto badframe; | 192 | goto badframe; |
202 | |||
203 | sigdelsetmask(&set, ~_BLOCKABLE); | 193 | sigdelsetmask(&set, ~_BLOCKABLE); |
204 | spin_lock_irq(¤t->sighand->siglock); | 194 | set_current_blocked(&set); |
205 | current->blocked = set; | ||
206 | recalc_sigpending(); | ||
207 | spin_unlock_irq(¤t->sighand->siglock); | ||
208 | |||
209 | if (restore_sigregs(regs, &frame->uc.uc_mcontext)) | 195 | if (restore_sigregs(regs, &frame->uc.uc_mcontext)) |
210 | goto badframe; | 196 | goto badframe; |
211 | |||
212 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, | 197 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, |
213 | regs->gprs[15]) == -EFAULT) | 198 | regs->gprs[15]) == -EFAULT) |
214 | goto badframe; | 199 | goto badframe; |
215 | return regs->gprs[2]; | 200 | return regs->gprs[2]; |
216 | |||
217 | badframe: | 201 | badframe: |
218 | force_sig(SIGSEGV, current); | 202 | force_sig(SIGSEGV, current); |
219 | return 0; | 203 | return 0; |
@@ -385,14 +369,11 @@ give_sigsegv: | |||
385 | return -EFAULT; | 369 | return -EFAULT; |
386 | } | 370 | } |
387 | 371 | ||
388 | /* | 372 | static int handle_signal(unsigned long sig, struct k_sigaction *ka, |
389 | * OK, we're invoking a handler | 373 | siginfo_t *info, sigset_t *oldset, |
390 | */ | 374 | struct pt_regs *regs) |
391 | |||
392 | static int | ||
393 | handle_signal(unsigned long sig, struct k_sigaction *ka, | ||
394 | siginfo_t *info, sigset_t *oldset, struct pt_regs * regs) | ||
395 | { | 375 | { |
376 | sigset_t blocked; | ||
396 | int ret; | 377 | int ret; |
397 | 378 | ||
398 | /* Set up the stack frame */ | 379 | /* Set up the stack frame */ |
@@ -400,17 +381,13 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, | |||
400 | ret = setup_rt_frame(sig, ka, info, oldset, regs); | 381 | ret = setup_rt_frame(sig, ka, info, oldset, regs); |
401 | else | 382 | else |
402 | ret = setup_frame(sig, ka, oldset, regs); | 383 | ret = setup_frame(sig, ka, oldset, regs); |
403 | 384 | if (ret) | |
404 | if (ret == 0) { | 385 | return ret; |
405 | spin_lock_irq(¤t->sighand->siglock); | 386 | sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask); |
406 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 387 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
407 | if (!(ka->sa.sa_flags & SA_NODEFER)) | 388 | sigaddset(&blocked, sig); |
408 | sigaddset(¤t->blocked,sig); | 389 | set_current_blocked(&blocked); |
409 | recalc_sigpending(); | 390 | return 0; |
410 | spin_unlock_irq(¤t->sighand->siglock); | ||
411 | } | ||
412 | |||
413 | return ret; | ||
414 | } | 391 | } |
415 | 392 | ||
416 | /* | 393 | /* |