diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-03-21 16:33:45 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 17:54:55 -0700 |
commit | 3785006ac3c8941feb63097c416de92114a6bc39 (patch) | |
tree | 07786cb16957a846eae8716bb311d5c4b9cb7736 /arch/xtensa | |
parent | ff6d21e7aafe3cf4b20697f67e656caa4daef40b (diff) | |
download | blackbird-op-linux-3785006ac3c8941feb63097c416de92114a6bc39.tar.gz blackbird-op-linux-3785006ac3c8941feb63097c416de92114a6bc39.zip |
xtensa: don't mask signals if we fail to setup signal stack
setup_frame() needs to return an indication of whether it succeeded or
failed in setting up the signal stack frame. If setup_frame() fails then
we must not modify current->blocked.
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/kernel/signal.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c index 24655e31d8fb..17ceab8e6479 100644 --- a/arch/xtensa/kernel/signal.c +++ b/arch/xtensa/kernel/signal.c @@ -336,8 +336,8 @@ gen_return_code(unsigned char *codemem) } -static void setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info, - sigset_t *set, struct pt_regs *regs) +static int setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info, + sigset_t *set, struct pt_regs *regs) { struct rt_sigframe *frame; int err = 0; @@ -422,10 +422,11 @@ static void setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info, current->comm, current->pid, signal, frame, regs->pc); #endif - return; + return 0; give_sigsegv: force_sigsegv(sig, current); + return -EFAULT; } /* @@ -534,7 +535,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) /* Whee! Actually deliver the signal. */ /* Set up the stack frame */ - setup_frame(signr, &ka, &info, oldset, regs); + ret = setup_frame(signr, &ka, &info, oldset, regs); + if (ret) + return ret; spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked, ¤t->blocked, &ka.sa.sa_mask); |