linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Race condition in del_timer_sync (2.5)
@ 2003-09-02  2:59 Tejun Huh
  2003-09-02  6:33 ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Tejun Huh @ 2003-09-02  2:59 UTC (permalink / raw)
  To: linux-kernel

 Hello,

 This patch fixes a race between del_timer_sync and recursive timers.
Current implementation allows the value of timer->base that is used
for timer_pending test to be fetched before finishing running_timer
test, so it's possible for a recursive time to be pending after
del_timer_sync.  Adding smp_rmb before timer_pending removes the race.

 The patch is against the latest 2.5 bk tree.  Please point out if I
got something wrong.  TIA.

-- 
tejun

diff -Nru a/kernel/timer.c b/kernel/timer.c
--- a/kernel/timer.c	Tue Sep  2 11:56:58 2003
+++ b/kernel/timer.c	Tue Sep  2 11:56:58 2003
@@ -338,6 +338,7 @@
 			break;
 		}
 	}
+	smp_rmb();
 	if (timer_pending(timer))
 		goto del_again;
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-02  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-02  2:59 [PATCH] Race condition in del_timer_sync (2.5) Tejun Huh
2003-09-02  6:33 ` Ingo Molnar
2003-09-02  7:54   ` Tejun Huh
2003-09-02  7:55     ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).