]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PATCH] check_process_timers: fix possible lockup
authorOleg Nesterov <oleg@tv-sign.ru>
Thu, 15 Jun 2006 16:11:15 +0000 (20:11 +0400)
committerChris Wright <chrisw@sous-sol.org>
Tue, 20 Jun 2006 08:54:52 +0000 (01:54 -0700)
commit5705264e83bd9f8918895d8f5ddddbdeb062c719
tree11ba63a74fb0907ee686c1c30cd58d95b0f4e555
parentad325de56677938d8c58b376e1d7813b50527263
[PATCH] check_process_timers: fix possible lockup

If the local timer interrupt happens just after do_exit() sets PF_EXITING
(and before it clears ->it_xxx_expires) run_posix_cpu_timers() will call
check_process_timers() with tasklist_lock + ->siglock held and

check_process_timers:

t = tsk;
do {
....

do {
t = next_thread(t);
} while (unlikely(t->flags & PF_EXITING));
} while (t != tsk);

the outer loop will never stop.

Actually, the window is bigger.  Another process can attach the timer
after ->it_xxx_expires was cleared (see the next commit) and the 'if
(PF_EXITING)' check in arm_timer() is racy (see the one after that).

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
kernel/posix-cpu-timers.c