]> git.hungrycats.org Git - linux/commit
[PATCH] show_task() is not SMP safe
authorAndrew Morton <akpm@osdl.org>
Thu, 19 Feb 2004 00:40:04 +0000 (16:40 -0800)
committerDavid S. Miller <davem@nuts.davemloft.net>
Thu, 19 Feb 2004 00:40:04 +0000 (16:40 -0800)
commit70b1932013a6380f35d4d84d1b39e64616b15c1d
treeea85059dbb3c4b4fc59e94c5dd9d87fc4a01ffd9
parent87f095b8e4710137fd086ed28c3b2b086dd4437e
[PATCH] show_task() is not SMP safe

From: Arnd Bergmann <arnd@arndb.de>

Christian Bornträger noticed that the kernel can crash after <SysRq>-T.  It
appears that the show_task function gets called for all tasks, which does
not work if one of the tasks is running in a system call on another CPU.
In that case the result of thread_saved_pc and show_stack is undefined and
likely to cause a crash.

For tasks running in user space on other CPUs, show_task() is probably
harmless, but I'm not sure if that's true on all architectures.

The patch below is still racy for tasks that are about to sleep, but it
demonstrates the problem.
kernel/sched.c