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

From: Jörn Engel (joern@wohnheim.fh-wedel.de)
Date: Fri Jul 04 2003 - 12:54:39 EST


Hi!

This should be the ppc specific part of the signal stack fixes. It sets the
flag, when switching to the signal stack and clears it, when switching
back. When the kernel tries to switch to the signal stack again,
without switching back, the process screwed up the signal stack, so we
kill it with a SIGSEGV.

Well, it should be, but it ain't. I didn't find the correct spot to
clear the flag again, so this patch is incomplete. Maybe someone else
knows the 2.5 ppc signal handling better than I do?

Jörn

-- 
Good warriors cause others to come to them and do not go to others.
-- Sun Tzu

--- linux-2.5.73/arch/ppc/kernel/signal.c~ss_ppc 2003-07-04 19:01:55.000000000 +0200 +++ linux-2.5.73/arch/ppc/kernel/signal.c 2003-07-04 19:21:44.000000000 +0200 @@ -496,9 +496,18 @@ if (signr > 0) { ka = &current->sighand->action[signr-1]; if ( (ka->sa.sa_flags & SA_ONSTACK) - && (! on_sig_stack(regs->gpr[1]))) + && (! on_sig_stack(regs->gpr[1]))) { + /* FIXME: Need to find the correct spot to clear + * this flag again + */ + if (current->flags & PF_SS_ACTIVE) { + ka->sa.sa_handler = SIG_DFL; + force_sig(SIGSEGV, current); + return 0; + } + current->flags |= PF_SS_ACTIVE; newsp = (current->sas_ss_sp + current->sas_ss_size); - else + } else newsp = regs->gpr[1]; newsp = frame = newsp - sizeof(struct sigregs); - 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 Jul 07 2003 - 22:00:23 EST