2007-01-10 06:33:09 +00:00
|
|
|
Pass struct vfsmount to the inode_removexattr LSM hook
|
|
|
|
|
|
|
|
Signed-off-by: Tony Jones <tonyj@suse.de>
|
|
|
|
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
|
|
|
|
|
|
|
|
Index: linux-2.6.19/fs/xattr.c
|
|
|
|
===================================================================
|
|
|
|
--- linux-2.6.19.orig/fs/xattr.c
|
|
|
|
+++ linux-2.6.19/fs/xattr.c
|
2007-01-17 07:12:32 +00:00
|
|
|
@@ -178,7 +178,7 @@ vfs_removexattr(struct dentry *dentry, s
|
2007-01-10 06:33:09 +00:00
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
- error = security_inode_removexattr(dentry, name);
|
2007-01-17 07:12:32 +00:00
|
|
|
+ error = security_inode_removexattr(dentry, mnt, name);
|
2007-01-10 06:33:09 +00:00
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
Index: linux-2.6.19/include/linux/security.h
|
|
|
|
===================================================================
|
|
|
|
--- linux-2.6.19.orig/include/linux/security.h
|
|
|
|
+++ linux-2.6.19/include/linux/security.h
|
|
|
|
@@ -50,7 +50,7 @@ extern int cap_bprm_set_security (struct
|
|
|
|
extern void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe);
|
|
|
|
extern int cap_bprm_secureexec(struct linux_binprm *bprm);
|
2007-01-17 07:12:32 +00:00
|
|
|
extern int cap_inode_setxattr(struct dentry *dentry, struct vfsmount *mnt, char *name, void *value, size_t size, int flags);
|
2007-01-10 06:33:09 +00:00
|
|
|
-extern int cap_inode_removexattr(struct dentry *dentry, char *name);
|
2007-01-17 07:12:32 +00:00
|
|
|
+extern int cap_inode_removexattr(struct dentry *dentry, struct vfsmount *mnt, char *name);
|
2007-01-10 06:33:09 +00:00
|
|
|
extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
|
|
|
|
extern void cap_task_reparent_to_init (struct task_struct *p);
|
|
|
|
extern int cap_syslog (int type);
|
2007-01-17 07:12:32 +00:00
|
|
|
@@ -1259,7 +1259,8 @@ struct security_operations {
|
|
|
|
int (*inode_getxattr) (struct dentry *dentry, struct vfsmount *mnt,
|
2007-01-10 06:33:09 +00:00
|
|
|
char *name);
|
2007-01-17 07:12:32 +00:00
|
|
|
int (*inode_listxattr) (struct dentry *dentry, struct vfsmount *mnt);
|
2007-01-10 06:33:09 +00:00
|
|
|
- int (*inode_removexattr) (struct dentry *dentry, char *name);
|
2007-01-17 07:12:32 +00:00
|
|
|
+ int (*inode_removexattr) (struct dentry *dentry, struct vfsmount *mnt,
|
2007-01-10 06:33:09 +00:00
|
|
|
+ char *name);
|
|
|
|
const char *(*inode_xattr_getsuffix) (void);
|
|
|
|
int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err);
|
|
|
|
int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags);
|
2007-01-17 07:12:32 +00:00
|
|
|
@@ -1808,11 +1809,12 @@ static inline int security_inode_listxat
|
|
|
|
return security_ops->inode_listxattr (dentry, mnt);
|
2007-01-10 06:33:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
-static inline int security_inode_removexattr (struct dentry *dentry, char *name)
|
2007-01-17 07:12:32 +00:00
|
|
|
+static inline int security_inode_removexattr (struct dentry *dentry,
|
|
|
|
+ struct vfsmount *mnt, char *name)
|
2007-01-10 06:33:09 +00:00
|
|
|
{
|
|
|
|
if (unlikely (IS_PRIVATE (dentry->d_inode)))
|
|
|
|
return 0;
|
|
|
|
- return security_ops->inode_removexattr (dentry, name);
|
2007-01-17 07:12:32 +00:00
|
|
|
+ return security_ops->inode_removexattr (dentry, mnt, name);
|
2007-01-10 06:33:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline const char *security_inode_xattr_getsuffix(void)
|
2007-01-17 07:12:32 +00:00
|
|
|
@@ -2511,9 +2513,10 @@ static inline int security_inode_listxat
|
2007-01-10 06:33:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static inline int security_inode_removexattr (struct dentry *dentry, char *name)
|
2007-01-17 07:12:32 +00:00
|
|
|
+static inline int security_inode_removexattr (struct dentry *dentry,
|
|
|
|
+ struct vfsmount *mnt, char *name)
|
2007-01-10 06:33:09 +00:00
|
|
|
{
|
|
|
|
- return cap_inode_removexattr(dentry, name);
|
2007-01-17 07:12:32 +00:00
|
|
|
+ return cap_inode_removexattr(dentry, mnt, name);
|
2007-01-10 06:33:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline const char *security_inode_xattr_getsuffix (void)
|
|
|
|
Index: linux-2.6.19/security/commoncap.c
|
|
|
|
===================================================================
|
|
|
|
--- linux-2.6.19.orig/security/commoncap.c
|
|
|
|
+++ linux-2.6.19/security/commoncap.c
|
2007-01-17 07:12:32 +00:00
|
|
|
@@ -201,7 +201,8 @@ int cap_inode_setxattr(struct dentry *de
|
2007-01-10 06:33:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-int cap_inode_removexattr(struct dentry *dentry, char *name)
|
2007-01-17 07:12:32 +00:00
|
|
|
+int cap_inode_removexattr(struct dentry *dentry, struct vfsmount *mnt,
|
2007-01-10 06:33:09 +00:00
|
|
|
+ char *name)
|
|
|
|
{
|
|
|
|
if (!strncmp(name, XATTR_SECURITY_PREFIX,
|
|
|
|
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
|
|
|
|
Index: linux-2.6.19/security/dummy.c
|
|
|
|
===================================================================
|
|
|
|
--- linux-2.6.19.orig/security/dummy.c
|
|
|
|
+++ linux-2.6.19/security/dummy.c
|
2007-01-17 07:12:32 +00:00
|
|
|
@@ -379,7 +379,8 @@ static int dummy_inode_listxattr (struct
|
2007-01-10 06:33:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int dummy_inode_removexattr (struct dentry *dentry, char *name)
|
2007-01-17 07:12:32 +00:00
|
|
|
+static int dummy_inode_removexattr (struct dentry *dentry, struct vfsmount *mnt,
|
2007-01-10 06:33:09 +00:00
|
|
|
+ char *name)
|
|
|
|
{
|
|
|
|
if (!strncmp(name, XATTR_SECURITY_PREFIX,
|
|
|
|
sizeof(XATTR_SECURITY_PREFIX) - 1) &&
|
|
|
|
Index: linux-2.6.19/security/selinux/hooks.c
|
|
|
|
===================================================================
|
|
|
|
--- linux-2.6.19.orig/security/selinux/hooks.c
|
|
|
|
+++ linux-2.6.19/security/selinux/hooks.c
|
2007-01-17 07:12:32 +00:00
|
|
|
@@ -2357,7 +2357,8 @@ static int selinux_inode_listxattr (stru
|
2007-01-10 06:33:09 +00:00
|
|
|
return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int selinux_inode_removexattr (struct dentry *dentry, char *name)
|
2007-01-17 07:12:32 +00:00
|
|
|
+static int selinux_inode_removexattr (struct dentry *dentry,
|
|
|
|
+ struct vfsmount *mnt, char *name)
|
2007-01-10 06:33:09 +00:00
|
|
|
{
|
|
|
|
if (strcmp(name, XATTR_NAME_SELINUX)) {
|
|
|
|
if (!strncmp(name, XATTR_SECURITY_PREFIX,
|