aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-03-08 19:28:30 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-11 22:24:32 -0400
commit3f7036a071b879da017eddaedb10fba173fdf1ff (patch)
tree2160617c1812915583de79d2ee85913eb247e2a4 /security/selinux
parent2247386243747500977dc92b1ab833401303f9f0 (diff)
switch security_inode_getattr() to struct path *
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/hooks.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 4d1a54190388..e119cdcffc87 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1623,7 +1623,7 @@ static inline int dentry_has_perm(const struct cred *cred,
1623 the path to help the auditing code to more easily generate the 1623 the path to help the auditing code to more easily generate the
1624 pathname if needed. */ 1624 pathname if needed. */
1625static inline int path_has_perm(const struct cred *cred, 1625static inline int path_has_perm(const struct cred *cred,
1626 struct path *path, 1626 const struct path *path,
1627 u32 av) 1627 u32 av)
1628{ 1628{
1629 struct inode *inode = path->dentry->d_inode; 1629 struct inode *inode = path->dentry->d_inode;
@@ -2954,15 +2954,9 @@ static int selinux_inode_setattr(struct dentry *dentry, struct iattr *iattr)
2954 return dentry_has_perm(cred, dentry, av); 2954 return dentry_has_perm(cred, dentry, av);
2955} 2955}
2956 2956
2957static int selinux_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) 2957static int selinux_inode_getattr(const struct path *path)
2958{ 2958{
2959 const struct cred *cred = current_cred(); 2959 return path_has_perm(current_cred(), path, FILE__GETATTR);
2960 struct path path;
2961
2962 path.dentry = dentry;
2963 path.mnt = mnt;
2964
2965 return path_has_perm(cred, &path, FILE__GETATTR);
2966} 2960}
2967 2961
2968static int selinux_inode_setotherxattr(struct dentry *dentry, const char *name) 2962static int selinux_inode_setotherxattr(struct dentry *dentry, const char *name)