alistair23-linux/kernel/rcu
Dennis Krein eb4c238227 srcu: Lock srcu_data structure in srcu_gp_start()
The srcu_gp_start() function is called with the srcu_struct structure's
->lock held, but not with the srcu_data structure's ->lock.  This is
problematic because this function accesses and updates the srcu_data
structure's ->srcu_cblist, which is protected by that lock.  Failing to
hold this lock can result in corruption of the SRCU callback lists,
which in turn can result in arbitrarily bad results.

This commit therefore makes srcu_gp_start() acquire the srcu_data
structure's ->lock across the calls to rcu_segcblist_advance() and
rcu_segcblist_accelerate(), thus preventing this corruption.

Reported-by: Bart Van Assche <bvanassche@acm.org>
Reported-by: Christoph Hellwig <hch@infradead.org>
Reported-by: Sebastian Kuzminsky <seb.kuzminsky@gmail.com>
Signed-off-by: Dennis Krein <Dennis.Krein@netapp.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Tested-by: Dennis Krein <Dennis.Krein@netapp.com>
Cc: <stable@vger.kernel.org> # 4.16.x
2018-11-27 09:23:57 -08:00
..
Kconfig rcu: Clean up flavor-related definitions and comments in Kconfig 2018-08-30 16:03:32 -07:00
Kconfig.debug
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rcu.h Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
rcu_segcblist.c rcu: Simplify and inline cpu_needs_another_gp() 2018-05-15 10:30:59 -07:00
rcu_segcblist.h rcu: Simplify and inline cpu_needs_another_gp() 2018-05-15 10:30:59 -07:00
rcuperf.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
rcutorture.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
srcutiny.c srcu: Make early-boot call_srcu() reuse workqueue lists 2018-08-30 16:10:49 -07:00
srcutree.c srcu: Lock srcu_data structure in srcu_gp_start() 2018-11-27 09:23:57 -08:00
sync.c doc: Fix various RCU docbook comment-header problems 2017-10-19 22:26:11 -04:00
tiny.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
tree.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
tree.h rcu: Convert rcu_state.ofl_lock to raw_spinlock_t 2018-08-30 16:03:54 -07:00
tree_exp.h rcu: Switch ->dynticks to rcu_data structure, remove rcu_dynticks 2018-08-30 16:03:52 -07:00
tree_plugin.h rcu: Switch ->dynticks to rcu_data structure, remove rcu_dynticks 2018-08-30 16:03:52 -07:00
update.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00