FAILED: patch "[PATCH] path_openat(): fix double fput()" failed to apply to 3.14-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 3.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
f15133df088ecadd141ea1907f2c96df67c729f0Mon Sep 17 00:00:00 2001
From: Al Viro <[email protected]>
Date: Fri, 8 May 2015 22:53:15 -0400
Subject: [PATCH] path_openat(): fix double fput()
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().
Cc [email protected] # v3.11+
Signed-off-by Al Viro <[email protected]>
fs/namei.c +2 -1
@@ -3233,7 +3233,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, flags, nd);
@@ -3263,6 +3263,7 @@ static struct file *path_openat(int dfd, struct filename *pathname, } out:path_cleanup (nd); +out2:if (!(opened &FILE_OPENED )) {BUG_ON (!error);put_filp (file);