Messages in this thread Patch in this message | | | Subject | [PATCH] Fix i386 signal handling of NODEFER, should not affect sa_mask (was: Re: Signal handling possibly wrong) | From | Steven Rostedt <> | Date | Tue, 09 Aug 2005 17:00:23 -0400 |
| |
On Tue, 2005-08-09 at 13:49 -0700, Chris Wright wrote:
> > SA_NODEFER > [XSI] If set and sig is caught, sig shall not be added to the thread's > signal mask on entry to the signal handler unless it is included in > sa_mask. Otherwise, sig shall always be added to the thread's signal > mask on entry to the signal handler. > > Brodo, is this what you mean? > > thanks, > -chris > -- > > Subject: [PATCH] fix SA_NODEFER signals to honor sa_mask > > When receiving SA_NODEFER signal, kernel was inapproriately not applying > the sa_mask. As pointed out by Brodo Stroesser. > > Signed-off-by: Chris Wright <chrisw@osdl.org> > --- > > diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c > --- a/arch/i386/kernel/signal.c > +++ b/arch/i386/kernel/signal.c > @@ -577,13 +577,12 @@ handle_signal(unsigned long sig, siginfo > else > ret = setup_frame(sig, ka, oldset, regs); > > - if (ret && !(ka->sa.sa_flags & SA_NODEFER)) { > - spin_lock_irq(¤t->sighand->siglock); > - sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); > + spin_lock_irq(¤t->sighand->siglock); > + sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); > + if (ret && !(ka->sa.sa_flags & SA_NODEFER)) > sigaddset(¤t->blocked,sig); > - recalc_sigpending(); > - spin_unlock_irq(¤t->sighand->siglock); > - } > + recalc_sigpending(); > + spin_unlock_irq(¤t->sighand->siglock); > > return ret; > }
Hmm, I think you want this patch. You still need to check the return of setting up the frames.
-- Steve
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
--- linux-2.6.13-rc6-git1/arch/i386/kernel/signal.c.orig 2005-08-09 16:54:36.000000000 -0400 +++ linux-2.6.13-rc6-git1/arch/i386/kernel/signal.c 2005-08-09 16:55:24.000000000 -0400 @@ -577,10 +577,11 @@ handle_signal(unsigned long sig, siginfo else ret = setup_frame(sig, ka, oldset, regs); - if (ret && !(ka->sa.sa_flags & SA_NODEFER)) { + if (ret) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); - sigaddset(¤t->blocked,sig); + if (!(ka->sa.sa_flags & SA_NODEFER)) + sigaddset(¤t->blocked,sig); recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); }
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |