]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rcu: Avoid rcu_print_detail_task_stall_rnp() segfault
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 10 Aug 2012 23:00:11 +0000 (16:00 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 4 Sep 2012 23:38:46 +0000 (16:38 -0700)
commit05b69cb14e15e843641ae16156b3fac8beb37668
tree7a655555b4e9d2e8911429fdbc5e23a2c40d46ff
parentc9c842b03e404c57760640e2b27de9e3177412fb
rcu: Avoid rcu_print_detail_task_stall_rnp() segfault

The rcu_print_detail_task_stall_rnp() function invokes
rcu_preempt_blocked_readers_cgp() to verify that there are some preempted
RCU readers blocking the current grace period outside of the protection
of the rcu_node structure's ->lock.  This means that the last blocked
reader might exit its RCU read-side critical section and remove itself
from the ->blkd_tasks list before the ->lock is acquired, resulting in
a segmentation fault when the subsequent code attempts to dereference
the now-NULL gp_tasks pointer.

This commit therefore moves the test under the lock.  This will not
have measurable effect on lock contention because this code is invoked
only when printing RCU CPU stall warnings, in other words, in the common
case, never.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcutree_plugin.h