]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
proc-fix-races-against-execve-of-proc-pid-fd-fix
authorVasiliy Kulikov <segooon@gmail.com>
Wed, 5 Oct 2011 00:43:53 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 6 Oct 2011 06:00:07 +0000 (17:00 +1100)
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 <segoon@openwall.com>
Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/base.c

index 987bc663d668831213ab473fa163c6bec1a7f2c1..d4f4913f00db62ce8f52524cf599ad48b15c0eff 100644 (file)
@@ -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;
 }