diff options
author | Laurent MEYER <meyerlau@fr.ibm.com> | 2006-04-06 08:45:19 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-04-17 13:16:04 -0700 |
commit | bb532cb98cd10b4bbb14c0ce253fbaed16a761c4 (patch) | |
tree | a6fe9807e749c2dd09f5975aef8ca7d64e0d73b3 | |
parent | bce29a817a973634535f92aa217152177e82c3bd (diff) |
[PATCH] powerpc: 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.
This fixes it.
Signed-off-by: Laurent Meyer <meyerlau@fr.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 4324f8a8ba2..096dfdc7890 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c @@ -213,7 +213,7 @@ static inline void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs /* Default to using normal stack */ newsp = regs->gpr[1]; - if (ka->sa.sa_flags & SA_ONSTACK) { + if ((ka->sa.sa_flags & SA_ONSTACK) && current->sas_ss_size) { if (! on_sig_stack(regs->gpr[1])) newsp = (current->sas_ss_sp + current->sas_ss_size); } |