]> git.baikalelectronics.ru Git - kernel.git/commit
Fix ptrace_attach()/ptrace_traceme()/de_thread() race
authorLinus Torvalds <torvalds@g5.osdl.org>
Sun, 7 May 2006 17:49:33 +0000 (10:49 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 7 May 2006 17:49:33 +0000 (10:49 -0700)
commit9de5ff715c4a47d89cf8a081e9a1ce629a3e9538
tree5f35453cff7acd5df5622a108381bbd011a383c5
parent06573c3e142293cf9fbe22e93ef22f88e6ca9d43
Fix ptrace_attach()/ptrace_traceme()/de_thread() race

This holds the task lock (and, for ptrace_attach, the tasklist_lock)
over the actual attach event, which closes a race between attacking to a
thread that is either doing a PTRACE_TRACEME or getting de-threaded.

Thanks to Oleg Nesterov for reminding me about this, and Chris Wright
for noticing a lost return value in my first version.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/ptrace.c