1
Pass struct vfsmount to the inode_getxattr LSM hook
3
Signed-off-by: Tony Jones <tonyj@suse.de>
4
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
7
===================================================================
10
@@ -117,7 +117,7 @@ vfs_getxattr(struct dentry *dentry, stru
14
- error = security_inode_getxattr(dentry, name);
15
+ error = security_inode_getxattr(dentry, mnt, name);
19
Index: b/include/linux/security.h
20
===================================================================
21
--- a/include/linux/security.h
22
+++ b/include/linux/security.h
23
@@ -391,7 +391,7 @@ struct request_sock;
24
* @value identified by @name for @dentry and @mnt.
26
* Check permission before obtaining the extended attributes
27
- * identified by @name for @dentry.
28
+ * identified by @name for @dentry and @mnt.
29
* Return 0 if permission is granted.
31
* Check permission before obtaining the list of extended attribute
32
@@ -1248,7 +1248,8 @@ struct security_operations {
34
char *name, void *value,
35
size_t size, int flags);
36
- int (*inode_getxattr) (struct dentry *dentry, char *name);
37
+ int (*inode_getxattr) (struct dentry *dentry, struct vfsmount *mnt,
39
int (*inode_listxattr) (struct dentry *dentry);
40
int (*inode_removexattr) (struct dentry *dentry, char *name);
41
const char *(*inode_xattr_getsuffix) (void);
42
@@ -1782,11 +1783,12 @@ static inline void security_inode_post_s
43
security_ops->inode_post_setxattr (dentry, mnt, name, value, size, flags);
46
-static inline int security_inode_getxattr (struct dentry *dentry, char *name)
47
+static inline int security_inode_getxattr (struct dentry *dentry,
48
+ struct vfsmount *mnt, char *name)
50
if (unlikely (IS_PRIVATE (dentry->d_inode)))
52
- return security_ops->inode_getxattr (dentry, name);
53
+ return security_ops->inode_getxattr (dentry, mnt, name);
56
static inline int security_inode_listxattr (struct dentry *dentry)
57
@@ -2487,7 +2489,8 @@ static inline void security_inode_post_s
61
-static inline int security_inode_getxattr (struct dentry *dentry, char *name)
62
+static inline int security_inode_getxattr (struct dentry *dentry,
63
+ struct vfsmount *mnt, char *name)
67
Index: b/security/dummy.c
68
===================================================================
69
--- a/security/dummy.c
70
+++ b/security/dummy.c
71
@@ -368,7 +368,8 @@ static void dummy_inode_post_setxattr (s
75
-static int dummy_inode_getxattr (struct dentry *dentry, char *name)
76
+static int dummy_inode_getxattr (struct dentry *dentry,
77
+ struct vfsmount *mnt, char *name)
81
Index: b/security/selinux/hooks.c
82
===================================================================
83
--- a/security/selinux/hooks.c
84
+++ b/security/selinux/hooks.c
85
@@ -2395,7 +2395,8 @@ static void selinux_inode_post_setxattr(
89
-static int selinux_inode_getxattr (struct dentry *dentry, char *name)
90
+static int selinux_inode_getxattr (struct dentry *dentry, struct vfsmount *mnt,
93
return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);