linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* SMP: BUG() on cat /proc/$PID/stack
@ 2011-01-13 18:54 Rabin Vincent
  2011-01-13 23:11 ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Rabin Vincent @ 2011-01-13 18:54 UTC (permalink / raw)
  To: linux-arm-kernel

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

x86 appears to go ahead in this case, but has its stack walking code
check at every step that the stack pointer it's reading from is valid --
is this what is needed in the ARM unwind code to get rid of this BUG()?

Also, get_wchan() does similar stack walking but there it just checks
for task->state != TASK_RUNNING before.  Is that a sufficient check
there?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-19 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 18:54 SMP: BUG() on cat /proc/$PID/stack Rabin Vincent
2011-01-13 23:11 ` Russell King - ARM Linux
2011-01-15  4:56   ` Rabin Vincent
2011-01-19 17:04   ` Rabin Vincent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).