aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/signal.c')
-rw-r--r--arch/s390/kernel/signal.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 4449bf32cbf1..b97682040215 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -27,6 +27,7 @@
27#include <asm/ucontext.h> 27#include <asm/ucontext.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/lowcore.h> 29#include <asm/lowcore.h>
30#include "entry.h"
30 31
31#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 32#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
32 33
@@ -235,6 +236,10 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
235 /* Default to using normal stack */ 236 /* Default to using normal stack */
236 sp = regs->gprs[15]; 237 sp = regs->gprs[15];
237 238
239 /* Overflow on alternate signal stack gives SIGSEGV. */
240 if (on_sig_stack(sp) && !on_sig_stack((sp - frame_size) & -8UL))
241 return (void __user *) -1UL;
242
238 /* This is the X/Open sanctioned signal stack switching. */ 243 /* This is the X/Open sanctioned signal stack switching. */
239 if (ka->sa.sa_flags & SA_ONSTACK) { 244 if (ka->sa.sa_flags & SA_ONSTACK) {
240 if (! sas_ss_flags(sp)) 245 if (! sas_ss_flags(sp))
@@ -270,6 +275,9 @@ static int setup_frame(int sig, struct k_sigaction *ka,
270 if (!access_ok(VERIFY_WRITE, frame, sizeof(sigframe))) 275 if (!access_ok(VERIFY_WRITE, frame, sizeof(sigframe)))
271 goto give_sigsegv; 276 goto give_sigsegv;
272 277
278 if (frame == (void __user *) -1UL)
279 goto give_sigsegv;
280
273 if (__copy_to_user(&frame->sc.oldmask, &set->sig, _SIGMASK_COPY_SIZE)) 281 if (__copy_to_user(&frame->sc.oldmask, &set->sig, _SIGMASK_COPY_SIZE))
274 goto give_sigsegv; 282 goto give_sigsegv;
275 283
@@ -327,6 +335,9 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
327 if (!access_ok(VERIFY_WRITE, frame, sizeof(rt_sigframe))) 335 if (!access_ok(VERIFY_WRITE, frame, sizeof(rt_sigframe)))
328 goto give_sigsegv; 336 goto give_sigsegv;
329 337
338 if (frame == (void __user *) -1UL)
339 goto give_sigsegv;
340
330 if (copy_siginfo_to_user(&frame->info, info)) 341 if (copy_siginfo_to_user(&frame->info, info))
331 goto give_sigsegv; 342 goto give_sigsegv;
332 343
@@ -474,11 +485,6 @@ void do_signal(struct pt_regs *regs)
474 int ret; 485 int ret;
475#ifdef CONFIG_COMPAT 486#ifdef CONFIG_COMPAT
476 if (test_thread_flag(TIF_31BIT)) { 487 if (test_thread_flag(TIF_31BIT)) {
477 extern int handle_signal32(unsigned long sig,
478 struct k_sigaction *ka,
479 siginfo_t *info,
480 sigset_t *oldset,
481 struct pt_regs *regs);
482 ret = handle_signal32(signr, &ka, &info, oldset, regs); 488 ret = handle_signal32(signr, &ka, &info, oldset, regs);
483 } 489 }
484 else 490 else