From: Linus Torvalds Date: Thu, 11 May 2006 18:08:49 +0000 (-0700) Subject: ptrace_attach: fix possible deadlock schenario with irqs X-Git-Tag: v2.6.17-rc4~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f358166a9405e4f1d8e50d8f415c26d95505b6de;p=pandora-kernel.git ptrace_attach: fix possible deadlock schenario with irqs Eric Biederman points out that we can't take the task_lock while holding tasklist_lock for writing, because another CPU that holds the task lock might take an interrupt that then tries to take tasklist_lock for writing. Which would be a nasty deadlock, with one CPU spinning forever in an interrupt handler (although admittedly you need to really work at triggering it ;) Since the ptrace_attach() code is special and very unusual, just make it be extra careful, and use trylock+repeat to avoid the possible deadlock. Cc: Oleg Nesterov Cc: Eric W. Biederman Cc: Roland McGrath Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed