History

tracing: Do not allow stack_tracer to record stack in NMI

The code in stack tracer should not be executed within an NMI as it grabs spinlocks and stack tracing an NMI gives the possibility of causing a deadlock. Although this is safe on x86_64, because it does not perform stack traces when the task struct stack is not in use (interrupts and NMIs), it may be an issue for NMIs on i386 and other archs that use the same stack as the NMI.

Steven Rostedt (Red Hat) committed 11 years ago

Commit 1904be11 parent a2d76291 file · +4 −0Browse files

Unified · Split

kernel/trace/trace_stack.c+4−0
@@ -85,6 +85,10 @@ check_stack(unsigned long ip, unsigned long *stack) · 84 unmodified lines
8585 if (!object_is_on_stack(stack))
8686 return;
8787
88+ /* Can't do this from NMI context (can cause deadlocks) */
89+ if (in_nmi())
90+ return;
91+
8892 local_irq_save(flags);
8993 arch_spin_lock(&max_stack_lock);
9094

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t