mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-06 17:31:01 +01:00
91 lines
3.4 KiB
Diff
91 lines
3.4 KiB
Diff
Index: linux-2.6/include/linux/security.h
|
|
===================================================================
|
|
--- linux-2.6.orig/include/linux/security.h
|
|
+++ linux-2.6/include/linux/security.h
|
|
@@ -361,8 +361,7 @@ struct request_sock;
|
|
* Return 0 if permission is granted.
|
|
* @inode_getattr:
|
|
* Check permission before obtaining file attributes.
|
|
- * @mnt is the vfsmount where the dentry was looked up
|
|
- * @dentry contains the dentry structure for the file.
|
|
+ * @path contains the vfsmount and dentry of the file.
|
|
* Return 0 if permission is granted.
|
|
* @inode_delete:
|
|
* @inode contains the inode structure for deleted inode.
|
|
@@ -1221,7 +1220,7 @@ struct security_operations {
|
|
int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
|
|
int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd);
|
|
int (*inode_setattr) (struct dentry *dentry, struct iattr *attr);
|
|
- int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
|
|
+ int (*inode_getattr) (struct path *path);
|
|
void (*inode_delete) (struct inode *inode);
|
|
int (*inode_setxattr) (struct dentry *dentry, char *name, void *value,
|
|
size_t size, int flags);
|
|
@@ -1713,12 +1712,11 @@ static inline int security_inode_setattr
|
|
return security_ops->inode_setattr (dentry, attr);
|
|
}
|
|
|
|
-static inline int security_inode_getattr (struct vfsmount *mnt,
|
|
- struct dentry *dentry)
|
|
+static inline int security_inode_getattr (struct path *path)
|
|
{
|
|
- if (unlikely (IS_PRIVATE (dentry->d_inode)))
|
|
+ if (unlikely (IS_PRIVATE (path->dentry->d_inode)))
|
|
return 0;
|
|
- return security_ops->inode_getattr (mnt, dentry);
|
|
+ return security_ops->inode_getattr (path);
|
|
}
|
|
|
|
static inline void security_inode_delete (struct inode *inode)
|
|
@@ -2414,8 +2412,7 @@ static inline int security_inode_setattr
|
|
return 0;
|
|
}
|
|
|
|
-static inline int security_inode_getattr (struct vfsmount *mnt,
|
|
- struct dentry *dentry)
|
|
+static inline int security_inode_getattr (struct path *path)
|
|
{
|
|
return 0;
|
|
}
|
|
Index: linux-2.6/security/dummy.c
|
|
===================================================================
|
|
--- linux-2.6.orig/security/dummy.c
|
|
+++ linux-2.6/security/dummy.c
|
|
@@ -333,7 +333,7 @@ static int dummy_inode_setattr (struct d
|
|
return 0;
|
|
}
|
|
|
|
-static int dummy_inode_getattr (struct vfsmount *mnt, struct dentry *dentry)
|
|
+static int dummy_inode_getattr (struct path *path)
|
|
{
|
|
return 0;
|
|
}
|
|
Index: linux-2.6/security/selinux/hooks.c
|
|
===================================================================
|
|
--- linux-2.6.orig/security/selinux/hooks.c
|
|
+++ linux-2.6/security/selinux/hooks.c
|
|
@@ -2243,9 +2243,9 @@ static int selinux_inode_setattr(struct
|
|
return dentry_has_perm(current, NULL, dentry, FILE__WRITE);
|
|
}
|
|
|
|
-static int selinux_inode_getattr(struct vfsmount *mnt, struct dentry *dentry)
|
|
+static int selinux_inode_getattr(struct path *path)
|
|
{
|
|
- return dentry_has_perm(current, mnt, dentry, FILE__GETATTR);
|
|
+ return dentry_has_perm(current, path->mnt, path->dentry, FILE__GETATTR);
|
|
}
|
|
|
|
static int selinux_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags)
|
|
Index: linux-2.6/fs/stat.c
|
|
===================================================================
|
|
--- linux-2.6.orig/fs/stat.c
|
|
+++ linux-2.6/fs/stat.c
|
|
@@ -43,7 +43,7 @@ int vfs_getattr(struct path *path, struc
|
|
struct inode *inode = path->dentry->d_inode;
|
|
int retval;
|
|
|
|
- retval = security_inode_getattr(path->mnt, path->dentry);
|
|
+ retval = security_inode_getattr(path);
|
|
if (retval)
|
|
return retval;
|
|
|