|
@@ -85,9 +85,19 @@ check_stack(unsigned long ip, unsigned long *stack)
|
|
|
if (!object_is_on_stack(stack))
|
|
|
return;
|
|
|
|
|
|
+ /* Can't do this from NMI context (can cause deadlocks) */
|
|
|
+ if (in_nmi())
|
|
|
+ return;
|
|
|
+
|
|
|
local_irq_save(flags);
|
|
|
arch_spin_lock(&max_stack_lock);
|
|
|
|
|
|
+ /*
|
|
|
+ * RCU may not be watching, make it see us.
|
|
|
+ * The stack trace code uses rcu_sched.
|
|
|
+ */
|
|
|
+ rcu_irq_enter();
|
|
|
+
|
|
|
/* In case another CPU set the tracer_frame on us */
|
|
|
if (unlikely(!frame_size))
|
|
|
this_size -= tracer_frame;
|
|
@@ -169,6 +179,7 @@ check_stack(unsigned long ip, unsigned long *stack)
|
|
|
}
|
|
|
|
|
|
out:
|
|
|
+ rcu_irq_exit();
|
|
|
arch_spin_unlock(&max_stack_lock);
|
|
|
local_irq_restore(flags);
|
|
|
}
|