[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070621082509.GA88@tv-sign.ru>
Date: Thu, 21 Jun 2007 12:25:09 +0400
From: Oleg Nesterov <oleg@...sign.ru>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Davide Libenzi <davidel@...ilserver.org>,
Nicholas Miell <nmiell@...cast.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Fix signalfd interaction with thread-private signals
On 06/20, Linus Torvalds wrote:
>
> On Wed, 20 Jun 2007, Oleg Nesterov wrote:
> >
> > Also, suppose that some thread does
> >
> > for (;;)
> > signal(SIGSEGV, SIG_IGN);
> >
> > Now we have the same situation. do_sigaction() can steal SIGSEGV from
> > another thread.
>
> Actually, that shouldn't be possible.
>
> See "force_sig_info()". It does not allow blocking or ignoring forced
> signals. We will reset such a signal handler to SIG_DFL, and unlock it.
>
> So if you get a SIGSEGV while SIGSEGV's are blocked or ignored, the kernel
> *will* kill you. No questions asked.
Yes, and no.
Yes, force_sig() unblocks and un-ignores the signal. However, unlike group-wide
signals, thread-specific signals do not convert themselves to SIGKILL on delivery.
The target thread should dequeue SIGSEGV and then it calls do_group_exit().
Before it does so, another thread doing signal(SIGSEGV, SIG_IGN) can steal
the signal.
Of course, this is unlikely, and the target thread will take page fault again.
The same for signalfd.
Oleg.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists