Patch "do_last(): ELOOP failure exit should be done after leaving RCU mode" has been added to the 4.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    do_last(): ELOOP failure exit should be done after leaving RCU mode

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     do_last-eloop-failure-exit-should-be-done-after-leaving-rcu-mode.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 5129fa482b16615fd4464d2f5d23acb1b7056c66 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Date: Sat, 27 Feb 2016 19:37:37 -0500
Subject: do_last(): ELOOP failure exit should be done after leaving RCU mode

From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

commit 5129fa482b16615fd4464d2f5d23acb1b7056c66 upstream.

... or we risk seeing a bogus value of d_is_symlink() there.

Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 fs/namei.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3149,11 +3149,6 @@ finish_lookup:
 	if (unlikely(error))
 		return error;
 
-	if (unlikely(d_is_symlink(path.dentry)) && !(open_flag & O_PATH)) {
-		path_to_nameidata(&path, nd);
-		return -ELOOP;
-	}
-
 	if ((nd->flags & LOOKUP_RCU) || nd->path.mnt != path.mnt) {
 		path_to_nameidata(&path, nd);
 	} else {
@@ -3172,6 +3167,10 @@ finish_open:
 		return error;
 	}
 	audit_inode(nd->name, nd->path.dentry, 0);
+	if (unlikely(d_is_symlink(nd->path.dentry)) && !(open_flag & O_PATH)) {
+		error = -ELOOP;
+		goto out;
+	}
 	error = -EISDIR;
 	if ((open_flag & O_CREAT) && d_is_dir(nd->path.dentry))
 		goto out;


Patches currently in stable-queue which might be from viro@xxxxxxxxxxxxxxxxxx are

queue-4.4/make-sure-that-freeing-shmem-fast-symlinks-is-rcu-delayed.patch
queue-4.4/do_last-eloop-failure-exit-should-be-done-after-leaving-rcu-mode.patch
queue-4.4/bcache-fix-a-leak-in-bch_cached_dev_run.patch
queue-4.4/do_last-don-t-let-a-bogus-return-value-from-open-et.al.-to-confuse-us.patch
queue-4.4/locks-fix-unlock-when-fcntl_setlk-races-with-a-close.patch
queue-4.4/namei-d_inode-of-a-pinned-dentry-is-stable-only-for-positives.patch
queue-4.4/should_follow_link-validate-d_seq-after-having-decided-to-follow.patch
queue-4.4/uml-fix-hostfs-mknod.patch
queue-4.4/hpfs-don-t-truncate-the-file-when-delete-fails.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]