lkml.org 
[lkml]   [2005]   [Nov]   [11]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 11 Nov 2005 09:28:43 +0100
FromChristoph Hellwig <>
Subject[PATCH] fix task_struct leak in ptrace
When ptrace_attach fails we need to drop the task_struct reference.


Signed-off-by: Christoph Hellwig <hch@lst.de>

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-11-11 09:31    [from the cache]
©2003-2008