Skip to contentSkip to conversation

fix task_struct leak in ptrace

PATCH New Christoph Hellwig 1 participant 1 message Nov 11, 2005 ptrace support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix task_struct leak in ptrace

When ptrace_attach fails we need to drop the task_struct reference.

kernel/ptrace.c +1 -1
Index: linux-2.6/kernel/ptrace.c
===================================================================
@@ -485,7 +485,7 @@
 
 	if (request == PTRACE_ATTACH) {
 		ret = ptrace_attach(child);
-		goto out;
+		goto out_put_task_struct;
 	}
 
 	ret = ptrace_check_attach(child, request == PTRACE_KILL);