Re: [BUG] Race condition with it_real_fn in kernel/itimer.c

Oleg Nesterov
2005-06-15T17:30:34Z

Steven Rostedt wrote:
>
> + try_again:
> spin_lock_irq(&tsk->sighand->siglock);
> interval = tsk->signal->it_real_incr;
> val = it_real_value(tsk->signal);
> - if (val)
> + if (val) {
> + spin_unlock_irq(&tsk->sighand->siglock);
> del_timer_sync(&tsk->signal->real_timer);
> + goto try_again;

I think we don't need del_timer_sync() at all, just del_timer().

Because it_real_value() returns 0 when timer is not pending. And
in this case the timer may still be running, but do_setitimer()
doesn't call del_timer_sync().

Oleg.