Browse Source

[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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Christoph Hellwig 19 years ago
parent
commit
005f18dfd0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      kernel/ptrace.c

+ 1 - 1
kernel/ptrace.c

@@ -470,7 +470,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
 
 
 	if (request == PTRACE_ATTACH) {
 	if (request == PTRACE_ATTACH) {
 		ret = ptrace_attach(child);
 		ret = ptrace_attach(child);
-		goto out;
+		goto out_put_task_struct;
 	}
 	}
 
 
 	ret = ptrace_check_attach(child, request == PTRACE_KILL);
 	ret = ptrace_check_attach(child, request == PTRACE_KILL);