[PATCH] fix task_struct leak in ptrace

From: Christoph Hellwig
Date: Fri Nov 11 2005 - 03:28:42 EST


When ptrace_attach fails we need to drop the task_struct reference.


Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: linux-2.6/kernel/ptrace.c
===================================================================
--- linux-2.6.orig/kernel/ptrace.c 2005-11-11 00:10:29.000000000 +0100
+++ linux-2.6/kernel/ptrace.c 2005-11-11 00:11:21.000000000 +0100
@@ -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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/