]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
rcu: Use READ_ONCE() for ->expmask in rcu_read_unlock_special()
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 4 Nov 2019 16:22:45 +0000 (08:22 -0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 17 Feb 2020 09:57:37 +0000 (10:57 +0100)
commit09b8b45070aa2a473c94184c7b859823af34387e
tree962c9631243a7a4af56b85248b28f41f9abab846
parent035d35a3b520c7c40c8c06685533dfa9a68e4f3c
rcu: Use READ_ONCE() for ->expmask in rcu_read_unlock_special()

BugLink: https://bugs.launchpad.net/bugs/1863588
commit c51f83c315c392d9776c33eb16a2fe1349d65c7f upstream.

The rcu_node structure's ->expmask field is updated only when holding the
->lock, but is also accessed locklessly.  This means that all ->expmask
updates must use WRITE_ONCE() and all reads carried out without holding
->lock must use READ_ONCE().  This commit therefore changes the lockless
->expmask read in rcu_read_unlock_special() to use READ_ONCE().

Reported-by: syzbot+99f4ddade3c22ab0cf23@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>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
kernel/rcu/tree_plugin.h