]> err.no Git - linux-2.6/commit
posix timers: release_posix_timer: kill the bogus put_task_struct(->it_process);
authorOleg Nesterov <oleg@tv-sign.ru>
Fri, 25 Jul 2008 08:47:27 +0000 (01:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Jul 2008 17:53:38 +0000 (10:53 -0700)
commit96347e7759e2e433c427defa0fa1adfc8cce6226
tree0b78316c887be06b269288d7306d6cac038fe644
parent4b7a1304267bff68260ae861784b27130e805be3
posix timers: release_posix_timer: kill the bogus put_task_struct(->it_process);

release_posix_timer() can't be called with ->it_process != NULL.  Once
sys_timer_create() sets ->it_process it must not call
release_posix_timer(), otherwise we can race with another thread doing
sys_timer_delete(), this timer is visible to idr_find() and unlocked.

The same is true for two other callers (actually, for any possible
caller), sys_timer_delete() and itimer_delete().  They must clear
->it_process before unlock_timer() + release_posix_timer().

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Roland McGrath <roland@redhat.com>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/posix-timers.c