From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail177-1.suw61.mandrillapp.com ([198.2.177.1]:37017 "EHLO mail177-1.suw61.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752535AbcCAWXX (ORCPT ); Tue, 1 Mar 2016 17:23:23 -0500 Received: from pmta06.mandrill.prod.suw01.rsglab.com (127.0.0.1) by mail177-1.suw61.mandrillapp.com id hqob5m22rtkp for ; Tue, 1 Mar 2016 22:23:17 +0000 (envelope-from ) From: Subject: Patch "do_last(): ELOOP failure exit should be done after leaving RCU mode" has been added to the 4.4-stable tree To: , Cc: , Message-Id: <1456870996137137@kroah.com> Date: Tue, 01 Mar 2016 22:23:17 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From 5129fa482b16615fd4464d2f5d23acb1b7056c66 Mon Sep 17 00:00:00 2001 From: Al Viro 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 commit 5129fa482b16615fd4464d2f5d23acb1b7056c66 upstream. ... or we risk seeing a bogus value of d_is_symlink() there. Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- 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@zeniv.linux.org.uk 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