Commit b6852ac3 authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Yongqiang Liu
Browse files

rcu: Use *_ONCE() to protect lockless ->expmask accesses

mainline inclusion
from mainline-v5.6-rc1
commit 15c7c972
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I70RD3
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=15c7c972cd26d89a26788e609c53b5a465324a6c

--------------------------------

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: default avatar <syzbot+134336b86f728d6e55a0@syzkaller.appspotmail.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
Acked-by: default avatarMarco Elver <elver@google.com>

Conflicts:
	kernel/rcu/tree_exp.h

Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 98e12a77
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment