diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-07-25 04:47:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:38 -0400 |
commit | 96347e7759e2e433c427defa0fa1adfc8cce6226 (patch) | |
tree | 0b78316c887be06b269288d7306d6cac038fe644 /kernel/posix-timers.c | |
parent | 4b7a1304267bff68260ae861784b27130e805be3 (diff) |
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>
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r-- | kernel/posix-timers.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 17f53266fb6..9a21681aa80 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -449,9 +449,6 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set) | |||
449 | spin_unlock_irqrestore(&idr_lock, flags); | 449 | spin_unlock_irqrestore(&idr_lock, flags); |
450 | } | 450 | } |
451 | sigqueue_free(tmr->sigq); | 451 | sigqueue_free(tmr->sigq); |
452 | if (unlikely(tmr->it_process) && | ||
453 | tmr->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID)) | ||
454 | put_task_struct(tmr->it_process); | ||
455 | kmem_cache_free(posix_timers_cache, tmr); | 452 | kmem_cache_free(posix_timers_cache, tmr); |
456 | } | 453 | } |
457 | 454 | ||