Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1362743

[PATCH 2/2] ovl: ignore permissions on underlying lookup

From Miklos Szeredi <miklos@szeredi.hu>
Newsgroups linux.kernel
Subject [PATCH 2/2] ovl: ignore permissions on underlying lookup
Date 2016-03-22 14:30 +0100
Message-ID <rfuxI-4WW-15@gated-at.bofh.it> (permalink)
References <rfuo4-4SV-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Generally permission checking is not necessary when overlayfs looks up a
dentry on one of the underlying layers, since search permission on base
directory was already checked in ovl_permission().

More specifically using lookup_one_len() causes a problem when the lower
directory lacks search permission for a specific user while the upper
directory does have search permission.  Since lookups are cached, this
causes inconsistency in behavior: success depends on who did the first
lookup.

So instead use lookup_hash() which doesn't do the permission check.

Reported-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
---
 fs/overlayfs/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -379,7 +379,7 @@ static inline struct dentry *ovl_lookup_
 	struct dentry *dentry;
 
 	inode_lock(dir->d_inode);
-	dentry = lookup_one_len(name->name, dir, name->len);
+	dentry = lookup_hash(name, dir, 0);
 	inode_unlock(dir->d_inode);
 
 	if (IS_ERR(dentry)) {

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] vfs: export lookup_hash() to modules Miklos Szeredi <miklos@szeredi.hu> - 2016-03-22 14:20 +0100
  [PATCH 2/2] ovl: ignore permissions on underlying lookup Miklos Szeredi <miklos@szeredi.hu> - 2016-03-22 14:30 +0100

csiph-web