From: Mark Salter Date: Fri, 8 Jan 2010 22:43:14 +0000 (-0800) Subject: mn10300: signal stack fix X-Git-Tag: upstream/snapshot3+hdmi~15900 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c03ee7352f2f0ee393c7190ce0b758dd1217f57;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git mn10300: signal stack fix This fixes a signal stack handling problem in the MN10300 arch. When new threads are cloned with CLONE_VM, they don't inherit the alternate signal stack. They do share the signal flags, though. When deciding whether to use an alternate stack, the arch code needs to check to make sure the task struct contains a valid alternate stack. This patch fixes the MN10300 arch by using the sas_ss_flags() test provided by sched.h rather than the on_sig_stack() test which is insufficient by itself. Signed-off-by: Mark Salter Signed-off-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c index a21f43b..717db14 100644 --- a/arch/mn10300/kernel/signal.c +++ b/arch/mn10300/kernel/signal.c @@ -264,7 +264,7 @@ static inline void __user *get_sigframe(struct k_sigaction *ka, /* this is the X/Open sanctioned signal stack switching. */ if (ka->sa.sa_flags & SA_ONSTACK) { - if (!on_sig_stack(sp)) + if (sas_ss_flags(sp) == 0) sp = current->sas_ss_sp + current->sas_ss_size; }