lkml.org 
[lkml]   [2003]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Race condition in del_timer_sync (2.5)
 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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.278 / U:2.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site