mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
rcutorture: Fix rcu_torture_fwd_cb_cr() data race
[ Upstream commit 6040072f4774a575fa67b912efe7722874be337b ] On powerpc systems, spinlock acquisition does not order prior stores against later loads. This means that this statement: rfcp->rfc_next = NULL; Can be reordered to follow this statement: WRITE_ONCE(*rfcpp, rfcp); Which is then a data race with rcu_torture_fwd_prog_cr(), specifically, this statement: rfcpn = READ_ONCE(rfcp->rfc_next) KCSAN located this data race, which represents a real failure on powerpc. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Acked-by: Marco Elver <elver@google.com> Cc: Andrey Konovalov <andreyknvl@gmail.com> Cc: <kasan-dev@googlegroups.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
95cf80c934
commit
7adbf9b5c8
1 changed files with 1 additions and 1 deletions
|
@ -2592,7 +2592,7 @@ static void rcu_torture_fwd_cb_cr(struct rcu_head *rhp)
|
||||||
spin_lock_irqsave(&rfp->rcu_fwd_lock, flags);
|
spin_lock_irqsave(&rfp->rcu_fwd_lock, flags);
|
||||||
rfcpp = rfp->rcu_fwd_cb_tail;
|
rfcpp = rfp->rcu_fwd_cb_tail;
|
||||||
rfp->rcu_fwd_cb_tail = &rfcp->rfc_next;
|
rfp->rcu_fwd_cb_tail = &rfcp->rfc_next;
|
||||||
WRITE_ONCE(*rfcpp, rfcp);
|
smp_store_release(rfcpp, rfcp);
|
||||||
WRITE_ONCE(rfp->n_launders_cb, rfp->n_launders_cb + 1);
|
WRITE_ONCE(rfp->n_launders_cb, rfp->n_launders_cb + 1);
|
||||||
i = ((jiffies - rfp->rcu_fwd_startat) / (HZ / FWD_CBS_HIST_DIV));
|
i = ((jiffies - rfp->rcu_fwd_startat) / (HZ / FWD_CBS_HIST_DIV));
|
||||||
if (i >= ARRAY_SIZE(rfp->n_launders_hist))
|
if (i >= ARRAY_SIZE(rfp->n_launders_hist))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue