]> git.hungrycats.org Git - linux/commitdiff
[PATCH] proc_pid_make_inode() fix
authorAlexander Viro <viro@math.psu.edu>
Fri, 15 Mar 2002 07:06:10 +0000 (23:06 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 15 Mar 2002 07:06:10 +0000 (23:06 -0800)
In case if proc_pid_make_inode() steps on exiting task we do
iput() and return NULL.  Unfortunately, in that case inode->i_ino
doesn't look like inumber of a per-process inode and we take the
wrong path in proc_delete_inode().  I.e. do dput(PDE(inode)).  Which
is left uninitialized...

We used to get out with that almost by accident - that code
worked only because we had zeroed out one field of union and that
guaranteed that another field would be NULL.  It worked, but broke
at the first occasion.

fs/proc/base.c

index fb250b29fbd5190051cd371af97980aa1125e7bc..a1b0f655ebf6eddfaf986912658bcc3bdbb88d94 100644 (file)
@@ -730,6 +730,7 @@ out:
        return inode;
 
 out_unlock:
+       ei->pde = NULL;
        iput(inode);
        return NULL;
 }