From: Christoph Hellwig Date: Mon, 14 Nov 2005 00:06:33 +0000 (-0800) Subject: [PATCH] fix task_struct leak in ptrace X-Git-Tag: v2.6.15-rc2~201 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=005f18dfd0ed86c39716277b61dfb4bd2af91059;p=linux-2.6 [PATCH] fix task_struct leak in ptrace When ptrace_attach fails we need to drop the task_struct reference. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/ptrace.c b/kernel/ptrace.c index b88d4186cd..17ee7e5a34 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -470,7 +470,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data) if (request == PTRACE_ATTACH) { ret = ptrace_attach(child); - goto out; + goto out_put_task_struct; } ret = ptrace_check_attach(child, request == PTRACE_KILL);