Commit 3d9dd6d2 authored by Linus Torvalds's avatar Linus Torvalds

Fix del_timer_sync() SMP memory ordering (from Tejun Huh <tejun@aratech.co.kr>)

From Tejun's posting:
>
> 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.
parent 3581ab9b
...@@ -338,6 +338,7 @@ int del_timer_sync(struct timer_list *timer) ...@@ -338,6 +338,7 @@ int del_timer_sync(struct timer_list *timer)
break; break;
} }
} }
smp_rmb();
if (timer_pending(timer)) if (timer_pending(timer))
goto del_again; goto del_again;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment