• Paolo 'Blaisorblade' Giarrusso's avatar
    [PATCH] uml: fix random segfaults at bootup · 51694948
    Paolo 'Blaisorblade' Giarrusso authored
    Don't use printk() where "current_thread_info()" is crap.
    
    Until when we switch to running on init_stack, current_thread_info() evaluates
    to crap. Printk uses "current" at times (in detail, &current is evaluated with
    CONFIG_DEBUG_SPINLOCK to check the spinlock owner task).
    
    And this leads to random segmentation faults.
    
    Exactly, what happens is that &current = *(current_thread_info()), i.e. round
    down $esp and dereference the value. I.e. access the stack below $esp, which
    causes SIGSEGV on a VM_GROWSDOWN vma (see arch/i386/mm/fault.c).
    Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    51694948
start_up.c 13 KB