From: Vasiliy Kulikov Date: Wed, 5 Oct 2011 00:43:53 +0000 (+1100) Subject: proc-fix-races-against-execve-of-proc-pid-fd-fix X-Git-Tag: next-20111005~2^2~40 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=65971244302339de1c122e4606144021ab607276;p=karo-tx-linux.git 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 --- 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; }