Skip to content
Commit eb4c2382 authored by Dennis Krein's avatar Dennis Krein Committed by Paul E. McKenney
Browse files

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: default avatarBart Van Assche <bvanassche@acm.org>
Reported-by: default avatarChristoph Hellwig <hch@infradead.org>
Reported-by: default avatarSebastian Kuzminsky <seb.kuzminsky@gmail.com>
Signed-off-by: default avatarDennis Krein <Dennis.Krein@netapp.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
Tested-by: default avatarDennis Krein <Dennis.Krein@netapp.com>
Cc: <stable@vger.kernel.org> # 4.16.x
parent 0607ba84
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment