sys_timer_delete() and itimer_delete() check "timer->it_process != NULL", this
looks completely bogus. ->it_process == NULL means that this timer is already
under destruction or it is not fully initialized, this must not happen.
sys_timer_delete: the timer is locked, and lock_timer() can't succeed
if ->it_process == NULL.
itimer_delete: it is called by exit_itimers() when there are no other
threads which can play with signal_struct->posix_timers.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- 25/kernel/posix-timers.c~3_TDEL_NO_CHECK 2008-04-24 16:52:11.000000000 +0400
+++ 25/kernel/posix-timers.c 2008-05-03 19:55:27.000000000 +0400
@@ -855,11 +855,10 @@ retry_delete:
* This keeps any tasks waiting on the spin lock from thinking
* they got something (see the lock code above).
*/
- if (timer->it_process) {
- if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
- put_task_struct(timer->it_process);
- timer->it_process = NULL;
- }
+ if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
+ put_task_struct(timer->it_process);
+ timer->it_process = NULL;
+
unlock_timer(timer, flags);
release_posix_timer(timer, IT_ID_SET);
return 0;
@@ -884,11 +883,10 @@ retry_delete:
* This keeps any tasks waiting on the spin lock from thinking
* they got something (see the lock code above).
*/
- if (timer->it_process) {
- if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
- put_task_struct(timer->it_process);
- timer->it_process = NULL;
- }
+ if (timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
+ put_task_struct(timer->it_process);
+ timer->it_process = NULL;
+
unlock_timer(timer, flags);
release_posix_timer(timer, IT_ID_SET);
}
--Signed-off-by: Roland McGrath <roland@redhat.com> --
| Artem Bityutskiy | [PATCH take 2 06/28] UBIFS: add journal replay |
| Greg Kroah-Hartman | [PATCH 009/196] Chinese: add translation of sparse.txt |
| Gregory Haskins | [PATCH 0/2] [RFC] RT: Optionally allow IRQF_NODELAY on serial console |
| Andrew Morton | Re: [RFC/PATCH] Documentation of kernel messages |
git: | |
| ir0s | Local branch ahead of tracked remote branch but git push claims everything up-to-d... |
| Matthieu Moy | git push to a non-bare repository |
| Rocco Rutte | mercurial to git |
| Bill Lear | Git rescue mission |
| Sunnz | radeon driver in -current Xorg 7.2? |
| Neko | reliable, dd over simple ip network |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Siju George | This is what Linus Torvalds calls openBSD crowd |
| Inaky Perez-Gonzalez | [PATCH 00/39] merge request for WiMAX kernel stack and i2400m driver |
| Linus Torvalds | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Evgeniy Polyakov | Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison overwritten |
