]> www.infradead.org Git - users/dwmw2/linux.git/commit
rcu: Use *_ONCE() to protect lockless ->expmask accesses
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 8 Oct 2019 01:53:18 +0000 (18:53 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:36:39 +0000 (04:36 -0800)
commitcf879a34898ce1f0b5aa6ff4a0a111f7e17d175f
tree004a4f8b247bc1946ea34af0bc86681913e4ffc2
parent8771583c597b7eb2e26c9625939c689dd8cbb743
rcu: Use *_ONCE() to protect lockless ->expmask accesses

commit 15c7c972cd26d89a26788e609c53b5a465324a6c upstream.

The rcu_node structure's ->expmask field is accessed locklessly when
starting a new expedited grace period and when reporting an expedited
RCU CPU stall warning.  This commit therefore handles the former by
taking a snapshot of ->expmask while the lock is held and the latter
by applying READ_ONCE() to lockless reads and WRITE_ONCE() to the
corresponding updates.

Link: https://lore.kernel.org/lkml/CANpmjNNmSOagbTpffHr4=Yedckx9Rm2NuGqC9UqE+AOz5f1-ZQ@mail.gmail.com
Reported-by: syzbot+134336b86f728d6e55a0@syzkaller.appspotmail.com
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Marco Elver <elver@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/rcu/tree_exp.h