• Oleg Nesterov's avatar
    [PATCH] Fix show_trace() in irq context with CONFIG_4KSTACKS · c2634010
    Oleg Nesterov authored
    - valid_stack_ptr() erroneously assumes that stack always lives in
      task_struct->thread_info.
    
    - the main loop in show_trace() does not recalc ebp after stack
      switching.  With CONFIG_FRAME_POINTER every call to print_context_stack()
      will produce the same output.
    
    With this patch, show_trace() does not use task argument in the main loop. 
    Instead, it converts stack to thread_info* context, and passes it to
    print_context_stack() and (implicitly) to valid_stack_ptr().
    
    valid_stack_ptr() now does bounds checking against proper context.
    Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    c2634010
traps.c 26.7 KB