OSDN Git Service

srcu: Fix process_srcu()/srcu_batches_completed() datarace
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 23 Dec 2019 03:39:35 +0000 (19:39 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 21 Feb 2020 00:01:11 +0000 (16:01 -0800)
commit39f91504a03a7a2abdb52205106942fa4a548d0d
tree21148b0b3bd1e4c676a50e9414e5a919fd85350c
parent8c9e0cb32315835825ea1ad725a858a2d2ce4a8e
srcu: Fix process_srcu()/srcu_batches_completed() datarace

The srcu_struct structure's ->srcu_idx field is accessed locklessly,
so reads must use READ_ONCE().  This commit therefore adds the needed
READ_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 <paulmck@kernel.org>
kernel/rcu/srcutree.c