aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/signal_32.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index 20f29e4c1d33..5c6170c44b00 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -295,6 +295,13 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
295 /* Default to using normal stack */ 295 /* Default to using normal stack */
296 esp = regs->esp; 296 esp = regs->esp;
297 297
298 /*
299 * If we are on the alternate signal stack and would overflow it, don't.
300 * Return an always-bogus address instead so we will die with SIGSEGV.
301 */
302 if (on_sig_stack(esp) && !likely(on_sig_stack(esp - frame_size)))
303 return (void __user *) -1L;
304
298 /* This is the X/Open sanctioned signal stack switching. */ 305 /* This is the X/Open sanctioned signal stack switching. */
299 if (ka->sa.sa_flags & SA_ONSTACK) { 306 if (ka->sa.sa_flags & SA_ONSTACK) {
300 if (sas_ss_flags(esp) == 0) 307 if (sas_ss_flags(esp) == 0)