Skip to content

Commit

Permalink
[PATCH] fix task_struct leak in ptrace
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Linus Torvalds committed Nov 14, 2005
1 parent ab76720 commit 005f18d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 005f18d

Please sign in to comment.