]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: fix /proc/$PID/stack on SMP
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 15 Jan 2011 09:27:04 +0000 (09:27 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 15 Jan 2011 09:27:04 +0000 (09:27 +0000)
commitfc80a3cc104e973c5caf35cd98baa8bde95b19c8
treec4d50df299e9c0e07e8ae66406489c01f4c9d6a9
parentfe55c1c9222b5eedbd7e65c9ab936cb66cd352e8
ARM: fix /proc/$PID/stack on SMP

Rabin Vincent reports:
| On SMP, this BUG() in save_stack_trace_tsk() can be easily triggered
| from user space by reading /proc/$PID/stack, where $PID is any pid but
| the current process:
|
| if (tsk != current) {
| #ifdef CONFIG_SMP
| /*
|  * What guarantees do we have here that 'tsk'
|  * is not running on another CPU?
|  */
| BUG();
| #else

Fix this by replacing the BUG() with an entry to terminate the stack
trace, returning an empty trace - I'd rather not expose the dwarf
unwinder to a volatile stack of a running thread.

Reported-by: Rabin Vincent <rabin@rab.in>
Tested-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/stacktrace.c