OSDN Git Service

rcutorture: Fix rcu_torture_one_read()/rcu_torture_writer() data race
authorPaul E. McKenney <paulmck@kernel.org>
Sat, 21 Dec 2019 18:41:48 +0000 (10:41 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 21 Feb 2020 00:03:31 +0000 (16:03 -0800)
commit202489101f2e6cee3f6dffc087a4abd5fdfcebda
treecedef3be1fb42eb8f0a08d7e1652ec998bd9a4ed
parentbeabc806f5aaa158fc90a939215e8b44ee9d7acc
rcutorture: Fix rcu_torture_one_read()/rcu_torture_writer() data race

The ->rtort_pipe_count field in the rcu_torture structure checks for
too-short grace periods, and is therefore read by rcutorture's readers
while being updated by rcutorture's writers.  This commit therefore
adds the needed READ_ONCE() and WRITE_ONCE() invocations.

This data race was reported by KCSAN.  Not appropriate for backporting
due to failure being unlikely and due to this being rcutorture.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/rcutorture.c