]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PATCH] 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)
committerChris Wright <chrisw@sous-sol.org>
Sat, 20 May 2006 22:00:33 +0000 (15:00 -0700)
commit65b01b76265047aa59d6eb741ec61468c8867256
tree9f1503d3b24bd7ce34cad2eaa58c42d2dbd664bb
parent1d4532d4d7351b552220d9ef0a1901a33f00ee5f
[PATCH] 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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/ptrace.c