[<prev] [next>] [day] [month] [year] [list]
Message-ID: <158504139839.28353.5827172655436222384.tip-bot2@tip-bot2>
Date: Tue, 24 Mar 2020 09:16:38 -0000
From: "tip-bot2 for Paul E. McKenney" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Paul E. McKenney" <paulmck@...nel.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: core/rcu] srcu: Fix process_srcu()/srcu_batches_completed() datarace
The following commit has been merged into the core/rcu branch of tip:
Commit-ID: 39f91504a03a7a2abdb52205106942fa4a548d0d
Gitweb: https://git.kernel.org/tip/39f91504a03a7a2abdb52205106942fa4a548d0d
Author: Paul E. McKenney <paulmck@...nel.org>
AuthorDate: Sun, 22 Dec 2019 19:39:35 -08:00
Committer: Paul E. McKenney <paulmck@...nel.org>
CommitterDate: Thu, 20 Feb 2020 16:01:11 -08:00
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@...nel.org>
---
kernel/rcu/srcutree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 79848f7..119a373 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -1079,7 +1079,7 @@ EXPORT_SYMBOL_GPL(srcu_barrier);
*/
unsigned long srcu_batches_completed(struct srcu_struct *ssp)
{
- return ssp->srcu_idx;
+ return READ_ONCE(ssp->srcu_idx);
}
EXPORT_SYMBOL_GPL(srcu_batches_completed);
Powered by blists - more mailing lists