[PATCH 2.5.73] Signal handling fix for ppc

Jörn Engel (joern@wohnheim.fh-wedel.de)
Fri, 4 Jul 2003 19:58:59 +0200


Hi!

This patch causes an application with a broken stack to die with a
SIGSEGV (and a core dump and all that) instead of a silent do_exit.

Most other architectures already have it, so ppc should get it as
well.

Anton, did I understand it correctly that you already have the
equivalent for ppc64 in the queue?

Jörn

-- 
With a PC, I always felt limited by the software available. On Unix, 
I am limited only by my knowledge.
-- Peter J. Schoenster

--- linux-2.5.73/arch/ppc/kernel/signal.c~sigsegv_ppc 2003-07-03 19:17:21.000000000 +0200 +++ linux-2.5.73/arch/ppc/kernel/signal.c 2003-07-04 19:01:55.000000000 +0200 @@ -234,7 +234,9 @@ return 0; badframe: - do_exit(SIGSEGV); + if (sig == SIGSEGV) + ka->sa.sa_handler = SIG_DFL; + force_sig(SIGSEGV, current); } static void @@ -285,7 +287,9 @@ printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n", regs, frame, newsp); #endif - do_exit(SIGSEGV); + if (sig == SIGSEGV) + ka->sa.sa_handler = SIG_DFL; + force_sig(SIGSEGV, current); } /* @@ -332,7 +336,9 @@ return 0; badframe: - do_exit(SIGSEGV); + if (sig == SIGSEGV) + ka->sa.sa_handler = SIG_DFL; + force_sig(SIGSEGV, current); } /* @@ -375,7 +381,9 @@ printk("badframe in setup_frame, regs=%p frame=%p newsp=%lx\n", regs, frame, newsp); #endif - do_exit(SIGSEGV); + if (sig == SIGSEGV) + ka->sa.sa_handler = SIG_DFL; + force_sig(SIGSEGV, current); } /* @@ -462,7 +470,9 @@ regs, frame, *newspp); printk("sc=%p sig=%d ka=%p info=%p oldset=%p\n", sc, sig, ka, info, oldset); #endif - do_exit(SIGSEGV); + if (sig == SIGSEGV) + ka->sa.sa_handler = SIG_DFL; + force_sig(SIGSEGV, current); } /* - 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/