]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] uml: fix random segfaults at bootup
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Thu, 29 Dec 2005 16:39:51 +0000 (17:39 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 29 Dec 2005 17:48:15 +0000 (09:48 -0800)
commit20afecfebd269ceffc64d030dbe3b6f1506fcbf6
treeb7fef00010e2ad97a9fdab4f683c1516948749cb
parentec816948a98709fa32794a0e751a115ecf89e8c3
[PATCH] uml: fix random segfaults at bootup

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: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/os-Linux/start_up.c