Skip to content

Commit 24bb9ec

Browse files
committed
rcu: Fix exp_funnel_lock()/rcu_exp_wait_wake() datarace
The rcu_node structure's ->exp_seq_rq field is accessed locklessly, so updates must use WRITE_ONCE(). This commit therefore adds the needed WRITE_ONCE() invocation where it was missed. This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 82dd841 commit 24bb9ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/tree_exp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ static void rcu_exp_wait_wake(unsigned long s)
589589
spin_lock(&rnp->exp_lock);
590590
/* Recheck, avoid hang in case someone just arrived. */
591591
if (ULONG_CMP_LT(rnp->exp_seq_rq, s))
592-
rnp->exp_seq_rq = s;
592+
WRITE_ONCE(rnp->exp_seq_rq, s);
593593
spin_unlock(&rnp->exp_lock);
594594
}
595595
smp_mb(); /* All above changes before wakeup. */

0 commit comments

Comments
 (0)