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>
Wed, 2 Feb 2022 01:22:54 +0000 (17:22 -0800)
commita9068193025c576916202fa01f8647b12cb5f422
tree4cfde3aa190e376442d2954ef77c0dcad0b9cb5e
parentda123016ca8cb5697366c0b2dd55059b976e67e4
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