From: Christoph Hellwig Date: Mon, 14 Nov 2005 00:06:33 +0000 (-0800) Subject: [PATCH] fix task_struct leak in ptrace X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=005f18dfd0ed86c39716277b61dfb4bd2af91059;p=openwrt%2Fstaging%2Fblogic.git [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 b88d4186cd7a..17ee7e5a3451 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);