lkml.org 
[lkml]   [2012]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/5] overlayfs: switch to use inode_only_permissions
Date
When checking permissions on an overlayfs inode we do not take into
account either device cgroup restrictions nor security permissions.
This allows a user to mount an overlayfs layer over a restricted device
directory and by pass those permissions to open otherwise restricted
files.

Switch over to the newly introduced inode_only_permissions.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
fs/overlayfs/inode.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index ba1a777..bc9178c 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -105,19 +105,9 @@ int ovl_permission(struct inode *inode, int mask)
if (is_upper && !IS_RDONLY(inode) && IS_RDONLY(realinode) &&
(S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
goto out_dput;
-
- /*
- * Nobody gets write access to an immutable file.
- */
- err = -EACCES;
- if (IS_IMMUTABLE(realinode))
- goto out_dput;
}

- if (realinode->i_op->permission)
- err = realinode->i_op->permission(realinode, mask);
- else
- err = generic_permission(realinode, mask);
+ err = inode_only_permission(realinode, mask);
out_dput:
dput(alias);
return err;
--
1.7.9.5


\
 
 \ /
  Last update: 2012-05-01 17:41    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site