srcu: Tighten cleanup_srcu_struct() GP checks
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 12 Jan 2022 17:52:44 +0000 (09:52 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 11 Apr 2022 22:31:01 +0000 (15:31 -0700)
commit8ed00760203d8018bee042fbfe8e076579be2c2b
treed436cccfe36000d8561e63aaabd378920da7f0c3
parent3123109284176b1532874591f7c81f3837bbdc17
srcu: Tighten cleanup_srcu_struct() GP checks

Currently, cleanup_srcu_struct() checks for a grace period in progress,
but it does not check for a grace period that has not yet started but
which might start at any time.  Such a situation could result in a
use-after-free bug, so this commit adds a check for a grace period that
is needed but not yet started to cleanup_srcu_struct().

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/srcutree.c