Re: [PATCH 2.5.73] Signal stack fixes #1 introduce PF_SS_ACTIVE

Jörn Engel (joern@wohnheim.fh-wedel.de)
Sat, 5 Jul 2003 09:39:46 +0200


On Sat, 5 July 2003 09:18:21 +1000, Paul Mackerras wrote:
>
> This is madness.
>
> There is nothing in POSIX that says that you have to exit a signal
> handler by returning from it (which, under Linux, ends up doing a
> sigreturn or rt_sigreturn system call). It is explicitly permitted to
> return from a RT signal handler with setcontext(), for instance. And
> it is at least long-standing practice to return using longjmp().
> Neither setcontext nor longjmp will do a system call (yes, setcontext
> is a system call on sparc, but it isn't on x86 AFAIK).
>
> So - the kernel doesn't (and can't and shouldn't need to) know about
> all transitions to or from a signal stack. Therefore the PF_SS_ACTIVE
> bit is useless since it will be wrong some of the time.

Ack.

> Anyway, what is the problem with taking a signal on the signal stack
> when you in a signal handler using the signal stack? You just keep
> going down the stack from where you are, which is what the code
> already does.

The problem is with a broken signal handler, that moves the stack
pointer to nirvana. You get a signal, set up the signal stack, move
the pointer to nirvana, get a signal, set up the signal stack, move
the pointer to nirvana, get a signal, ...

If I was just going down the signal stack, I would be perfectly happy,
but instead the kernel believes each signal is the very first on the
signal stack and sets it up again (and again...) each time.

> BTW, I am the PPC maintainer; Ben is the powermac maintainer.

Sorry about that.

Jörn

-- 
Measure. Don't tune for speed until you've measured, and even then
don't unless one part of the code overwhelms the rest.
-- Rob Pike
-
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/