stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "ovl: fix dentry leak for default_permissions" has been added to the 4.6-stable tree
@ 2016-07-25  0:31 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-07-25  0:31 UTC (permalink / raw)
  To: mszeredi, gregkh; +Cc: stable, stable-commits


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

    ovl: fix dentry leak for default_permissions

to the 4.6-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:
     ovl-fix-dentry-leak-for-default_permissions.patch
and it can be found in the queue-4.6 subdirectory.

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


>From a4859d75944a726533ab86d24bb5ffd1b2b7d6cc Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <mszeredi@redhat.com>
Date: Wed, 29 Jun 2016 08:26:59 +0200
Subject: ovl: fix dentry leak for default_permissions

From: Miklos Szeredi <mszeredi@redhat.com>

commit a4859d75944a726533ab86d24bb5ffd1b2b7d6cc upstream.

When using the 'default_permissions' mount option, ovl_permission() on
non-directories was missing a dput(alias), resulting in "BUG Dentry still
in use".

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 8d3095f4ad47 ("ovl: default permissions")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/overlayfs/inode.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -121,16 +121,18 @@ int ovl_permission(struct inode *inode,
 
 		err = vfs_getattr(&realpath, &stat);
 		if (err)
-			return err;
+			goto out_dput;
 
+		err = -ESTALE;
 		if ((stat.mode ^ inode->i_mode) & S_IFMT)
-			return -ESTALE;
+			goto out_dput;
 
 		inode->i_mode = stat.mode;
 		inode->i_uid = stat.uid;
 		inode->i_gid = stat.gid;
 
-		return generic_permission(inode, mask);
+		err = generic_permission(inode, mask);
+		goto out_dput;
 	}
 
 	/* Careful in RCU walk mode */


Patches currently in stable-queue which might be from mszeredi@redhat.com are

queue-4.6/ovl-copy-up-underlying-inode-s-i_mode-to-overlay-inode.patch
queue-4.6/ovl-verify-upper-dentry-in-ovl_remove_and_whiteout.patch
queue-4.6/ovl-fix-dentry-leak-for-default_permissions.patch
queue-4.6/ovl-get_write_access-in-truncate.patch
queue-4.6/ovl-handle-attr_kill.patch
queue-4.6/vfs-add-d_real_inode-helper.patch
queue-4.6/af_unix-fix-hard-linked-sockets-on-overlay.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-25  0:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25  0:31 Patch "ovl: fix dentry leak for default_permissions" has been added to the 4.6-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).