[patch 11/15] security: pass path to inode_listxattr

Previous thread: [patch 14/15] vfs: more path_permission() conversions by Miklos Szeredi on Thursday, May 29, 2008 - 6:49 am. (1 message)

Next thread: [PATCH] Optimize page_remove_rmap for anon pages by Martin Schwidefsky on Thursday, May 29, 2008 - 6:56 am. (5 messages)
From: Miklos Szeredi
Date: Thursday, May 29, 2008 - 6:49 am

From: Miklos Szeredi <mszeredi@suse.cz>

In the inode_listxattr() security operation and related functions pass
the path (vfsmount + dentry) instead of the dentry.  AppArmor will need
this.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
 fs/xattr.c               |    2 +-
 include/linux/security.h |    8 ++++----
 security/dummy.c         |    2 +-
 security/security.c      |    6 +++---
 security/selinux/hooks.c |    4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

Index: linux-2.6/fs/xattr.c
===================================================================
--- linux-2.6.orig/fs/xattr.c	2008-05-29 12:20:57.000000000 +0200
+++ linux-2.6/fs/xattr.c	2008-05-29 12:20:58.000000000 +0200
@@ -189,7 +189,7 @@ path_listxattr(struct path *path, char *
 	struct dentry *d = path->dentry;
 	ssize_t error;
 
-	error = security_inode_listxattr(d);
+	error = security_inode_listxattr(path);
 	if (error)
 		return error;
 	error = -EOPNOTSUPP;
Index: linux-2.6/include/linux/security.h
===================================================================
--- linux-2.6.orig/include/linux/security.h	2008-05-29 12:20:57.000000000 +0200
+++ linux-2.6/include/linux/security.h	2008-05-29 12:20:58.000000000 +0200
@@ -439,7 +439,7 @@ static inline void security_free_mnt_opt
  *	Return 0 if permission is granted.
  * @inode_listxattr:
  *	Check permission before obtaining the list of extended attribute
- *	names for @dentry.
+ *	names for @path.
  *	Return 0 if permission is granted.
  * @inode_removexattr:
  *	Check permission before removing the extended attribute
@@ -1376,7 +1376,7 @@ struct security_operations {
 	void (*inode_post_setxattr) (struct dentry *dentry, const char *name,
 				     const void *value, size_t size, int flags);
 	int (*inode_getxattr) (struct path *path, const char *name);
-	int (*inode_listxattr) (struct dentry *dentry);
+	int (*inode_listxattr) (struct path *path);
 	int (*inode_removexattr) (struct dentry *dentry, const char *name);
 	int ...
Previous thread: [patch 14/15] vfs: more path_permission() conversions by Miklos Szeredi on Thursday, May 29, 2008 - 6:49 am. (1 message)

Next thread: [PATCH] Optimize page_remove_rmap for anon pages by Martin Schwidefsky on Thursday, May 29, 2008 - 6:56 am. (5 messages)