[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0706050839350.23304@alien.or.mcafeemobile.com>
Date: Tue, 5 Jun 2007 08:52:07 -0700 (PDT)
From: Davide Libenzi <davidel@...ilserver.org>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>
cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Kernel list <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH/RFC] signal races/bugs, losing TIF_SIGPENDING and other
woes
On Tue, 5 Jun 2007, Benjamin Herrenschmidt wrote:
> We don't actually call recalc_sigpending_tsk() when sending a signal to
> some other task, we just set the flag... so I need to recheck my theory
> here about recalc_sigpending_tsk being called for somebody else...
> Something is doing it somewhere it seems (we are losing the
> TIF_SIGPENDING bit) but I'll need to cook up a repro case to track
> exactly where.
>>
> - I still think there's something wrong with dequeue_signal() being
> potentially called with a task different than current by signalfd, since
> __dequeue_signal() (among others) mucks around with current regardless.
> I'd love to just make signalfd's read() only do anything if current ==
> ctx->tsk and remove the task argument from dequeue_signal... that would
> fix it nicely too no ?
I agree with Ben that recalc_sigpending_tsk() on tsk!=current is a bad
idea. I think, since dequeue_signal() is called from user context, we
could just have only recalc_sigpending(), that acts on current, and then
inside dequeue_signal we have:
if (tsk == current)
recalc_sigpending();
What can happen, is that a task may notice TIF_SIGPENDING and not find a
signal once it calls dequeue_signal(), but this is fine as far as signalfd
goes. This should be OK in general, no?
- Davide
-
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