Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5cdfd174 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

srcu: Check for in-flight callbacks in _cleanup_srcu_struct()



If someone fails to drain the corresponding SRCU callbacks (for
example, by failing to invoke srcu_barrier()) before invoking either
cleanup_srcu_struct() or cleanup_srcu_struct_quiesced(), the resulting
diagnostic is an ambiguous use-after-free diagnostic, and even then
only if you are running something like KASAN.  This commit therefore
improves SRCU diagnostics by adding checks for in-flight callbacks at
_cleanup_srcu_struct() time.

Note that these diagnostics can still be defeated, for example, by
invoking call_srcu() concurrently with cleanup_srcu_struct().  Which is
a really bad idea, but sometimes all too easy to do.  But even then,
these diagnostics have at least some probability of catching the problem.

Reported-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reported-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
Tested-by: default avatarBart Van Assche <bvanassche@acm.org>
parent 9e98c678
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment