From fa3f2b4da0e3812dab1a035e4f7b5b83e6072157 Mon Sep 17 00:00:00 2001 From: Vasiliy Kulikov Date: Wed, 5 Oct 2011 11:43:53 +1100 Subject: [PATCH] proc-fix-races-against-execve-of-proc-pid-fd-fix In the patch "proc: fix races against execve() of /proc/PID/fd**" proc_pid_fd_link_getattr() leaked task_struct if ptrace check fails. Signed-off-by: Vasiliy Kulikov Reported-by: Cyrill Gorcunov Signed-off-by: Andrew Morton --- fs/proc/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 987bc663d668..d4f4913f00db 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1668,9 +1668,9 @@ static int proc_pid_fd_link_getattr(struct vfsmount *mnt, struct dentry *dentry, generic_fillattr(inode, stat); unlock_trace(task); - put_task_struct(task); rc = 0; out_task: + put_task_struct(task); return rc; } -- 2.39.5