From 7c1b90a1e964f72bde88511e5cfe1c04318ff3d1 Mon Sep 17 00:00:00 2001 From: Martin Koegler Date: Wed, 28 May 2008 20:50:07 +0200 Subject: avr32: Fix sigaltstack behaviour A signal handler should be able to change the signal stack used for the next signal by altering the ucontext_t passed as a parameter to the handler. This does not currently work on avr32 since it doesn't update the in-kernel signal context from the ucontext_t upon signal handler return. Fix it by adding a call to do_sigaltstack() from sys_rt_sigreturn(), bringing it in line with most other architectures. Signed-off-by: Martin Koegler [haavard.skinnemoen@atmel.com: changed patch description] Signed-off-by: Haavard Skinnemoen --- arch/avr32/kernel/signal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c index 5616a00c10b..c5b11f9067f 100644 --- a/arch/avr32/kernel/signal.c +++ b/arch/avr32/kernel/signal.c @@ -93,6 +93,9 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) goto badframe; + if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT) + goto badframe; + pr_debug("Context restored: pc = %08lx, lr = %08lx, sp = %08lx\n", regs->pc, regs->lr, regs->sp); -- cgit v1.2.3