• Russell King's avatar
    ARM: fix /proc/$PID/stack on SMP · d5996b2f
    Russell King authored
    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: default avatarRabin Vincent <rabin@rab.in>
    Tested-by: default avatarRabin Vincent <rabin@rab.in>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    d5996b2f
stacktrace.c 3.27 KB