Re: [PATCH 4/4] posix-timers: turn it_signal into it_valid flag

From: Oleg Nesterov
Date: Tue Sep 06 2011 - 14:53:17 EST


On 09/06, Thomas Gleixner wrote:
>
> On Tue, 6 Sep 2011, Eric Dumazet wrote:
>
> > Le mardi 06 septembre 2011 à 16:51 +0200, Oleg Nesterov a écrit :
> > > On 09/05, Andi Kleen wrote:
> > > >
> > > > > I forgot everything I knew about ->it_requeue_pending logic, but it
> > > > > seems to me that do_schedule_next_timer()->lock_timer() can find and
> > > > > lock successfully the wrong timer. Another thread can do timer_delete()
> > > > > and then re-create the timer with the same id.
> > > >
> > > > Do you mean after my patches or even before?
> > >
> > > Ah, sorry for confusion.
> > >
> > > Before. And after. IOW, I think this has nothing to do with your patches.
> > >
> >
> > Hmm, you mean following patch is needed ?
> >
> > Before release of timer id to idr pool, we should make sure
> > do_schedule_next_timer() wont be called, or it could find another timer
> > reusing the just released id.
>
> I don't see how that makes it sure. If the signal is queued, then it
> stays queued and the put_pid() has no effect either.

Yes.

But "If the signal is queued" is simple, in this case we could, say,
do "tmr->sigq->info.si_tid = -1" to ensure lock_timer()->find_idr()
can't succeed after dequeue_signal().

The problem is, it can be already dequeued.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/