diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-08 22:53:15 -0400 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2019-05-02 16:56:59 +0200 |
| commit | c33a645445449a99675675338d8b41aa2a6d6f44 (patch) | |
| tree | 9bdf6caaf7342d899d3290621db4ecd2c44f966d | |
| parent | e135d6e85c3d71d27f0e583138767dc82836a8a5 (diff) | |
path_openat(): fix double fput()
[ Upstream commit f15133df088ecadd141ea1907f2c96df67c729f0 ]
path_openat() jumps to the wrong place after do_tmpfile() - it has
already done path_cleanup() (as part of path_lookupat() called by
do_tmpfile()), so doing that again can lead to double fput().
Change-Id: Ia74c130ae5e379b512532c0feebea871b5f73668
Cc: stable@vger.kernel.org # v3.11+
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
| -rw-r--r-- | fs/namei.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c index c7673d812..7cf9cd5f4 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3060,7 +3060,7 @@ static struct file *path_openat(int dfd, struct filename *pathname, if (unlikely(file->f_flags & __O_TMPFILE)) { error = do_tmpfile(dfd, pathname, nd, flags, op, file, &opened); - goto out; + goto out2; } error = path_init(dfd, pathname->name, flags | LOOKUP_PARENT, nd, &base); @@ -3098,6 +3098,7 @@ out: path_put(&nd->root); if (base) fput(base); +out2: if (!(opened & FILE_OPENED)) { BUG_ON(!error); put_filp(file); |
