Re: Long standing bug in alternate stack handling

From: Christian Ehrhardt (ehrhardt@mathematik.uni-ulm.de)
Date: Wed Apr 25 2001 - 17:13:47 EST


On Wed, Feb 21, 2001 at 11:02:17PM +0100, Christian Ehrhardt wrote:

Hi,

[ Sorry for the follow up on my own post ]

> If a signal handler is registered with the SA_ONSTACK flag the
> kernel will try to execute the signal handler on the alternate
> stack even if no such stack is registered.

Here's a simple patch for i386. Please consider it for inclusion.
Posix explicitly requires the behaviour implemented by this patch.

--- arch/i386/kernel/signal.c.old Mon Sep 25 22:10:28 2000
+++ arch/i386/kernel/signal.c Sun Apr 22 16:04:47 2001
@@ -371,7 +371,7 @@
 
         /* This is the X/Open sanctioned signal stack switching. */
         if (ka->sa.sa_flags & SA_ONSTACK) {
- if (! on_sig_stack(esp))
+ if (sas_ss_flags(esp) == 0)
                         esp = current->sas_ss_sp + current->sas_ss_size;
         }
 
NOTE: As far as I can tell all archs are affected by this bug.

   best regards Christian Ehrhardt

-- 
THAT'S ALL FOLKS!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:14 EST