From d09042da7284a86ffbdd18695f517a71514ed598 Mon Sep 17 00:00:00 2001 From: Laurent MEYER Date: Fri, 23 Jun 2006 02:05:36 -0700 Subject: [PATCH] fix incorrect SA_ONSTACK behaviour for 64-bit processes - When setting a sighandler using sigaction() call, if the flag SA_ONSTACK is set and no alternate stack is provided via sigaltstack(), the kernel still try to install the alternate stack. This behavior is the opposite of the one which is documented in Single Unix Specifications V3. - Also when setting an alternate stack using sigaltstack() with the flag SS_DISABLE, the kernel try to install the alternate stack on signal delivery. These two use cases makes the process crash at signal delivery. Signed-off-by: Laurent Meyer Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: David Howells Cc: Yoshinori Sato Cc: Geert Uytterhoeven Cc: Roman Zippel Cc: Kyle McMartin Cc: Paul Mundt Cc: Kazumoto Kojima Cc: Chris Zankel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/v850/kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/v850') diff --git a/arch/v850/kernel/signal.c b/arch/v850/kernel/signal.c index 633e4e1b825f..17c2d4359b04 100644 --- a/arch/v850/kernel/signal.c +++ b/arch/v850/kernel/signal.c @@ -274,7 +274,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) /* Default to using normal stack */ unsigned long sp = regs->gpr[GPR_SP]; - if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) + if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp)) sp = current->sas_ss_sp + current->sas_ss_size; return (void *)((sp - frame_size) & -8UL); -- cgit v1.2.3